Stream: implementers
Topic: Vonk - validate profiles that reference extensions
Natasha Singh (Jul 18 2019 at 14:16):
I am wondering if Vonk is able to validate referenced extensions in StructureDefinitions. For example, I created a profile on Patient by creating a StructureDefinition called Participant. Inside this profile, I reference an extension I created but had not yet POSTed to Vonk. When I POST my Participant profile to Vonk I get no errors/warnings in the response. I was expecting a warning/error about not being able to resolve the referenced extension's canonical URL.
The reason I was expecting this is because when I POST my Participant profile to my simplifier project, I see an alert that says:
Screen-Shot-2019-07-18-at-10.14.35-AM.png
What is the best way to validate profiles that include extensions?
Not sure if @Martijn Harthoorn is the right person to ask for Vonk related questions or someone else. Please advise. Thank you!
Michel Rutten (Jul 18 2019 at 14:23):
Hi @Natasha Singh, indeed, this should return a warning to inform the user that validation results are incomplete and cannot be (fully) trusted, because not all dependencies could be resolved. The instance might be valid, but the server cannot guarantee this.
Natasha Singh (Jul 18 2019 at 14:26):
Hey @Michel Rutten, thanks for the quick response! Not sure I understand. Will Vonk always respond with a warning when it cannot resolve the dependency? Or are you saying that its up to the validation logic/application outside the server to check for this?
Michel Rutten (Jul 18 2019 at 14:29):
The underlying validation service (part of our FHIR .NET API library) definitely reports missing dependencies. Apparently Vonk does not return this information to the client, not sure why. I'll inform our Vonk team to look into this. @Marco Visser @Christiaan Knaap?
Natasha Singh (Jul 18 2019 at 14:30):
Ok thank you!
Martijn Harthoorn (Jul 19 2019 at 08:16):
@Alexander Zautke can answer your question.
Alexander Zautke (Jul 23 2019 at 07:41):
Hey @Natasha Singh! You are right by expecting Vonk to check referenced extensions for validation. Currently, it's implemented in such a way that you'll only get validation errors when POSTing an instance conforming to your 'Participant' profile. If Vonk then can't resolve the extension, it will return an OperationOutcome accordingly. Please note that this also depends on your chosen validation setting. You need to specify Validation.Level = Full in your appsettings. By default unknown extensions are accepted.
Natasha Singh (Jul 23 2019 at 13:57):
Hey @Alexander Zautke thanks for that info! I have been running with Validation.Level = Full so I'm good there. I'm curious, how does simplifier give the warning that some canonical URLs could not be resolved? The only thing I have up on my project is a single profile on Patient. I haven't uploaded Patient instances yet. Does the simplifier project FHIR server do some additional processing on POSTing a profile? Also, is the simplifier project FHIR server a Vonk server?
Alexander Zautke (Jul 23 2019 at 14:07):
Yes, Simplifier is powered by Vonk in the background for some operations, but not all. Simplifier will give a warning as it might be the case that the unresolved canonical might lead to a different rendering of the profile. For Vonk this is not the case, as you only need to make sure that the profile exists in the database when validating an instance, everything else (i.e. just a referenced extension in profile) does not influence the validation result.
Alexander Zautke (Jul 23 2019 at 14:08):
As for the FHIR Server that you can download from your Simplifier project: that's a plain Vonk server which is just preconfigured to load your profiles from Simplifier.
Alexander Zautke (Jul 23 2019 at 14:09):
What would be your use case for wanting to validate that each extension exist when posting a profile?
Natasha Singh (Jul 23 2019 at 14:53):
Ok I see, thank you! Well, I have a git repo setup for my FHIR model development. I run validation on every pushed commit, and require that validation passes in order for merge eligibility into the master branch.
So my thought with validating referenced extensions is that, if you don't validate referenced extensions in a profile, then you may never find out that a profile references a non-existent extension until you later try to POST a resource instance that conforms to that profile.
While developing + testing your resource instances against the profiles, you may not remember to include an instance of that referenced extension, all validation will pass, and an invalid profile will make it into the master branch. Later on, we will deploy a server with the model files on the master branch. Now our deployed server has the invalid profile and we'll never really find out its invalid until someone tries to POST a resource instance with an instance of the non-existent extension.
Alexander Zautke (Jul 23 2019 at 17:50):
That's sounds like a cool use case :) Nice setup! If you like, you could have a look into developing a custom plugin for Vonk. You can configure a plugin to just act on a POST of a StructureDefinition and check if all extensions are present in the administration database. We would be more than happy to assist you with that!
Last updated: Apr 12 2022 at 19:14 UTC