error in uploading a composition, from vcf_report template, in FLAT format to FerroEHR

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”,

Any idea of what is happening? (the same composition is inserted with success in EHRbase)

Hi Giovanni,

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.

thank you. I’ve posted the issue

the fixes are in the new release: Release 5.3.2 · FerroHEALTH/FerroEHR · GitHub

so quick. thank you. Unfortunately I have to report another problem with the same opt:

{“message”:“unprocessable entity: Simplified-Format conversion failed: unknown simplified path: vcf_report/laboratory_test_result:0/test_method”,“validationErrors”:[],“error”:“Unprocessable Entity”}

test_method is missing in fact also in the example with detail=complete.

Thanks for the issue (field missing in FLAT example creation from OPT · Issue #3933 · FerroHEALTH/FerroEHR · GitHub), it’s fixed in 5.3.3: Release 5.3.3 · FerroHEALTH/FerroEHR · GitHub what just got released.

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.

So in your composition use:

"vcf_report/laboratory_test_result:0/test_method/text_value": "your method"

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

if you find any more of these edge cases please let me know and while fixing this also found an SPEC issue: upstream(ITS-REST): the Simplified Formats define no FLAT or STRUCTURED form for DV_STATE · Issue #3936 · FerroHEALTH/FerroEHR · GitHub

thank you. Now I still have four errors, arguably two types of errors :grimacing:
{“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.

2)below is the picture of the template excerpt for the second error.
“vcf_report/laboratory_test_result:0/sequencing_assay/nucleic_acid|other”: “DNA”,

3 and 4) These seems similar to the first one. All the children are optional but the validator wants three of them having found only two.

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?

Hi @surfer,

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.

Thank you for letting me know!

Hi @surfer,

I have just released: Release 5.5.0 · FerroHEALTH/FerroEHR · GitHub with some big performance improvements and also the issues you have reported.

Many thanks again for testing and letting me know about your findings.

your release fixes the last problem I had with that template. Thank you Ruben !