diff --git a/input/fsh/examples.fsh b/input/fsh/examples.fsh index d77f20260..02d63176c 100644 --- a/input/fsh/examples.fsh +++ b/input/fsh/examples.fsh @@ -29,6 +29,7 @@ Description: "Is used to document demographics and other administrative informat * extension[religion].valueCodeableConcept.coding.system = "http://terminology.hl7.org/CodeSystem/v3-ReligiousAffiliation" * extension[religion].valueCodeableConcept.text = "Christian (non-Catholic, non-specific)" * managingOrganization = Reference(OrganizationExample) +* extension[AdministrativeSexToAdministrativeGenderMap].valueCanonical = "http://openhie.org/fhir/zambia-immunizations/StructureMap/AdministrativeSexToAdministrativeGender" Instance: SpouseRelatedPersonExample InstanceOf: SpouseRelatedPerson diff --git a/input/fsh/extensions.fsh b/input/fsh/extensions.fsh index 42b4b3fe1..45841fe5d 100644 --- a/input/fsh/extensions.fsh +++ b/input/fsh/extensions.fsh @@ -14,4 +14,13 @@ Description: "This is an extension to capture whether the patient's date of birt * value[x] only boolean * value[x] 1.. * ^context[+].type = #element -* ^context[=].expression = "Patient.birthDate" \ No newline at end of file +* ^context[=].expression = "Patient.birthDate" + +Extension: PatientStructureMap +Id: patient-structure-map +Title: "Patient Structure Map" +Description: "Patient Structure Map" +* value[x] 1.. +* value[x] only Canonical(StructureMap) +* ^context[+].type = #element +* ^context[=].expression = "Patient" \ No newline at end of file diff --git a/input/fsh/smartcare.fsh b/input/fsh/smartcare.fsh index ca9cd4aaa..b73746ce0 100644 --- a/input/fsh/smartcare.fsh +++ b/input/fsh/smartcare.fsh @@ -78,6 +78,9 @@ Description: "Is used to document demographics and other administrative informat * extension[religion].valueCodeableConcept.coding.system 1..1 * extension[religion].valueCodeableConcept.coding.code 1..1 +* extension contains patient-structure-map named AdministrativeSexToAdministrativeGenderMap 1..1 +* extension[AdministrativeSexToAdministrativeGenderMap].valueCanonical = "http://openhie.org/fhir/zambia-immunizations/StructureMap/AdministrativeSexToAdministrativeGender" + * maritalStatus 0..1 MS * maritalStatus.coding 1..1 * maritalStatus.coding.code 1..1 @@ -204,7 +207,7 @@ Description: "Represents the current facility at which the patient is receiving Profile: GenericObservation Parent: Observation -Id: generic-social-hsitory-observation-profile +Id: generic-social-history-observation-profile Title: "Generic Social History Observation Profile" Description: "This profile acts as a base profile from which more specific social history observation profiles can be derived." * status 1..1 diff --git a/input/maps/AdministrativeSexToAdministrativeGender.fml b/input/maps/AdministrativeSexToAdministrativeGender.fml index 1e304224e..7487b17bb 100644 --- a/input/maps/AdministrativeSexToAdministrativeGender.fml +++ b/input/maps/AdministrativeSexToAdministrativeGender.fml @@ -4,9 +4,9 @@ /// title = 'Administrative Sex To Administrative Gender' /// status = 'active' -uses "http://openhie.org/fhir/zambia-immunizations/StructureDefinition/immunization-patient" alias PatientProfile as source -uses "http://openhie.org/fhir/zambia-immunizations/StructureDefinition/immunization-patient" alias Patient as target +uses "http://openhie.org/fhir/zambia-immunizations/StructureDefinition/immunization-patient" alias srcPatient as source +uses "http://openhie.org/fhir/zambia-immunizations/StructureDefinition/immunization-patient" alias tgtPatient as target -group SetPatientGender(source pat : PatientProfile, target patient : Patient) { +group SetPatientGender(source pat : srcPatient, target patient : tgtPatient) { pat.gender as gender -> patient.gender = translate(gender, 'http://openhie.org/fhir/zambia-immunizations/ConceptMap/AdministrativeSexToAdministrativeGender', 'code') "SetGender"; } \ No newline at end of file diff --git a/input/maps/PropietaryEducationLevelToLOINCEducationLevel.fml b/input/maps/PropietaryEducationLevelToLOINCEducationLevel.fml index 2d55f2b50..2bde8c92f 100644 --- a/input/maps/PropietaryEducationLevelToLOINCEducationLevel.fml +++ b/input/maps/PropietaryEducationLevelToLOINCEducationLevel.fml @@ -1,14 +1,30 @@ -/*/// url = 'http://openhie.org/fhir/zambia-immunizations/StructureMap/PropietaryEducationLevelToLOINCEducationLevel' +/// url = 'http://openhie.org/fhir/zambia-immunizations/StructureMap/PropietaryEducationLevelToLOINCEducationLevel' /// name = 'PropietaryEducationLevelToLOINCEducationLevel' /// description = 'Maps the Propietary Educational Level codes To LOINC Educational Level codes.' /// title = 'Propietary Educational Level To LOINC Educational Level' /// status = 'active' -uses "http://openhie.org/fhir/zambia-immunizations/StructureDefinition/immunization-patient" alias PatientProfile as source -uses "http://openhie.org/fhir/zambia-immunizations/StructureDefinition/immunization-patient" alias Patient as target +uses "http://openhie.org/fhir/zambia-immunizations/StructureDefinition/patient-educational-level" alias srcObservation as source +uses "http://openhie.org/fhir/zambia-immunizations/StructureDefinition/patient-educational-level" alias tgtObservation as target -group SetPatientEducationalLevel(source pat : PatientProfile, target patient : Patient) { - pat.extension:EduLevelAttained as eduLevelAttained -> patient as patty then { - //eduLevelAttained -> patty.code = translate(eduLevelAttained, 'http://openhie.org/fhir/zambia-immunizations/ConceptMap/PropietaryEducationLevelToLOINCEducationLevel', 'code') "SetEducationalLevel"; - } -}*/ \ No newline at end of file +group SetPatientEducationalLevel(source obs : srcObservation, target observation : tgtObservation) { + /*obs.value -> observation.value = create('CodeableConcept') as value then { + obs.value -> value.coding = create('Coding') as coding then { + obs.value -> coding = translate(obs.value, 'http://openhie.org/fhir/zambia-immunizations/ConceptMap/ProprietaryEducationLevelToLOINCEducationLevel', 'code') "SetPatientEducation"; + } "SetEducationalLevelCoding"; + } "SetEducationalLevelCode"; + obs.value -> observation.value = obs.value "SetPatientEducationalLevel";*/ + + //pat.value as coding -> observation.value = translate(coding, 'http://openhie.org/fhir/zambia-immunizations/ConceptMap/ProprietaryEducationLevelToLOINCEducationLevel', 'code') "SetPatientEducation"; + + //obs.value.first() as coding -> observation.value as educationLevel then { + // coding -> educationLevel.coding = translate(coding, 'http://openhie.org/fhir/zambia-immunizations/ConceptMap/ProprietaryEducationLevelToLOINCEducationLevel', 'code') "SetPatientEducation"; + //} "SetEducationalLevelCode"; + + obs.value as srcCodeable, + srcCodeable.coding as srcCoding -> + observation.value as tgtCodeable, + tgtCodeable.coding as tgtCoding, + tgtCoding = translate(srcCoding, 'http://openhie.org/fhir/zambia-immunizations/ConceptMap/ProprietaryEducationLevelToLOINCEducationLevel', 'code') + "SetPatientEducation"; +} \ No newline at end of file