Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rmrlangford committed Feb 3, 2024
1 parent 9792ab6 commit 94166d0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
1 change: 1 addition & 0 deletions input/fsh/examples.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion input/fsh/extensions.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
* ^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"
5 changes: 4 additions & 1 deletion input/fsh/smartcare.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions input/maps/AdministrativeSexToAdministrativeGender.fml
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
32 changes: 24 additions & 8 deletions input/maps/PropietaryEducationLevelToLOINCEducationLevel.fml
Original file line number Diff line number Diff line change
@@ -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";
}
}*/
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";
}

0 comments on commit 94166d0

Please sign in to comment.