We are looking for ways to use simplified formats (FLAT or STRUCTURED) on a contribution level, because we want to commit several compositions in the same contribution. The specific use case is described here (TLDR: we model a large report dynamically as a set of modular templates that are committed in distinct compositions and held together in a “compound document” composition, similar to Better’s approach in their Form Builder), and also relates to Dynamic archetype in slot based on preconditions.
This works with canonical compositions, but our developers prefer FLAT and STRUCTURED.
To our knowledge, it is not possible to use simplified format for the whole contribution, is that correct?
As a work-around, we managed to commit to the Better CDR via the /rest/openehr/v1/ehr/{ehr_id}/contribution endpoint a contribution in canonical form, but with a FLAT composition within data and Content-Type: application/openehr.wt.flat+json in the Header:
POST Body
{
“versions”: [
{
"uid": "12345678-aaaa-bbbb-cccc-1234567890ab::abc::1",
"lifecycle_state": {
"\_type": "DV_CODED_TEXT",
"value": "complete",
"defining_code": {
"\_type": "CODE_PHRASE",
"terminology_id": {"\_type": "TERMINOLOGY_ID", "value": "openehr"},
"code_string": "532"
}
},
"commit_audit": {
"\_type": "UPDATE_AUDIT",
"system_id": "abc",
"change_type": {
"value": "creation",
"defining_code": {
"\_type": "CODE_PHRASE",
"terminology_id": {"\_type": "TERMINOLOGY_ID", "value": "openehr"},
"code_string": "249"
}
},
"committer": {
"\_type": "PARTY_IDENTIFIED",
"name": "Dr. House"
}
},
"data": {
"ctx/template_id": "cistec.openehr.heart_sounds_murmurs.v1",
"ctx/language": "en",
"ctx/territory": "US",
"ctx/composer_name": "Susan Clark",
"ctx/id_namespace": "HOSPITAL-NS",
"ctx/id_scheme": "HOSPITAL-NS",
"ctx/health_care_facility|name": "Hospital",
"ctx/health_care_facility|id": "9091",
"ctx/category": "report",
"ctx/setting": "secondary medical care",
"heart_sounds_and_murmurs/physical_examination_findings/heart_sounds_finding/system_or_structure_examined|value": "Heart sounds",
"heart_sounds_and_murmurs/physical_examination_findings/heart_sounds_finding/system_or_structure_examined|code": "271660002",
"heart_sounds_and_murmurs/physical_examination_findings/heart_sounds_finding/system_or_structure_examined|terminology": "SNOMED-CT",
"heart_sounds_and_murmurs/physical_examination_findings/heart_sounds_finding/heart_sounds|value": "Normal",
"heart_sounds_and_murmurs/physical_examination_findings/heart_sounds_finding/heart_sounds|code": "301132007",
"heart_sounds_and_murmurs/physical_examination_findings/heart_sounds_finding/heart_sounds|terminology": "SNOMED-CT",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/system_or_structure_examined|value": "Heart murmur",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/system_or_structure_examined|code": "421493004",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/system_or_structure_examined|terminology": "SNOMED-CT",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/clinical_interpretation:0": "0.0",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/clinical_interpretation:1": "0.1",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/phase_of_heart_cycle|value": "Systole",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/phase_of_heart_cycle|code": "at0.31",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/phase_of_heart_cycle|terminology": "local",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/murmur_intensity|value": "I/VI",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/murmur_intensity|code": "at0.18",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:0/murmur_intensity|terminology": "local",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/system_or_structure_examined|value": "Heart murmur",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/system_or_structure_examined|code": "421493004",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/system_or_structure_examined|terminology": "SNOMED-CT",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/clinical_interpretation:0": "1.0",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/clinical_interpretation:1": "1.1",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/clinical_interpretation:2": "1.2",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/phase_of_heart_cycle|value": "Diastole",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/phase_of_heart_cycle|code": "at0.32",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/phase_of_heart_cycle|terminology": "local",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/murmur_intensity|value": "II/VI",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/murmur_intensity|code": "at0.19",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding:1/murmur_intensity|terminology": "local",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding/murmur|value": "Absent",
"heart_sounds_and_murmurs/physical_examination_findings/heart_murmurs_finding/murmur|code": "at0.26"
}
}
],
“audit”: {
"\_type": "UPDATE_AUDIT",
"system_id": "abc",
"change_type": {
"value": "creation",
"defining_code": {
"\_type": "CODE_PHRASE",
"terminology_id": {"\_type": "TERMINOLOGY_ID", "value": "openehr"},
"code_string": "249"
}
},
"committer": {
"\_type": "PARTY_IDENTIFIED",
"name": "Dr. House"
}
}
}
This work-around does not work on EHRbase, POSTing fails with a 415 - Unsupported Media Type.
Editing contribution metadata via Headers in the /composition endpoint does not seem to be sufficient, as this only edits metadata of the current contribution and would not allow multiple compositions to be packed into a single contribution.
Are we correct in our current analysis or did we miss something?
Does anyone have suggestions on how we could commit multiple simplified compositions together?