FHIR Chat · validation quirks · implementers

Stream: implementers

Topic: validation quirks


view this post on Zulip Jens Villadsen (Jan 13 2021 at 13:30):

I'm seeing conflicting behavour in the validity of the example resources in my IG. As part of my IG, I have the example of a resource here: https://build.fhir.org/ig/hl7dk/dk-medcom/StructureDefinition-medcom-careCommunication-message-examples.html - the QA site of the IG is listed here: https://build.fhir.org/ig/hl7dk/dk-medcom/qa.html#_scratch_ig-build-temp-CMJHI5_repo_fsh-generated_resources_Bundle-CareCommunicationMessageExample and it reports no errors. Now, If I try manually to validate the example resource as listed on https://build.fhir.org/ig/hl7dk/dk-medcom/StructureDefinition-medcom-careCommunication-message-examples.html using the validator, the example bundle full of errors:

 ava -jar validator_cli.jar communication.json -version 4.0 -ig http://build.fhir.org/ig/hl7dk/dk-medcom -profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
FHIR Validation tool Version 5.2.13 (Git# 5f67b5bad03d). Built 2020-12-24T05:16:59.673Z (20 days old)
  Java:   15 from /Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home on x86_64 (64bit). 4096MB available
  Paths:  Current = /Users/jvi/dk-medcom, Package Cache = /Users/jvi/.fhir/packages
  Params: communication.json -version 4.0 -ig http://build.fhir.org/ig/hl7dk/dk-medcom -profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
Loading
  Load FHIR v4.0 from hl7.fhir.r4.core#4.0.1 - 4575 resources (00:04.0158)
  Load hl7.terminology#2.0.0 - 3749 resources (00:00.0930)
  Terminology server http://tx.fhir.org - Version 1.9.369 (00:01.0920)
  Load http://build.fhir.org/ig/hl7dk/dk-medcom+  .. load IG from dk.fhir.ig.dk-core#current
 - 52 resources (01:19.0521)
  Get set...  go (00:00.0032)
Validating
  Profiles: [http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message]
  Validate communication.json 00:00.0717
Done. Times: Loading: 01:26.0787, validation: 00:00.0717

*FAILURE*: 10 errors, 2 warnings, 15 notes
  Error @ resource.focus[0] : Bundled or contained reference not found within the bundle/resource Communication/CareCommunicationContent
  Error @ resource.target[0] : Bundled or contained reference not found within the bundle/resource MessageHeader/CareCommunicationMessageHeader
  Error @ resource.managingOrganization : Bundled or contained reference not found within the bundle/resource Organization/BurnCenter
  Error @ resource.destination[0].receiver : Bundled or contained reference not found within the bundle/resource Organization/MessageReceiver
  Error @ resource.agent[0].who : Bundled or contained reference not found within the bundle/resource Organization/MessageSender
  Error @ Bundle (line 2, col2) : Bundle.entry:citizen: minimum required = 1, but only found 0 (from http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message)
  Error @ Bundle (line 2, col2) : Bundle.entry:messageHeader: minimum required = 1, but only found 0 (from http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message)
  Error @ Bundle.entry[3].resource.ofType(Communication).subject (line 161, col6) : Unable to find matching profile for Patient/EricFlame among choices: http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-core-patient
  Error @ Bundle.entry[3].resource.ofType(Communication).encounter (line 164, col6) : Unable to find matching profile for Encounter/EncounterWithLPR3Identifier among choices: http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-core-lpr3Encounter
  Error @ Bundle.entry[4].resource.ofType(Encounter).subject (line 206, col6) : Unable to find matching profile for Patient/EricFlame among choices: http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-core-patient
  Information @ Bundle.entry[0] (line 13, col5) : This element does not match any known slice defined in the profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
  Information @ Bundle.entry[1] (line 61, col5) : This element does not match any known slice defined in the profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
  Information @ Bundle.entry[2] (line 110, col5) : This element does not match any known slice defined in the profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
  Information @ Bundle.entry[3] (line 134, col5) : This element does not match any known slice defined in the profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
  Information @ Bundle.entry[4] (line 185, col5) : This element does not match any known slice defined in the profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
  Information @ Bundle.entry[5] (line 217, col5) : This element does not match any known slice defined in the profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
  Information @ Bundle.entry[6] (line 236, col5) : This element does not match any known slice defined in the profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
  Information @ Bundle.entry[7] (line 263, col5) : This element does not match any known slice defined in the profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
  Information @ Bundle.entry[8] (line 290, col5) : This element does not match any known slice defined in the profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message
  Information @ Bundle.entry[3].resource.ofType(Communication).subject (line 161, col6) : Details for Patient/EricFlame matching against Profilehttp://hl7.org/fhir/StructureDefinition/Patient
  Information @ Bundle.entry[3].resource.ofType(Communication).subject (line 161, col6) : Details for Patient/EricFlame matching against Profilehttp://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-core-patient
  Information @ Bundle.entry[3].resource.ofType(Communication).encounter (line 164, col6) : Details for Encounter/EncounterWithLPR3Identifier matching against Profilehttp://hl7.org/fhir/StructureDefinition/Encounter
  Information @ Bundle.entry[3].resource.ofType(Communication).encounter (line 164, col6) : Details for Encounter/EncounterWithLPR3Identifier matching against Profilehttp://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-core-lpr3Encounter
  Information @ Bundle.entry[4].resource.ofType(Encounter).subject (line 206, col6) : Details for Patient/EricFlame matching against Profilehttp://hl7.org/fhir/StructureDefinition/Patient
  Information @ Bundle.entry[4].resource.ofType(Encounter).subject (line 206, col6) : Details for Patient/EricFlame matching against Profilehttp://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-core-patient
  Warning @ Bundle.entry[8].resource.ofType(Provenance).activity (line 312, col16) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/provenance-activity-type (http://hl7.org/fhir/ValueSet/provenance-activity-type), and a code should come from this value set unless it has no suitable code and the validator cannot judge what is suitable) (codes = http://medcom.dk/fhir/medcom-core/CodeSystem/medcom-messaging-activityCodes#new-message)
  Warning @ resource.activity (line 312, col16) : None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/provenance-activity-type (http://hl7.org/fhir/ValueSet/provenance-activity-type), and a code should come from this value set unless it has no suitable code and the validator cannot judge what is suitable) (codes = http://medcom.dk/fhir/medcom-core/CodeSystem/medcom-messaging-activityCodes#new-message)

@Grahame Grieve do you have any idea why the validator when executed during the IGpublisher phase does not find the errors that the validator does afterwards.

view this post on Zulip Lloyd McKenzie (Jan 14 2021 at 05:07):

Your fullUrls aren't. I don't know why the IGPublisher isn't rejecting them (@Grahame Grieve ?), but the validator is right to yell. FullURLs must be full uris - either urn:uuid:someguid or http://something/ResourceType/id (maybe plus _history/version). You can't specify a relative reference as a fullUrl.

view this post on Zulip Jean Duteau (Jan 14 2021 at 06:42):

the IGPublisher hasn't rejected relative URLs ever. I have some old guides that used relative URLs in my examples and they worked. it is only recently that I realized that relative URLs aren't valid there (which should have been obvious from the name of the attribute if not from reading the the definition/comments).

view this post on Zulip Grahame Grieve (Jan 14 2021 at 07:06):

I don't get those errors. what exact file are you validating?

view this post on Zulip Jens Villadsen (Jan 14 2021 at 07:44):

The content of https://build.fhir.org/ig/hl7dk/dk-medcom/Bundle-CareCommunicationMessageExample.json.html

view this post on Zulip Jens Villadsen (Jan 14 2021 at 10:13):

@Lloyd McKenzie right ... I've prefixed all the fullUrls with 'http://example.org/fhir' ... that removed 4 errors ... that leaves 6 errors left, which
really puzzles me.

  Error @ resource.focus[0] : Bundled or contained reference not found within the bundle/resource Communication/CareCommunicationContent
  Error @ resource.target[0] : Bundled or contained reference not found within the bundle/resource MessageHeader/CareCommunicationMessageHeader
  Error @ resource.destination[0].receiver : Bundled or contained reference not found within the bundle/resource Organization/MessageReceiver
  Error @ resource.agent[0].who : Bundled or contained reference not found within the bundle/resource Organization/MessageSender
  Error @ Bundle (line 1, col2) : Bundle.entry:messageHeader: minimum required = 1, but only found 0 (from http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message)
  Error @ Bundle (line 1, col2) : Bundle.entry:messageHeader: minimum required = 1, but only found 0 (from http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-messaging-message)

view this post on Zulip Jens Villadsen (Jan 14 2021 at 10:34):

nop ... my mistake ... I validated against the wrong profile. I still have 10 errors

view this post on Zulip Oliver Egger (Jan 14 2021 at 11:42):

can you push the file to github in a branch?

view this post on Zulip Jens Villadsen (Jan 14 2021 at 12:02):

@Oliver Egger 2 sec

view this post on Zulip Jens Villadsen (Jan 14 2021 at 12:04):

https://gist.github.com/jvitrifork/adef9fb0b5079fb1ed7fb421ec4221a5

view this post on Zulip Jens Villadsen (Jan 14 2021 at 12:12):

And interestingly enough @Lloyd McKenzie , if I run the validation without the profile - there are no errors or warrnings. Shouldn't that mean that the stated internal references are valid?

view this post on Zulip Jens Villadsen (Jan 14 2021 at 12:22):

@Oliver Egger let me know if you find something

view this post on Zulip Oliver Egger (Jan 14 2021 at 13:12):

if I remove all profile references from the bundle i'm down to two errors validating against your bundle profile which are not related to the 'Bundle or container reference message':

java -jar validator_cli.jar "/Users/oliveregger/Desktop/dk/bundle.json" -version 4.0.1 -ig dk.fhir.ig.medcom-core#current -profile http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message

*FAILURE*: 2 errors, 1 warnings, 9 notes
  Error @ Bundle (line 1, col2) : Bundle.entry:citizen: minimum required = 1, but only found 0 (from http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message)
  Error @ Bundle (line 1, col2) : Bundle.entry:messageHeader: minimum required = 1, but only found 0 (from http://medcom.dk/fhir/medcom-core/StructureDefinition/medcom-careCommunication-message)

So it looks for me, that either one of the profile definitions is wrong in the bundle and provokes the error or the profile definitions within the bundle triggers another validation where it stumbles over the bundle.entry or hopefully if above two errors are solved all are gone away :-)

view this post on Zulip Jens Villadsen (Jan 14 2021 at 15:28):

@Oliver Egger I just tried to validate the patient example by itself ... that seems to conform to the patient profile

view this post on Zulip Jens Villadsen (Jan 14 2021 at 15:29):

so the first error is really funky

view this post on Zulip Jens Villadsen (Jan 14 2021 at 19:19):

Grahame Grieve said:

I don't get those errors. what exact file are you validating?

https://gist.github.com/jvitrifork/adef9fb0b5079fb1ed7fb421ec4221a5

view this post on Zulip Jens Villadsen (Jan 17 2021 at 08:32):

Hmmm ... I think I'm on to something ... the last two errors that you see @Oliver Egger looks like they related to the fact that the reference aggregation mode is profiled. Currently it is narrowed down to only allow bundled for the cases managingOrganization for Patient - the same goes for the references on MessageHeader. If I let the aggregation mode instead be referenced, there are no errors. However, the references are in fact part of the bundle and should be part of the bundle. Why this does not pop up as of the IG building process @Grahame Grieve puzzles me.

view this post on Zulip Jens Villadsen (Jan 17 2021 at 20:08):

It's also present on other IG's - like Davinci (where the error is not present in the QA report):

curl http://build.fhir.org/ig/HL7/davinci-alerts/Bundle-admit-notification-message-bundle-01.json -o davinci.json && java -jar validator_cli.jar davinci.json -version 4.0 -ig http://build.fhir.org/ig/HL7/davinci-alerts -profile http://hl7.org/fhir/us/davinci-alerts/StructureDefinition/notifications-bundle -tx n/a
gives the following errors:

 Error @ resource.participant[0].individual : Bundled or contained reference not found within the bundle/resource urn:uuid:0000016f-57cb-cdac-0000-00000000014a
  Error @ resource.subject : Bundled or contained reference not found within the bundle/resource urn:uuid:06e1f0dd-5fbe-4480-9bb4-6b54ec02d31b
  Error @ resource.location[0].location : Bundled or contained reference not found within the bundle/resource urn:uuid:09188b81-0d1d-453c-b0fa-203ef88c794c
  Error @ Bundle.entry[0].resource.ofType(MessageHeader) (line 57, col25) : MessageHeader.focus:admit-notification: minimum required = 1, but only found 0 (from http://hl7.org/fhir/us/davinci-alerts/StructureDefinition/admit-notification-messageheader)
  Error @ Bundle.entry[6].resource.ofType(Condition).encounter (line 553, col10) : Unable to find matching profile for urn:uuid:5fe62cd5-bfcf-4d3b-a1e9-80d6f75d6f82 among choices: http://hl7.org/fhir/us/davinci-alerts/StructureDefinition/adt-notification-encounter

view this post on Zulip Jens Villadsen (Jan 17 2021 at 20:10):

@Lloyd McKenzie I can see you are one of the contributers to the IG. Maybe you can shed some light on these errors?

view this post on Zulip Jens Villadsen (Jan 18 2021 at 18:30):

The davinci errors that is

view this post on Zulip Lloyd McKenzie (Jan 18 2021 at 22:59):

I was a contributor, but wasn't involved in the technical work of IG creation. If the validator is complaining (incorrectly) about issues that aren't showing up in publisher QA, that suggests a bug in the validator. @Grahame Grieve ?

view this post on Zulip Grahame Grieve (Jan 19 2021 at 01:02):

this is on my todo list, but realistically, not until the first week of Feb

view this post on Zulip Jens Villadsen (Feb 17 2021 at 19:46):

@Grahame Grieve has it become the first week of feb yet down under? I'm sort of confused that the IG does't report the example as an error during the build proces but afterwards if I take the example and parse it to the validator_cli and points it to the freshly generated package then I see a lot of errors.

view this post on Zulip Grahame Grieve (Feb 24 2021 at 03:35):

still on my todo list

view this post on Zulip Jens Villadsen (Feb 24 2021 at 14:02):

I'm starting to suspect that you live in a currently undocumented timezone where it's almost always late january ;)

view this post on Zulip Grahame Grieve (Feb 24 2021 at 22:07):

I really liked late January, since I had a holiday for a week. I'm trying to work only 50-60 hours a week since i'm back, and everyone is noticing

view this post on Zulip Gino Canessa (Feb 24 2021 at 22:12):

I'm still trying to figure out how March is next week, considering it was just March.

view this post on Zulip Chris Moesel (Feb 24 2021 at 22:15):

So we still haven't figured out how to clone @Grahame Grieve yet? Darn.

view this post on Zulip Paul Church (Feb 24 2021 at 22:15):

yeah, it's so strange that it's March 2022 already

view this post on Zulip Paul Church (Feb 24 2021 at 22:15):

seems like only yesterday it was March 2020


Last updated: Apr 12 2022 at 19:14 UTC