hl7-be / vaccination

HL7 Belgium Vaccination (Patient Dossier) Specifications on FHIR - Development repository
Other
1 stars 0 forks source link

immunization example of release candidate has error constraint about rule 4 #163

Closed katrijnbaetens closed 3 months ago

katrijnbaetens commented 3 months ago

I added the json of on of the example "immunization-example-not-given-contraindication" in a validator (I used the jar file of github) and against https://validator.fhir.org/ . In both cases I got an error message: Error Line: 1, Col:2 Constraint failed: be-rule-vaccination-4: 'The encounter should have a location from be-vs-care-location' (defined in https://www.ehealth.fgov.be/standards/fhir/vaccination/StructureDefinition/be-vaccination)

The FHIR version I used: https://build.fhir.org/ig/hl7-be/vaccination/branches/releasecandidate/StructureDefinition-be-vaccination-examples.html

Below the code I plugged in.

{ "resourceType" : "Immunization", "id" : "immunization-example-not-given-contraindication", "meta" : { "profile" : ["https://www.ehealth.fgov.be/standards/fhir/vaccination/StructureDefinition/be-vaccination"] }, "language" : "nl-BE", "text" : { "status" : "generated", "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"nl-BE\" lang=\"nl-BE\"><p class=\"res-header-id\"><b>Generated Narrative: Immunization immunization-example-not-given-contraindication</b></p><a name=\"immunization-example-not-given-contraindication\"> </a><a name=\"hcimmunization-example-not-given-contraindication\"> </a><a name=\"immunization-example-not-given-contraindication-en-US\"> </a><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Language: nl-BE</p><p style=\"margin-bottom: 0px\">Profile: <a href=\"StructureDefinition-be-vaccination.html\">BeVaccination</a></p></div><p><b>identifier</b>: <code>https://www.kindengezin.be/vaccinatie/vaccination-register</code>/6021840732</p><p><b>status</b>: Not Done</p><p><b>statusReason</b>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/v3-ActReason MEDPREC}\">medical precaution</span></p><p><b>vaccineCode</b>: <span title=\"Codes:{http://snomed.info/sct 871822003}\">Hepatitis B virus antigen only vaccine product</span></p><p><b>patient</b>: Identifier: BeSSINNamingSystem/59050937740</p><p><b>encounter</b>: <a href=\"#hcimmunization-example-not-given-contraindication/demo-encounter\">Encounter: status = finished; class = AMB (AMB)</a></p><p><b>occurrence</b>: 2020-03-12</p><p><b>recorded</b>: 2020-05-26</p><h3>Performers</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Actor</b></td></tr><tr><td style=\"display: none\">*</td><td><a href=\"Organization-org-regional-child-care-agency.html\">Organization Regional Child Care Agency</a></td></tr></table><p><b>note</b>: Patiënt heeft nu koorts, aanbevolen 1 ​​week te wachten</p><hr/><blockquote><p class=\"res-header-id\"><b>Generated Narrative: Encounter #demo-encounter</b></p><a name=\"immunization-example-not-given-contraindication/demo-encounter\"> </a><a name=\"hcimmunization-example-not-given-contraindication/demo-encounter\"> </a><a name=\"immunization-example-not-given-contraindication/demo-encounter-en-US\"> </a>Not done yet</blockquote></div>" }, "contained" : [{ "resourceType" : "Encounter", "id" : "demo-encounter", "status" : "finished", "class" : { "code" : "AMB" }, "subject" : { "identifier" : { "system" : "https://www.ehealth.fgov.be/standards/fhir/core/NamingSystem/ssin", "value" : "16032376921" } }, "location" : [{ "location" : { "reference" : "Location/demo-location" } }], "serviceProvider" : { "reference" : "Organization/org-regional-child-care-agency" } }], "extension" : [{ "url" : "https://www.ehealth.fgov.be/standards/fhir/core/StructureDefinition/be-ext-recorder", "valueReference" : { "reference" : "Organization/org-regional-child-care-agency" } }], "identifier" : [{ "system" : "https://www.kindengezin.be/vaccinatie/vaccination-register", "value" : "6021840732" }], "status" : "not-done", "statusReason" : { "coding" : [{ "system" : "http://terminology.hl7.org/CodeSystem/v3-ActReason", "code" : "MEDPREC" }] }, "vaccineCode" : { "coding" : [{ "system" : "http://snomed.info/sct", "version" : "http://snomed.info/sct/11000172109", "code" : "871822003" }] }, "patient" : { "identifier" : { "system" : "https://www.ehealth.fgov.be/standards/fhir/core/NamingSystem/ssin", "value" : "59050937740" } }, "encounter" : { "reference" : "#demo-encounter" }, "occurrenceDateTime" : "2020-03-12", "recorded" : "2020-05-26", "performer" : [{ "actor" : { "reference" : "Organization/org-regional-child-care-agency", "identifier" : { "use" : "official", "system" : "https://www.ehealth.fgov.be/standards/fhir/core/NamingSystem/ssin", "value" : "79121137740" } } }], "note" : [{ "text" : "Patiënt heeft nu koorts, aanbevolen 1 ​​week te wachten" }] }

