Cardinality miss interpreted
SevKohler opened this issue · 7 comments
https://ckm.highmed.org/ckm/templates/1246.169.1187
Template does not enforce Verabreichte Dosen, but Dosismenge, if Verabreichte Dosis is contained.
Ehrbase enforces Dosismenge to be contained in the Composition and throws an validation error even thought that the Verabreichte Dosis is not necessary to be contained.
Correct would be enforcing Menge but only if Dosen is existent.
Example Composition:
{
"_type" : "COMPOSITION",
"name" : {
"_type" : "DV_TEXT",
"value" : "Impfstatus"
},
"archetype_details" : {
"archetype_id" : {
"value" : "openEHR-EHR-COMPOSITION.registereintrag.v1"
},
"template_id" : {
"value" : "Impfstatus"
},
"rm_version" : "1.0.4"
},
"feeder_audit" : {
"_type" : "FEEDER_AUDIT",
"originating_system_item_ids" : [ {
"_type" : "DV_IDENTIFIER",
"id" : "Immunization/2/_history/1",
"type" : "fhir_logical_id"
} ],
"originating_system_audit" : {
"_type" : "FEEDER_AUDIT_DETAILS",
"system_id" : "FHIR-Bridge"
}
},
"language" : {
"_type" : "CODE_PHRASE",
"terminology_id" : {
"_type" : "TERMINOLOGY_ID",
"value" : "ISO_639-1"
},
"code_string" : "de"
},
"territory" : {
"_type" : "CODE_PHRASE",
"terminology_id" : {
"_type" : "TERMINOLOGY_ID",
"value" : "ISO_3166-1"
},
"code_string" : "DE"
},
"category" : {
"_type" : "DV_CODED_TEXT",
"value" : "event",
"defining_code" : {
"_type" : "CODE_PHRASE",
"terminology_id" : {
"_type" : "TERMINOLOGY_ID",
"value" : "openehr"
},
"code_string" : "433"
}
},
"composer" : {
"_type" : "PARTY_SELF"
},
"context" : {
"_type" : "EVENT_CONTEXT",
"start_time" : {
"_type" : "DV_DATE_TIME",
"value" : "2020-12-27T00:00:00+01:00"
},
"setting" : {
"_type" : "DV_CODED_TEXT",
"value" : "secondary medical care",
"defining_code" : {
"_type" : "CODE_PHRASE",
"terminology_id" : {
"_type" : "TERMINOLOGY_ID",
"value" : "openehr"
},
"code_string" : "232"
}
}
},
"content" : [ {
"_type" : "ACTION",
"name" : {
"_type" : "DV_TEXT",
"value" : "Impfung"
},
"language" : {
"_type" : "CODE_PHRASE",
"terminology_id" : {
"_type" : "TERMINOLOGY_ID",
"value" : "ISO_639-1"
},
"code_string" : "de"
},
"encoding" : {
"_type" : "CODE_PHRASE",
"terminology_id" : {
"_type" : "TERMINOLOGY_ID",
"value" : "IANA_character-sets"
},
"code_string" : "UTF-8"
},
"subject" : {
"_type" : "PARTY_SELF"
},
"time" : {
"_type" : "DV_DATE_TIME",
"value" : "2020-12-27T00:00:00+01:00"
},
"description" : {
"_type" : "ITEM_TREE",
"name" : {
"_type" : "DV_TEXT",
"value" : "Tree"
},
"items" : [ {
"_type" : "ELEMENT",
"name" : {
"_type" : "DV_TEXT",
"value" : "Impfstoff"
},
"value" : {
"_type" : "DV_CODED_TEXT",
"value" : "Vaccine product containing only Severe acute respiratory syndrome coronavirus 2 messenger ribonucleic acid (medicinal product)",
"defining_code" : {
"_type" : "CODE_PHRASE",
"terminology_id" : {
"_type" : "TERMINOLOGY_ID",
"value" : "SNOMED Clinical Terms"
},
"code_string" : "1119349007"
}
},
"archetype_node_id" : "at0020"
}, {
"_type" : "ELEMENT",
"name" : {
"_type" : "DV_TEXT",
"value" : "Impfung gegen"
},
"value" : {
"_type" : "DV_CODED_TEXT",
"value" : "Disease caused by Severe acute respiratory syndrome coronavirus 2 (disorder)",
"defining_code" : {
"_type" : "CODE_PHRASE",
"terminology_id" : {
"_type" : "TERMINOLOGY_ID",
"value" : "SNOMED Clinical Terms"
},
"code_string" : "840539006"
}
},
"archetype_node_id" : "at0021"
} ],
"archetype_node_id" : "at0017"
},
"ism_transition" : {
"_type" : "ISM_TRANSITION",
"current_state" : {
"_type" : "DV_CODED_TEXT",
"value" : "completed",
"defining_code" : {
"_type" : "CODE_PHRASE",
"terminology_id" : {
"_type" : "TERMINOLOGY_ID",
"value" : "openehr"
},
"code_string" : "532"
}
}
},
"archetype_node_id" : "openEHR-EHR-ACTION.medication.v1"
} ],
"archetype_node_id" : "openEHR-EHR-COMPOSITION.registereintrag.v1"
}
ERROR:
{
"error": "org.ehrbase.validation.constraints.wrappers.ValidationException: :CAR01-Validation error at /content[openEHR-EHR-ACTION.medication.v1]/description[at0017]/items[openEHR-EHR-CLUSTER.dosage.v1]/items:Cardinality not matched, expected:[1..*], actual:0.\n",
"status": "Bad Request"
}
@chevalleyc can you take a look
Hi @SevKohler could you please upload template 'Impfstatus' thanks!
Upload to where ?
Directly to ehrbase again ?
link to the Template is in the first line of the ticket.
@SevKohler Thanks for your reply. I've got the template now
With the latest develop code base, I cannot reproduce this issue. However, to be successfully created, I had to modify one element as follows:
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Impfstoff"
},
"value": {
"_type": "DV_CODED_TEXT",
"value": "Vaccine product containing only Severe acute respiratory syndrome coronavirus 2 messenger ribonucleic acid (medicinal product)",
"defining_code": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "local_terms"
},
"code_string": "1119349007"
}
},
"archetype_node_id": "at0020"
},
The terminology id as specified in the template for this element is: "value": "local_terms"
reset and updated everything, works now.