Stream: implementers
Topic: Handling unrecognized Profiles and Extensions
Ken Sinn (Feb 24 2021 at 18:41):
The FHIR documentation is pretty clear on handling unrecognized (non-modifier) extensions https://www.hl7.org/fhir/extensibility.html#Summary2 "When reading elements, read and process the extensions you know and use, and ignore other extensions except for modifier extensions"
Is there any similar guidance on handling unknown/unrecognized Profile URIs?
Based on HL7 FHIR Validator's behaviour, it handles unknown Profile URIs as Warnings, and unknown Extensions are Informational.
Compared with HAPi's implementation that handles unknown Profile URIs as Errors: https://chat.fhir.org/#narrow/stream/179167-hapi/topic/5.2E1.2E0.20FhirInstanceValidator.20not.20allowing.20unknown.20profiles . I'm not sure how HAPI handles unkown Extensions, but I think they may be throwing errors as well.
Grahame Grieve (Feb 24 2021 at 22:04):
since profile references never change the meaning of the content of the resource, you should automatically ignore them when processing the meaning of the resource
Lloyd McKenzie (Feb 25 2021 at 00:11):
You should ignore the ones you recognize when processing meaning too :) (Except insofar as you
a) presume the declaration is correct - while they must be correct for the instance to be valid, "trust but verify" is often the best policy
b) you're just looking at the profile declaration as a short-cut to know what constraints hold for the data and the real meaning is coming from those constraints)
dsh (Apr 15 2021 at 17:30):
@Lloyd McKenzie I am having trouble following those guidance ^ as I just upgraded from 4.1 to 5.3 and I am getting bunch of errors
Error: HTTP 422 : Unknown extension http://hl7.org/fhir/StructureDefinition/us-core-race
obviously in our first implementation using HAPI 4.1 we did not create any profile but had an extension SearchParameter
But my question is How do you get past these errors as I cannot even access any data from 5.3 FHIR server bcoz of these errors. Please see this test/staging fhir server http://52.91.59.1:8080/fhir/Patient?_format=json&_pretty=true
Lloyd McKenzie (Apr 15 2021 at 20:57):
Hmm. When validating within the HL7 space, having an HL7-namespaced extension that's unrecognized is definitely something that should be treated as an error. However, when using the HL7 validator in an independent production space, it should probably just be a warning. @Grahame Grieve, do you agree?
In the meantime, if you ensure your validator has the US Core IG loaded, you shouldn't get the error anymore (and it'll properly validate those extensions as well as any US Core profile declarations).
Grahame Grieve (Apr 15 2021 at 20:59):
this is a question for the @hapi stream; it's entirely about how the validator is configured inside HAPI
Last updated: Apr 12 2022 at 19:14 UTC