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.
Yeah! I am gathering the schema is quite extensive.
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.
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).