Skip to content

add de-identification section to SOF#5

Open
andreyorst wants to merge 2 commits intomainfrom
de-identification
Open

add de-identification section to SOF#5
andreyorst wants to merge 2 commits intomainfrom
de-identification

Conversation

@andreyorst
Copy link
Copy Markdown
Contributor

No description provided.

@andreyorst andreyorst requested a review from spicyfalafel April 3, 2026 11:37
@andreyorst andreyorst marked this pull request as draft April 3, 2026 11:40
@andreyorst andreyorst marked this pull request as ready for review April 3, 2026 12:06

## De-identification

ViewDefinition columns can be annotated with de-identification methods to transform sensitive data during SQL generation. Supported methods include redact, cryptoHash, dateshift, encrypt, substitute, perturb, and custom PostgreSQL functions.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since what version?

@@ -0,0 +1,341 @@
# De-identification

Aidbox supports per-column de-identification in ViewDefinitions via a FHIR extension. When a column has a de-identification extension, the SQL compiler wraps the column expression with a PostgreSQL function that transforms the value before it reaches the output.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since what version?


Install the package via FHIR package management and use these ViewDefinitions directly, or copy and customize them. Every cryptographic key parameter in the pre-built VDs is blank (`""`) — you must set real keys before using them for actual de-identification.

## Using the UI
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screenshot would help here

Comment thread docs/SUMMARY.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this summary.md file - obsolete

@@ -8,6 +8,10 @@ description: Create flat SQL views from FHIR resources using ViewDefinitions for
**SQL on FHIR** engine is currently in **preview**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove this hint btw


### birthDateSafeHarbor

Intended **only for `Patient.birthDate`**. Behaves like `dateshift` but returns NULL when the birth date implies the patient is over 89 years old, per HIPAA Safe Harbor rule 45 CFR 164.514(b)(2)(i)(C).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Applying this method to any other date column is semantically incorrect — the function computes `age(current_date, input)` and treats the input as a birth date. Use plain `dateshift` for non-birth-date fields.

Because the function depends on `current_date`, it is marked `STABLE` rather than `IMMUTABLE`. The age cutoff re-evaluates on every query.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STABLE rather than IMMUTABLE

it might be a bit unclear to a reader at this point what does this mean - a link might be usefull, and also some short explanations

| rangeType | code | no | `fixed` (absolute noise) or `proportional` (relative to value). Default: `fixed` |
| roundTo | integer | no | Decimal places to round to. 0 means integer. Default: 0 |

With `fixed` range type, noise is in the range ±span/2. With `proportional`, noise is ±(span × value)/2. Any other `rangeType` value raises a SQL error.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

±span/2 and ±(span × value)/2 don't look great
probably mark it with ``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants