When I try to insert a composition created for the vcf_report template I get the following error:
{“message”:“unprocessable entity: Simplified-Format conversion failed: unknown simplified path: vcf_report/laboratory_test_result:0/any_event:0/genomic_variant_result:0/genomic_substitution_variant:0/refer
ence_sequence”,“validationErrors”:[],“error”:“Unprocessable Entity”}
in the template “genomic_substitution_variant” occurrences are changed from 0..* to 0..1 so there should not be genomic_substitution_variant:0 and in the composition I’m sending there is in fact:
e.g., one of the lines is
“vcf_report/laboratory_test_result:0/any_event:0/genomic_variant_result:0/genomic_substitution_variant/reference_sequence/source_name”: “NCBI”,
The :0 is not the problem. You don’t need it on a 0..1 node, FerroEHR just always puts the index in the path of the error message.
What the error actually says is that FerroEHR can’t find reference_sequence under genomic_substitution_variant in the web template it made from your template. In your screenshot that’s the slot with the openEHR-EHR-CLUSTER.reference_sequence filled in, so my guess is FerroEHR names or places that filled-in slot differently than EHRbase does.
Can you try this one?
GET /ferroehr/rest/openehr/v1/definition/template/adl1.4/vcf_report/example?format=FLAT&detail_level=complete
That gives you every FLAT path FerroEHR accepts for the template, so you can see what it expects under genomic_substitution_variant. If reference_sequence isn’t in there at all, that’s a bug on my side. Then please open an issue on Issues · FerroHEALTH/FerroEHR · GitHub with the OPT and the composition, so I can reproduce it.
test_method is an ELEMENT with no constraint on its value in the template, so any data value type is allowed there. FerroEHR used to drop that kind of node completely, which is why it wasn’t in the example and why the path got refused. Now it gets one path per data value type, the way the simplified formats spec does it for an open value.
If your composition has just .../test_method with nothing after it, that’s the part to change. The example lists test_method/coded_text_value first, but text_value works the same way. I also went through the rest of vcf_report and test_method was the only node that was missing
thank you. Now I still have four errors, arguably two types of errors
{“message”:“4 validation error(s)”,“validationErrors”:
1)[“/content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1]/protocol[at0004]/items[openEHR-EHR-CLUSTER.sequencing_assay.v0]/items[openEHR-EHR-CLUSTER.reference_sequence.v1]/items: cardinality violated: 2 children, expected at least 3”,
2)“/content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1]/protocol[at0004]/items[openEHR-EHR-CLUSTER.sequencing_assay.v0]/items[at0003]/value: expected RM type conforming to DV_CODED_TEXT but found DV_TEXT”,
3)“/content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1]/protocol[at0004]/items[openEHR-EHR-CLUSTER.sequencing_assay.v0]/items[at0006]/items[openEHR-EHR-CLUSTER.reference_sequence.v1]/items: cardinality violated: 2 children, expected at least 3”,
4)“/content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1]/protocol[at0004]/items[openEHR-EHR-CLUSTER.sequencing_assay.v0]/items[at0006]/items[openEHR-EHR-CLUSTER.reference_sequence.v1]/items: cardinality violated: 2 children, expected at least 3”],“error”:"Unprocessable*
1)below is the picture of the template for the first error. The children of “../sequencing_assay/reference_sequence/” are all optional in the template.
It is a cardinality setting in the reference sequence archetype
Cardinality is different from occurences and refers to the number of items possible in a container. The adl says
items cardinality matches {3..*; ordered}
Which neans a minimum of 3 elements in the cluster. The older archetype desigber let us set cardinalities but it proved tricky to use correctly and AD does not allow it to be adjusted. Edit to 0..* and it shoukd work but also report to CKM.
The fix from Ian sorted out the reference_sequence errors.
What about the error I reported as number 2 (see before for Archetype Designer figure) that is:
{“message”:“1 validation error(s)”,“validationErrors”:[“/content[openEHR-EHR-OBSERVATION.laboratory_test_result.v1]/protocol[at0004]/items[openEHR-EHR-CLUSTER.sequencing_assay.v0]/items[at0003]/value: expected RM type conforming to DV_CODED_TEXT but found DV_TEXT”],“error”:“Unprocessable Entity”}
I’d imagine the problem is the use of “|other” to express DV_TEXT when both DV_CODED_TEXT and DV_TEXT are allowed. @rubentalstra isn’t this allowed in FerroEHR?
That one is a bug on my side, your |other is correct. nucleic_acid allows both a coded value and free text, and FerroEHR only checked the coded one. I’m working on the fix in FerroHEALTH/FerroEHR#4226, and it will be in the next release, 5.5.0.