You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Patient data can be masked within the extracted `Patient` resource. When masked, the value of the field will be replaced with a [Data Absent Reason extension](https://www.hl7.org/fhir/extension-data-absent-reason.html) with the code `masked`.
138
-
Patient properties that can be masked are: `gender`, `mrn`, `name`, `address`, `birthDate`, `language`, `ethnicity`, `birthsex`, `race`, `telecom`, `multipleBirth`, `photo`, `contact`, `generalPractitioner`, `managingOrganization`, and `link`.
138
+
Patient properties that can be masked are: `genderAndSex`, `mrn`, `name`, `address`, `birthDate`, `language`, `ethnicity`, `race`, `telecom`, `multipleBirth`, `photo`, `contact`, `generalPractitioner`, `managingOrganization`, and `link`.
139
139
To mask a property, provide an array of the properties to mask in the `constructorArgs` of the Patient extractor. For example, the following configuration can be used to mask `address` and `birthDate`:
throwError(`'${field}' is not a field that can be masked. Patient will only be extracted if all mask fields are valid. Valid fields include: Valid fields include: ${validFields.join(', ')}`);
118
117
}
119
118
// must check if the field exists in the patient resource, so we don't add unnecessary dataAbsent extensions
120
-
if(field==='gender'&&'gender'inpatient){
121
-
deletepatient.gender;
122
-
// an underscore is added when a primitive type is being replaced by an object (extension)
123
-
patient._gender=masked;
124
-
}elseif(field==='gender'&&'_gender'inpatient){
125
-
deletepatient._gender;// gender may have a dataAbsentReason on it for 'unknown' data, but we'll still want to mask it
126
-
patient._gender=masked;
119
+
if(field==='genderAndSex'){
120
+
if('gender'inpatient){
121
+
deletepatient.gender;
122
+
// an underscore is added when a primitive type is being replaced by an object (extension)
123
+
patient._gender=masked;
124
+
}elseif('_gender'inpatient){
125
+
deletepatient._gender;// gender may have a dataAbsentReason on it for 'unknown' data, but we'll still want to mask it
126
+
patient._gender=masked;
127
+
}
128
+
// fields that are extensions need to be differentiated by URL using fhirpath
0 commit comments