Skip to content

Commit

Permalink
#35 Add Observation-glasgow-coma-scale.json as example of au-core-dis…
Browse files Browse the repository at this point in the history
…agnoticresult with components
  • Loading branch information
heathfrankel committed Sep 25, 2024
1 parent 12d6daf commit 50d0537
Show file tree
Hide file tree
Showing 3 changed files with 207 additions and 31 deletions.
64 changes: 64 additions & 0 deletions Sparked.Csv2FhirMapping/Maps/CSV2Observation.map
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ group ToObservation(source src : ObservationCSV, target tgt : Observation) {
src.component1_valueQuantity_code as s_code where length() > 0 -> t_quantity.code = s_code;
};

// valueCodeableConcept
src.component1_valueCodeableConcept_coding1_code as s_code where length() > 0 -> t_component.value = create('CodeableConcept') as t_codeableConcept then {
src.component1_valueCodeableConcept_coding1_system as s_system -> t_codeableConcept.coding = c(s_system, s_code) as t_coding first then {
src.component1_valueCodeableConcept_coding1_display as s_display where length() > 0 -> t_coding.display = s_display;
};
src.component1_valueCodeableConcept_coding2_code as s_code where length() > 0 -> t_codeableConcept then {
src.component1_valueCodeableConcept_coding2_system as s_system -> t_codeableConcept.coding = c(s_system, s_code) as t_coding first then {
src.component1_valueCodeableConcept_coding2_display as s_display where length() > 0 -> t_coding.display = s_display;
};
};
src.component1_valueCodeableConcept_text as s_text where length() > 0 -> t_codeableConcept.text = s_text;
};

};

src.component2_code_coding1_code as s_component_code where length() > 0 -> tgt.component as t_component first then {
Expand All @@ -281,5 +294,56 @@ group ToObservation(source src : ObservationCSV, target tgt : Observation) {
src.component2_valueQuantity_code as s_code where length() > 0 -> t_quantity.code = s_code;
};

// valueCodeableConcept
src.component2_valueCodeableConcept_coding1_code as s_code where length() > 0 -> t_component.value = create('CodeableConcept') as t_codeableConcept then {
src.component2_valueCodeableConcept_coding1_system as s_system -> t_codeableConcept.coding = c(s_system, s_code) as t_coding first then {
src.component2_valueCodeableConcept_coding1_display as s_display where length() > 0 -> t_coding.display = s_display;
};
src.component2_valueCodeableConcept_coding2_code as s_code where length() > 0 -> t_codeableConcept then {
src.component2_valueCodeableConcept_coding2_system as s_system -> t_codeableConcept.coding = c(s_system, s_code) as t_coding first then {
src.component2_valueCodeableConcept_coding2_display as s_display where length() > 0 -> t_coding.display = s_display;
};
};
src.component2_valueCodeableConcept_text as s_text where length() > 0 -> t_codeableConcept.text = s_text;
};

};

src.component3_code_coding1_code as s_component_code where length() > 0 -> tgt.component as t_component first then {
// code 1..1
src.component3_code_coding1_system as s_system -> t_component.code as t_code then {
s_system -> t_code.coding = c(s_system, s_component_code) as t_coding first then {
src.component3_code_coding1_display as s_display where length() > 0 -> t_coding.display = s_display;
};
src.component3_code_coding2_code as s_code where length() > 0 -> t_component then {
src.component3_code_coding2_system as s_system -> t_code.coding = c(s_system, s_code) as t_coding first then {
src.component3_code_coding2_display as s_display where length() > 0 -> t_coding.display = s_display;
};
};
src.component3_code_text as s_text where length() > 0 -> t_code.text = s_text;
};

// value 0..1
// valueQuantity
src.component3_valueQuantity_value as s_value where length() > 0 -> t_component.value = create('Quantity') as t_quantity then {
s_value -> t_quantity.value = s_value;
src.component3_valueQuantity_unit as s_unit where length() > 0 -> t_quantity.unit = s_unit;
src.component3_valueQuantity_system as s_system where length() > 0 -> t_quantity.system = s_system;
src.component3_valueQuantity_code as s_code where length() > 0 -> t_quantity.code = s_code;
};

// valueCodeableConcept
src.component3_valueCodeableConcept_coding1_code as s_code where length() > 0 -> t_component.value = create('CodeableConcept') as t_codeableConcept then {
src.component3_valueCodeableConcept_coding1_system as s_system -> t_codeableConcept.coding = c(s_system, s_code) as t_coding first then {
src.component3_valueCodeableConcept_coding1_display as s_display where length() > 0 -> t_coding.display = s_display;
};
src.component3_valueCodeableConcept_coding2_code as s_code where length() > 0 -> t_codeableConcept then {
src.component3_valueCodeableConcept_coding2_system as s_system -> t_codeableConcept.coding = c(s_system, s_code) as t_coding first then {
src.component3_valueCodeableConcept_coding2_display as s_display where length() > 0 -> t_coding.display = s_display;
};
};
src.component3_valueCodeableConcept_text as s_text where length() > 0 -> t_codeableConcept.text = s_text;
};

};
}
111 changes: 111 additions & 0 deletions generated/Observation-glasgow-coma-scale.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"resourceType": "Observation",
"id": "glasgow-coma-scale",
"meta": {
"profile": [
"http://hl7.org.au/fhir/core/StructureDefinition/au-core-diagnosticresult"
]
},
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "exam"
}
]
}
],
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "248241002"
}
]
},
"subject": {
"reference": "Patient/baratz-toni"
},
"effectiveDateTime": "2023-08-08T13:30:00.000Z",
"valueQuantity": {
"value": 13,
"system": "http://unitsofmeasure.org",
"code": "{score}"
},
"referenceRange": [
{
"low": {
"value": 13,
"system": "http://unitsofmeasure.org",
"code": "{score}"
},
"type": {
"text": "Mild TBI"
}
}
],
"component": [
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "9268-4",
"display": "Glasgow coma score motor"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://loinc.org",
"code": "LA6566-9",
"display": "Localizing pain"
}
]
}
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "9270-0",
"display": "Glasgow coma score verbal"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://loinc.org",
"code": "LA6560-2",
"display": "Confused"
}
]
}
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "9267-6",
"display": "Glasgow coma score eye opening"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://loinc.org",
"code": "LA6556-0",
"display": "Eyes open spontaneously"
}
]
}
}
]
}
Loading

0 comments on commit 50d0537

Please sign in to comment.