Visualizing the FHIR schema

Hey folks,

I’m trying to visualize the FHIR schema on a big poster page so I can try to wrap my head around it.

I’ll tell you what I’ve done so far: I’ve downloaded the FHIR xml schemas (fhir-single.xml, fhir-all-xsd, etc.) and tried to put them through xsdvi, an open source xsd viewer. Unfortunately, that approach crashes due to lack of memory of my computer (16 GB). I’m curious if anybody uses a different XSD viewer and is able to get a nice zoomed-out look at the FHIR resources?

As a related task to illustrate what I’m trying to do: I’ve been able to load in the OMOP CDM spec into a database from some available Postgres SQL schemas and generate a database model diagram to get a sense of those models.

Thanks!

I don’t know of anyone who’s had any luck trying to diagram the schema - it’s a pretty deeply interconnected web.

Yeah! I am gathering the schema is quite extensive. :slight_smile:

Update: I put the process on a machine and gave it 60 GB of memory with the xsdvi approach – no luck, it stabilized at 50 GB memory usage, but ended up crashing at some point in the night after it allocated more. I doubt this approach would have been useful because I’m sure it would be produce a big unusable, unrenderable mess.

Next idea I have is to map out the class relationships from one of the client libraries generated from the schema: C#, python, Java. Those class structures are probably analogous to the schema but less complex.

If you take extensions into account, every resource is allowed to relate to every other resource, so you may want to filter out extensions before attempting a map. You’ll also find that almost everything points to Patient and Practitioner and most things point to RelatedPerson and Encounter. If you remove those as well, the problem will start to be more managable, but it’ll still be a relatively interconnected web.

1 Like

I managed to use IntelliJ Ultimate edition to generate a class diagram of HAPI’s hapi-fhir-structures-dstu3 FHIR Java client library subproject of their FHIR repo. In particular I singled out the classes I presumed were generated by the xsds referenced in the fhir-all.xsd to limit the complexity of the relationships to what I presume is the “meat” of the relationships (not the primitive type definitions of FHIR).

For lack of a better place, I put the file on my new fork of the hapi-fhir repo. I’ve printed it out on a 36" x 95" roll of paper, see here:

I think this is a good approximation of the FHIR schema for evaluation purposes, please let me know if you think I’m missing anything.

2 Likes

Cool, so this has been pretty useful to help me understand FHIR a bit better, so far.

Quick question, we have a data model for clinical doctor’s note already in the hospital. If I wanted to map that into FHIR, which model should I look at?

That’s an open discussion on the HL7 patient care email list. I don’t know what the answer is. “Clinical Note” means a variety of things.

In my case, I think Composition is the right answer. I basically have a set of text-based clinical narratives that I’d like to represent.

They are plaintext, however, so I’ll have to add some basic XHTML markup I guess. :wink:

maybe the schema is a bit over complex ? 16GB is quite a lot of memory
whatever, when you have managed to visualize it, it’d be awesome if you would share it :smiley:

Hey clive, you can see the visualization I made on the March 23rd post of this thread.

May I ask where you downloaded it? Does it exist in smaller chunks? Thanks!

check out fhirview.com, it provides a visualization.

Hi

I am wondering whether anyone has knowledge of the differences between OHDSI’s OMOP Common Data Model and HL& FHIR, particularly in when you would use which one. I added it to this thread since mcintyrsmsk mentioned it. (FYI only, a link to information on OMOP CDMis https://www.ohdsi.org/data-standardization/the-common-data-model/ )

Thanks . . .

Phil Troy

I personally haven’t done a detailed analysis of those differences, but I know that there is an HL7 project currently looking at that:
https://www.hl7.org/special/Committees/projman/searchableProjectIndex.cfm?action=edit&ProjectNumber=1424
The draft build of the associated implementation guide is here:
https://build.fhir.org/ig/HL7/cdmh/
I’m not sure what the current status of that project is, but you could reach out to the managing work group (Biomedical Research & Regulation) https://confluence.hl7.org/display/BRR/Biomedical+Research+and+Regulation to find out.