description: Extension for ViewDefinition columns that specifies a de-identification method and its parameters. Applied during SQL generation to wrap column expressions with the corresponding aidbox_deident_* PostgreSQL function. package_name: io.health-samurai.core.r3 derivation: constraint name: deIdentification type: Extension elements: extension: index: 0 slicing: rules: closed discriminator: - {path: url, type: value} min: 1 slices: custom_function: match: {url: custom_function} schema: short: Name of a custom PostgreSQL function to apply. First argument is the column value (text), optional second argument via custom_arg. index: 41 elements: url: pattern: {type: Uri, value: custom_function} index: 42 value: constraint: deident-customfn-1: {human: 'Function name must be a valid SQL identifier (letters, digits, underscores, dots)', severity: error, expression: '$this.matches(''^[a-zA-Z][a-zA-Z0-9_.]*$'')'} choices: [valueString] index: 44 valueString: type: string constraint: deident-customfn-1: {human: 'Function name must be a valid SQL identifier (letters, digits, underscores, dots)', severity: error, expression: '$this.matches(''^[a-zA-Z][a-zA-Z0-9_.]*$'')'} choiceOf: value index: 45 required: [valueString, value] method: match: {url: method} schema: short: De-identification method to apply. Required unless custom_function is used. index: 1 elements: url: pattern: {type: Uri, value: method} index: 2 value: choices: [valueCode] index: 4 valueCode: {type: code, choiceOf: value, index: 5} required: [valueCode, value] cryptoHashKey: match: {url: cryptoHashKey} schema: short: HMAC-SHA256 key for cryptoHash method. index: 6 elements: url: pattern: {type: Uri, value: cryptoHashKey} index: 7 value: choices: [valueString] index: 9 valueString: {type: string, choiceOf: value, index: 10} required: [valueString, value] rangeType: match: {url: rangeType} schema: short: 'Noise range type for perturb: fixed (absolute) or proportional (relative to value).' index: 31 elements: url: pattern: {type: Uri, value: rangeType} index: 32 value: choices: [valueCode] index: 34 valueCode: {type: code, choiceOf: value, index: 35} required: [valueCode, value] custom_arg: match: {url: custom_arg} schema: short: Optional second argument passed to the custom function. index: 46 elements: url: pattern: {type: Uri, value: custom_arg} index: 47 value: choices: [valueString, valueInteger, valueDecimal, valueBoolean, valueCode] index: 49 valueString: {type: string, choiceOf: value, index: 50} valueInteger: {type: integer, choiceOf: value, index: 51} valueDecimal: {type: decimal, choiceOf: value, index: 52} valueBoolean: {type: boolean, choiceOf: value, index: 53} valueCode: {type: code, choiceOf: value, index: 54} required: [valueString, valueCode, valueDecimal, value, valueBoolean, valueInteger] replaceWith: match: {url: replaceWith} schema: short: Fixed replacement value for substitute method. index: 21 elements: url: pattern: {type: Uri, value: replaceWith} index: 22 value: choices: [valueString] index: 24 valueString: {type: string, choiceOf: value, index: 25} required: [valueString, value] encryptKey: match: {url: encryptKey} schema: short: AES-128-CBC encryption key as hex string (32 hex chars = 16 bytes). index: 16 elements: url: pattern: {type: Uri, value: encryptKey} index: 17 value: constraint: deident-encryptkey-1: {human: 'Encryption key must be 8-32 hex characters (0-9, a-f)', severity: error, expression: '$this.matches(''^[0-9a-fA-F]{8,32}$'') and ($this.length() mod 2 = 0)'} choices: [valueString] index: 19 valueString: type: string constraint: deident-encryptkey-1: {human: 'Encryption key must be 8-32 hex characters (0-9, a-f)', severity: error, expression: '$this.matches(''^[0-9a-fA-F]{8,32}$'') and ($this.length() mod 2 = 0)'} choiceOf: value index: 20 required: [valueString, value] dateShiftKey: match: {url: dateShiftKey} schema: short: HMAC key for deterministic date shifting. Offset is derived from HMAC(key, resource.id). index: 11 elements: url: pattern: {type: Uri, value: dateShiftKey} index: 12 value: choices: [valueString] index: 14 valueString: {type: string, choiceOf: value, index: 15} required: [valueString, value] roundTo: match: {url: roundTo} schema: short: Decimal places to round to after perturbation. 0 means round to integer. index: 36 elements: url: pattern: {type: Uri, value: roundTo} index: 37 value: choices: [valueInteger] index: 39 valueInteger: {type: integer, choiceOf: value, index: 40} required: [value, valueInteger] span: match: {url: span} schema: short: Noise magnitude for perturb method. index: 26 elements: url: pattern: {type: Uri, value: span} index: 27 value: choices: [valueDecimal] index: 29 valueDecimal: {type: decimal, choiceOf: value, index: 30} required: [valueDecimal, value] url: pattern: {type: Uri, value: 'http://health-samurai.io/fhir/core/StructureDefinition/de-identification'} index: 55 value: choices: [] index: 57 package_version: 0.2605.6 extensions: custom_function: url: custom_function short: Name of a custom PostgreSQL function to apply. First argument is the column value (text), optional second argument via custom_arg. index: 41 elements: url: pattern: {type: Uri, value: custom_function} index: 42 value: constraint: deident-customfn-1: {human: 'Function name must be a valid SQL identifier (letters, digits, underscores, dots)', severity: error, expression: '$this.matches(''^[a-zA-Z][a-zA-Z0-9_.]*$'')'} choices: [valueString] index: 44 valueString: type: string constraint: deident-customfn-1: {human: 'Function name must be a valid SQL identifier (letters, digits, underscores, dots)', severity: error, expression: '$this.matches(''^[a-zA-Z][a-zA-Z0-9_.]*$'')'} choiceOf: value index: 45 required: [valueString, value] method: url: method short: De-identification method to apply. Required unless custom_function is used. index: 1 elements: url: pattern: {type: Uri, value: method} index: 2 value: choices: [valueCode] index: 4 valueCode: {type: code, choiceOf: value, index: 5} required: [valueCode, value] cryptoHashKey: url: cryptoHashKey short: HMAC-SHA256 key for cryptoHash method. index: 6 elements: url: pattern: {type: Uri, value: cryptoHashKey} index: 7 value: choices: [valueString] index: 9 valueString: {type: string, choiceOf: value, index: 10} required: [valueString, value] rangeType: url: rangeType short: 'Noise range type for perturb: fixed (absolute) or proportional (relative to value).' index: 31 elements: url: pattern: {type: Uri, value: rangeType} index: 32 value: choices: [valueCode] index: 34 valueCode: {type: code, choiceOf: value, index: 35} required: [valueCode, value] custom_arg: url: custom_arg short: Optional second argument passed to the custom function. index: 46 elements: url: pattern: {type: Uri, value: custom_arg} index: 47 value: choices: [valueString, valueInteger, valueDecimal, valueBoolean, valueCode] index: 49 valueString: {type: string, choiceOf: value, index: 50} valueInteger: {type: integer, choiceOf: value, index: 51} valueDecimal: {type: decimal, choiceOf: value, index: 52} valueBoolean: {type: boolean, choiceOf: value, index: 53} valueCode: {type: code, choiceOf: value, index: 54} required: [valueString, valueCode, valueDecimal, value, valueBoolean, valueInteger] replaceWith: url: replaceWith short: Fixed replacement value for substitute method. index: 21 elements: url: pattern: {type: Uri, value: replaceWith} index: 22 value: choices: [valueString] index: 24 valueString: {type: string, choiceOf: value, index: 25} required: [valueString, value] encryptKey: url: encryptKey short: AES-128-CBC encryption key as hex string (32 hex chars = 16 bytes). index: 16 elements: url: pattern: {type: Uri, value: encryptKey} index: 17 value: constraint: deident-encryptkey-1: {human: 'Encryption key must be 8-32 hex characters (0-9, a-f)', severity: error, expression: '$this.matches(''^[0-9a-fA-F]{8,32}$'') and ($this.length() mod 2 = 0)'} choices: [valueString] index: 19 valueString: type: string constraint: deident-encryptkey-1: {human: 'Encryption key must be 8-32 hex characters (0-9, a-f)', severity: error, expression: '$this.matches(''^[0-9a-fA-F]{8,32}$'') and ($this.length() mod 2 = 0)'} choiceOf: value index: 20 required: [valueString, value] dateShiftKey: url: dateShiftKey short: HMAC key for deterministic date shifting. Offset is derived from HMAC(key, resource.id). index: 11 elements: url: pattern: {type: Uri, value: dateShiftKey} index: 12 value: choices: [valueString] index: 14 valueString: {type: string, choiceOf: value, index: 15} required: [valueString, value] roundTo: url: roundTo short: Decimal places to round to after perturbation. 0 means round to integer. index: 36 elements: url: pattern: {type: Uri, value: roundTo} index: 37 value: choices: [valueInteger] index: 39 valueInteger: {type: integer, choiceOf: value, index: 40} required: [value, valueInteger] span: url: span short: Noise magnitude for perturb method. index: 26 elements: url: pattern: {type: Uri, value: span} index: 27 value: choices: [valueDecimal] index: 29 valueDecimal: {type: decimal, choiceOf: value, index: 30} required: [valueDecimal, value] class: extension kind: complex-type url: http://health-samurai.io/fhir/core/StructureDefinition/de-identification base: http://hl7.org/fhir/StructureDefinition/Extension version: 0.2605.6 required: [extension]