Open gularj2 opened 1 year ago
Not sure the problem is with the questionnaire. What is the source of the schema that you are using?
The official schema is available here: https://build.fhir.org/questionnaire.schema.json.html
Appreciate the response!
Accidentally left that out of the initial post. I am validating against the full FHIR schema r4 found on this page: https://www.hl7.org/fhir/R4/questionnaire.schema.json.html
Looks like that is the same schema found in your project at src/app/assets/fhir.schema.json;
If I try and validate against the smaller src/app/assets/fhir-questionnaire.schema.json I get a validation error that is at least easier to understand. My exported Questionnaire has the extension[0].valueCoding['code'] as a dictionary where the schema has it defined as string-only
My Form:
Snippet From Schema File:
I don't know if this is helpful information at all but I figured I'd add it
code
and display
should be strings. Is that questionnaire created by this package?
Yes, my understanding is that questionnaire was created and exported using the form builder https://lhcformbuilder.nlm.nih.gov/
The Questionnaire JSON I pasted in the initial issue message imports and exports with code and display as dicts
Although, I manually went the questionnaire and removed all the valueCoding instances that had either code or display as dicts and then the questionnaire passes schema validation and imports into the form builder just fine. I spent time just now recreating the questionnaire from scratch and exported it, there were no instances of code or display as dictionaries, and it also passed schema validation. Somehow the questionnaire I was handed was corrupted with those non-conformant valueCoding attributes. I don't know if this was introduced on my side or yours to be honest. Either way the form builder tool accepted and exported the slightly non-conformant questionnaire. Might be a bug ... might be a feature, for you to decide haha
I THINK this can be closed as resolved; Thanks for your help and pointing me towards that smaller questionnaire-only schema, helped me figure out what the actual invalidation was.
It should probably display some warnings about those errors. I like to keep it open till we address the issue. Thanks for your feed back.
When testing application output using the Form Builder, I was able to create and export a complex Questionnaire that then does not pass FHIR 4.0 schema validation.
The form that is giving errors is included at the end of the post. Code Snippet:
The error is broken into the three parts:
troublesome form:
Is this a bug? Am I just misunderstanding something? Can someone who maybe understands this application and schema better than I do help explain what may be happening?
I am able to successfully validate simple and medium-complexity exports against this schema, running into issues with the complex Questionnaire. Other Python JSON schema validators raise the same issue.
Appreciate any and all help :)