Stream: implementers
Topic: Where does FHIR define JSON Schema for elements?
Erik Greif (Feb 28 2020 at 22:07):
I'm putting together a system to generate models in various languages based on FHIR's JSON Schema definitions such as https://www.hl7.org/fhir/medicationrequest.schema.json.html
In these definitions there are refs like "Element.schema.json#/definitions/Element" which are to be resolved by the system parsing the JSON Schema. Unfortunately, I can't resolve "Element.schema.json" or any other similar refs on these pages. Is anyone familiar with where they live?
I would download the bulk JSON schema that has everything, but my organization requires the files be broken up by resource so that custom definitions we already have can be defined in a similar manner, and ones we haven't defined can be omitted. This is also important for the code review and team ownership systems associated with our source control (Git), where these will live.
If anyone knows where I can find these files, or better ways to do what I'm doing, I'd love to know both answers.
Lloyd McKenzie (Feb 28 2020 at 22:15):
@Grahame Grieve
Michele Mottini (Feb 28 2020 at 22:40):
Don't use the JSON schema, use the FHIR structure definitions - they are the actual 'source of truth'
Gino Canessa (Feb 28 2020 at 22:46):
@Erik Greif the structure definitions also live on the server, with a similar pattern: http://hl7.org/fhir/medicationrequest.profile.canonical.json yields the canonical structure definition for MedicationRequest, for example.
I'll also note, I have a primitive tool that does some of this on GitHub. I am also working on a much more powerful version, but that is still going through the internal review process to be published OSS.
Erik Greif (Feb 28 2020 at 23:32):
Michele Mottini said:
Don't use the JSON schema, use the FHIR structure definitions - they are the actual 'source of truth'
I agree I should do that, but I have been unsuccessful in convincing my organization. We want one format for all of our FHIR and non-FHIR model definitions.
Grahame Grieve (Feb 29 2020 at 10:57):
good luck with JSON schema then. I gave up on a modular JSON schema after giving up trying to get multiple tools working - and when OpanAPI simply redefined the schema links to be literal not logical. I only publish a single schema now
René Spronk (Feb 29 2020 at 14:09):
Given that Erik has a need for JSON Schema, we should encourage him to take the lead on a project to generate those schema. I'm fairly sure there are others who would like to use them.
Grahame Grieve (Feb 29 2020 at 20:20):
we do already generate schema...
Erik Greif (Mar 02 2020 at 18:31):
Thanks for all of the input everyone. I agree with the conclusions most of you are drawing about JSON Schema and I appreciate the warnings.
But to loop back to the original question, given my current constraint to use JSON Schema, does anyone know where the rest of the schema are stored? I simply want to resolve the references.
Grahame Grieve (Mar 02 2020 at 19:17):
we just have the one full json schema now. you'll have to break it up yourself if you want
Erik Greif (Mar 02 2020 at 21:52):
Grahame Grieve said:
we just have the one full json schema now. you'll have to break it up yourself if you want
Oh I see, thank you!
Last updated: Apr 12 2022 at 19:14 UTC