diff --git a/resources/Relationships/PatientRelationship.json b/resources/Relationships/PatientRelationship.json new file mode 100644 index 00000000..b2992af8 --- /dev/null +++ b/resources/Relationships/PatientRelationship.json @@ -0,0 +1,142 @@ +{ + "resourceType": "Basic", + "id": "patientreport", + "meta": { + "versionId": "1", + "lastUpdated": "2019-07-30T07:34:24.098+00:00", + "profile": [ + "http://ihris.org/fhir/StructureDefinition/iHRISRelationship" + ] + }, + "extension": [ + { + "url": "http://ihris.org/fhir/StructureDefinition/iHRISReportDetails", + "extension": [ + { + "url": "label", + "valueString": "Patient Report" + }, + { + "url": "name", + "valueString": "patients" + }, + { + "url": "http://ihris.org/fhir/StructureDefinition/iHRISReportElement", + "extension": [ + { + "url": "label", + "valueString": "gender" + }, + { + "url": "name", + "valueString": "gender" + } + ] + }, + { + "url": "http://ihris.org/fhir/StructureDefinition/iHRISReportElement", + "extension": [ + { + "url": "label", + "valueString": "birthDate" + }, + { + "url": "name", + "valueString": "birthDate" + } + ] + }, + { + "url": "http://ihris.org/fhir/StructureDefinition/iHRISReportElement", + "extension": [ + { + "url": "label", + "valueString": "given" + }, + { + "url": "name", + "valueString": "name.where(use='official').last().given" + } + ] + }, + { + "url": "http://ihris.org/fhir/StructureDefinition/iHRISReportElement", + "extension": [ + { + "url": "label", + "valueString": "family" + }, + { + "url": "name", + "valueString": "name.where(use='official').last().family" + } + ] + }, + { + "url": "http://ihris.org/fhir/StructureDefinition/iHRISReportElement", + "extension": [ + { + "url": "label", + "valueString": "fullname" + }, + { + "url": "name", + "valueString": "name.where(use='official').last().text" + } + ] + }, + { + "url": "http://ihris.org/fhir/StructureDefinition/iHRISReportElement", + "extension": [ + { + "url": "label", + "valueString": "phone" + }, + { + "url": "name", + "valueString": "telecom.where(system='phone').value" + } + ] + }, + { + "url": "http://ihris.org/fhir/StructureDefinition/iHRISReportElement", + "extension": [ + { + "url": "label", + "valueString": "nationalid" + }, + { + "url": "name", + "valueString": "identifier.where(system='http://clientregistry.org/nationalid').last().value" + } + ] + }, + { + "url": "http://ihris.org/fhir/StructureDefinition/iHRISReportElement", + "extension": [ + { + "url": "label", + "valueString": "art" + }, + { + "url": "name", + "valueString": "identifier.where(system='http://clientregistry.org/artnumber').value" + } + ] + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://ihris.org/fhir/ValueSet/ihris-resource", + "code": "iHRISRelationship" + } + ], + "text": "iHRISRelationship" + }, + "subject": { + "reference": "StructureDefinition/Patient" + } +} \ No newline at end of file diff --git a/server/config/decisionRules.json b/server/config/decisionRules.json new file mode 100644 index 00000000..68ee359d --- /dev/null +++ b/server/config/decisionRules.json @@ -0,0 +1,70 @@ +{ + "__comments": { + "path": "Its a fhir path, for syntax refer to https://www.hl7.org/fhir/fhirpath.html", + "matchingType": "Must be specified, it can either", + "threshold": { + "levenshtein": "Lower the number, the closer the match, 0 being exact match, max threshold is 2", + "jaro-winkler": "number between 0 and 1, where 0 for no match and 1 for exact match" + }, + "supported_algorithms": { + "elasticsearch": ["https://github.com/intrahealth/similarity-scoring"] + } + }, + "rules": [{ + "matchingType": "deterministic", + "fields": { + "given": { + "algorithm": "jaro-winkler-similarity", + "threshold": 0.8, + "fhirpath": "name.where(use='official').given", + "null_handling": "moderate", + "null_handling_both": "moderate", + "espath": "given" + }, + "family": { + "algorithm": "jaro-winkler-similarity", + "threshold": 0.9, + "fhirpath": "name.where(use='official').family", + "null_handling": "moderate", + "null_handling_both": "moderate", + "espath": "family" + }, + "birthdate": { + "algorithm": "exact", + "fhirpath": "birthDate", + "null_handling": "moderate", + "null_handling_both": "moderate", + "espath": "birthDate" + }, + "phone": { + "algorithm": "exact", + "fhirpath": "telecom.where(system='phone').value", + "null_handling": "moderate", + "null_handling_both": "moderate", + "espath": "phone" + }, + "nationalid": { + "algorithm": "exact", + "fhirpath": "identifier.where(system='http://clientregistry.org/nationalid').value", + "null_handling": "moderate", + "null_handling_both": "moderate", + "espath": "nationalid" + }, + "art": { + "algorithm": "exact", + "fhirpath": "identifier.where(system='http://clientregistry.org/artnumber').value", + "null_handling": "moderate", + "null_handling_both": "moderate", + "espath": "art" + } + }, + "potentialMatchThreshold": 4, + "autoMatchThreshold": 6, + "filters": { + "gender": { + "fhirpath": "gender", + "espath": "gender" + } + } + }] +} \ No newline at end of file