FHIR Chat · Validating a FHIR profile using JSON schema · implementers

Stream: implementers

Topic: Validating a FHIR profile using JSON schema


view this post on Zulip Pranitha Sruthi (Jun 27 2017 at 04:18):

Hi all, I tried to validate a FHIR profile using JSON schema.json-validation.PNG
I had downloaded JSON schema and pasted in the schema block and also pasted the json data of the profile in the data block. Please correct me if I made any mistake. Also, which is the most reliable method to validate a FHIR profile? Thank you

view this post on Zulip Igor Sirkovich (Jun 28 2017 at 20:32):

@Pranitha Sruthi , have a look at http://hl7.org/fhir/validation.html

view this post on Zulip Pranitha Sruthi (Jun 29 2017 at 04:28):

@Igor Sirkovich Is it the right way to validate a profile using JSON schema? I had already gone through the content in the link http://hl7.org/fhir/validation.html.

view this post on Zulip Igor Sirkovich (Jun 29 2017 at 19:58):

Do you use "https://json-schema-validator.herokuapp.com"? This looks fine to me and it works for the schema & examples downloaded from hl7.org.

view this post on Zulip Pranitha Sruthi (Jun 30 2017 at 05:10):

@Igor Sirkovich I have used the same to validate and got an exception. Please check the screenshots below.json-validation.PNG . Please suggest me a solution. Thank you

view this post on Zulip Igor Sirkovich (Jun 30 2017 at 15:22):

Hi Pranitha, I would suggest to try this on a different browser and/or different machine.

view this post on Zulip Pranitha Sruthi (Jul 03 2017 at 06:32):

Hi @Igor Sirkovich , I will try on another browser. Thank you

view this post on Zulip Pranitha Sruthi (Aug 28 2017 at 10:41):

Hi, I tried to validate a profile using json schemajsonschema-validation.PNG Is it a valid profile? Thank you

view this post on Zulip Haseeb (Aug 28 2017 at 10:57):

Hi @Pranitha Sruthi , I have recently gone through learning Profile Validation. What Profile are you using to post the json to?

view this post on Zulip Haseeb (Aug 28 2017 at 11:02):

@Pranitha Sruthi I have used the java validator, it works for me. Once you unzip the validator folder go to the directory validator directory using command prompt and run >java -jar org.hl7.fhir.validator.jar <XML FILE>
Where <XML FILE> is the location of the structuredefinition of your profile

view this post on Zulip Pranitha Sruthi (Aug 28 2017 at 12:49):

Hi @Haseeb Thank you so much. I shall work on it.

view this post on Zulip Pranitha Sruthi (Aug 28 2017 at 12:59):

commandprompt.PNG I got an exception. Can you help me fix it?

view this post on Zulip Haseeb (Aug 28 2017 at 13:07):

Hi @Pranitha its an IO exception and the validator is not able to locate the file. Can you double check the path of the file.

view this post on Zulip Pranitha Sruthi (Aug 28 2017 at 13:10):

@Haseeb Yes but it is of no use

view this post on Zulip Mounika (Aug 30 2017 at 06:57):

Hi all, when I am validating a profile using the FHIR Validator. I got an Exception as shown in the below screenshot. Can anyone Please fix it.

view this post on Zulip Mounika (Aug 30 2017 at 07:02):

1.png

view this post on Zulip Lloyd McKenzie (Aug 30 2017 at 18:41):

It looks like the validator jar isn't in the folder you're invoking Java from

view this post on Zulip Mounika (Aug 31 2017 at 04:56):

Thank you @Lloyd McKenzie

view this post on Zulip Mounika (Aug 31 2017 at 09:37):

I got exeption in commandprompt
Capture1.PNG

view this post on Zulip Lloyd McKenzie (Aug 31 2017 at 14:12):

@Grahame Grieve ?

view this post on Zulip Grahame Grieve (Aug 31 2017 at 21:46):

just checked in a fix for this

view this post on Zulip Tian Lai (Sep 21 2017 at 18:27):

Hi, I'm using both the hapi parser and the validator here http://hl7.org/fhir/validator.zip on page https://www.hl7.org/fhir/validation.html#jar, when validating JSON file of a patient resource that has only one element in the identifier, I guess I ran into a discrepancy. Should this be valid if I put "identifier": {"value": "XXX"} instead of "identifier": ["value": "XXX"]. one element VS. a list with one element.

view this post on Zulip Tian Lai (Sep 21 2017 at 18:28):

sorry, "identifier":[{"value": "XXX"}]

view this post on Zulip Tian Lai (Sep 21 2017 at 18:31):

HAPI raise a flag when using "identifier": {"value": "XXX"}, but the official jar passes

view this post on Zulip Lloyd McKenzie (Sep 21 2017 at 22:01):

Both should raise an issue if both are validating against the same version of the spec and that version says that identifier can repeat.

view this post on Zulip Tian Lai (Sep 21 2017 at 22:53):

@Lloyd McKenzie According to my understanding of the STU3 spec and the template the official page provided, only "identifier":[{"value": "XXX"}] is correct

view this post on Zulip Lloyd McKenzie (Sep 21 2017 at 23:09):

What resource?

view this post on Zulip Tian Lai (Sep 21 2017 at 23:17):

@Lloyd McKenzie identifer is the element that could be in Patient, Practitioner, Location, Organization etc. doesn't really matter which resource it is

view this post on Zulip Tian Lai (Sep 21 2017 at 23:17):

so, it seems a historical issue

view this post on Zulip Tian Lai (Sep 21 2017 at 23:17):

https://tapadoo.com/2011/regular-problem-with-xml-to-json-converters/

view this post on Zulip Lloyd McKenzie (Sep 21 2017 at 23:51):

Oh, you definitely can't use off-the-shelf XML<->JSON converters with FHIR. You'll need to use the reference implementations or write your own.

view this post on Zulip Lloyd McKenzie (Sep 21 2017 at 23:52):

The cardinality for identifier can be different for different resources. Often it's an array, but not always

view this post on Zulip Tian Lai (Sep 22 2017 at 00:03):

@Lloyd McKenzie thanks. to be clear, I didn't to any conversion of xml -> json. for the where the cardinality specifies array, I will propose use "identifier":[{"value": "XXX"}] to my team, cuz it seems to match better with spec


Last updated: Apr 12 2022 at 19:14 UTC