PersonMap.fml · fhir2omop
refs/refs/fhir-omop-ig/input/maps/PersonMap.fml
19 lines · fml
1/// url = 'http://hl7.org/fhir/uv/omop/StructureMap/PersonMap' 3/// title = 'Mapping Patient resource to Person OMOP Domain' 5/// description = "This mapping maps FHIR Patient instances to OMOP Person Table objects." 7uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as source 8uses "http://hl7.org/fhir/uv/omop/StructureDefinition/Person" alias PersonTable as target 10group Person(source src: Patient, target tgt : PersonTable) { 11 //src.id as id -> tgt.person_id = cast(id, "integer"); 12 // Should actually be a translate from gender to the OMOP concept. 13 src.gender as gender -> tgt.gender_concept_id = gender, tgt.gender_source_value = cast(gender, "string"); 14 src.birthDate as bdSrc -> tgt.birth_datetime = bdSrc, 15 tgt.year_of_birth = (src.birthDate.toString().substring(0,4)), 16 tgt.month_of_birth = (src.birthDate.toString().substring(5,2)), 17 tgt.day_of_birth = (src.birthDate.toString().substring(8,2));