bdc-ehealth commented 3 months ago

@katrijnbaetens ,

Hello Katrijn, when I take a look at https://build.fhir.org/ig/hl7-be/vaccination/branches/releasecandidate/qa.html , I don't see the problem you signal. Are you sure you used the correct IG to validate against? What were the exact command line options for the validation, or the options you selected on the validator.fhir.org webpage?

katrijnbaetens commented 3 months ago

on my local computer I use: java -jar validator_cli.jar "C:\Users\kaba\Desktop\FHIR\test.json" -version 4.0.1 -ig "C:\Users\kaba\Desktop\FHIR\extensions" -tx n/a The -tx because I got a complaint that the terminology server timed out, the -ig because I got errors that the extentions could not be reached

In the validator I used: image

The output screen of local: image

The output of validator:

image

katrijnbaetens commented 3 months ago

PS: in the print screen of the gui validator I did not press the add button yet, of course I pressed it before executing the validation

bdc-ehealth commented 3 months ago

Ah, ok, that solves the mystery: hl7.fhir.be.vaccination#current is the current "master"-branch, not the "releasecandidate" branch. As for the IG on the commandline, you can put anything there... But I suppose it is the current "master"-branch as well...

-tx n/a is not a good idea, because a terminology server is really necessary for a meaningful validation. However it makes clear one of the largest weaknesses of our FHIR setup, i.e. the dependency on the International HL7 Terminology Server, which has no SLA. We should notify FPS Health (Federal Public Service (FOD)) again and again that we need a solution for this.

bdc-ehealth commented 3 months ago

@katrijnbaetens ,

for your local commandline use this one: -ig https://build.fhir.org/ig/hl7-be/vaccination/branches/releasecandidate

katrijnbaetens commented 3 months ago

I get: Error connecting to build server - running without build (Connect timed out)

katrijnbaetens commented 3 months ago

This command line works, but it is not correct I suppose: java -jar validator_cli.jar "C:\Users\kaba\Desktop\FHIR\test.json" -version 4.0.1 -ig "https://www.ehealth.fgov.be/standards/fhir/vaccination/ImplementationGuide/hl7.fhir.be.vaccination" -tx n/a I get errors back

katrijnbaetens commented 3 months ago

tx werkt ondertussen Wat ook lukt is:

Ik verwijder "meta" : { "profile" : ["https://www.ehealth.fgov.be/standards/fhir/vaccination/StructureDefinition/be-vaccination"] }, uit test.json

java -jar validator_cli.jar "C:\Users\kaba\Desktop\FHIR\test.json" -version 4.0.1 -ig "C:\Users\kaba\Desktop\FHIR\extensions"

bdc-ehealth commented 3 months ago

@katrijnbaetens ,

het is niet de bedoeling dat je "meta" weghaalt, omdat de validator anders niet meer automatisch het correcte profiel kiest. Ik heb ondertussen met @HanneVuegen gesproken, en blijkbaar is het probleem dat je je VPN moet afzetten om te kunnen valideren.

katrijnbaetens commented 3 months ago

De VPN staat af

costateixeira commented 3 months ago

I think there may be a few possible issues with the specification. And the example - it points to a demo-location that is not seen.

I haven't checked further nor i find it easy to debug anyway, but what concerns me is the expression that has severity "error": encounter.empty() or encounter.resolve().location.location.resolve().type.coding.memberOf('https://www.ehealth.fgov.be/standards/fhir/vaccination/ValueSet/be-vs-care-location').anyTrue() , does the anyTrue refer to the several locations? or the several type.coding? Also, the location valueset - is it ok? The core spec binding is extensible. And how would this work with logical references? With this, I am not so sure the constraint should exist or be "error"

bdc-ehealth commented 3 months ago

@costateixeira ,

the problem has been tracked down to a problem with the Smals network infrastructure. I would like to refer to this: https://github.com/hl7-be/vaccination/issues/163#issuecomment-2298143219 . That shows that the qa.html is flawless. I assume I can trust the qa.html.

costateixeira commented 3 months ago

The qa.html doesn't cover all possibilities. Neither the validator.

bdc-ehealth commented 3 months ago

@katrijnbaetens ,

I just kept on trying with the 6.3.20 version of the validator, and it seems that I have found a bug in the validator that is similar to the problem you are having. I will ask for confirmation on the international forum.

bdc-ehealth commented 3 months ago

@katrijnbaetens ,

As all difficult problems, this was a combination of two problems.

1) the validator problem mentioned above: see https://chat.fhir.org/#narrow/stream/291844-FHIR-Validator/topic/validator_cli.20problems.20with.20-ig.20cli.20option.3F

2) a problem in the example, as indicated by @costateixeira above, where the location was not in the contained section.

For the last one, I will modify the example. The profiles/invariants require no change...