Stream: implementers
Topic: HAPI Command line validator and validation against profiles
Katie Wheatley (Aug 09 2018 at 15:46):
Is it possible to validate one xml example against a profile using the HAPI FHIR Command line tool? I have been able to validate one example and then one profile using the validate command
e.g. for validation of an example I used the following command
./hapi-fhir-cli validate --fhir-version dstu3 --file C:\Test\examples\Test-Example-1.xml
and this worked, but what command would I use to validate this xml example against the profile that it references in its <meta> tag using this command line tool?
I have posted this question at https://groups.google.com/forum/#!topic/hapi-fhir/sRm7CDXOfwM but no answer has been received yet, so I thought this would be another forum where expertise might exist on this subject. Test-Example-1.xml
Lloyd McKenzie (Aug 09 2018 at 16:18):
@James Agnew ?
James Agnew (Aug 09 2018 at 16:48):
This is not currently possible with the CLI tool.
If anyone would like to help out with implementing it we would welcome patches and I'm happy to discuss approaches to make that happen.
Michel Rutten (Aug 13 2018 at 10:01):
Hi @Katie Wheatley, alternatively, you upload your profile and example resource to https://simplifier.net and validate from there. Simplifier will verify all profile claims in the meta tag.
Katie Wheatley (Aug 13 2018 at 10:22):
@Michel Rutten thanks for your response - much appreciated. Can I confirm that simplifier uses the HAPI validator?
Michel Rutten (Aug 13 2018 at 11:06):
No, Simplifier is based on the .NET FHIR API. Behavior should be similar though, as validation rules are strictly defined by the FHIR standard.
Kevin Mayfield (Aug 13 2018 at 11:21):
@James Agnew do you mean a more generic tool? Classes to add in profile support for the example can be found here, (these aren't the official versions - I'm chasing access to that repo) https://github.com/nhsconnect/careconnect-reference-implementation/tree/master/cc-cli/src/main/java/uk/nhs/careconnect/cli https://github.com/nhsconnect/careconnect-reference-implementation/tree/master/cc-cli/src/main/java/uk/nhs/careconnect/cli
Kevin Mayfield (Aug 13 2018 at 11:22):
p.s. this is a branch of hapi cli
Kevin Mayfield (Aug 13 2018 at 11:24):
Sorry wrong link, these are the valiation support classes https://github.com/nhsconnect/careconnect-reference-implementation/tree/master/cc-core/src/main/java/uk/org/hl7/fhir/validation/stu3
James Agnew (Aug 13 2018 at 12:55):
@Kevin Mayfield Neat! Would you be willing to contribute these additions back to the base CLI tool? That sounds like it would be useful..
Kevin Mayfield (Aug 13 2018 at 13:04):
I'll check but don't see any reason why not.
Last updated: Apr 12 2022 at 19:14 UTC