Full Patient Data Model - to JSON skeleton

351 views
Skip to first unread message

David Froelich

unread,
May 9, 2019, 7:31:31 PM5/9/19
to HAPI FHIR
Hello Group.

I'm terribly new to everything here with Hapi, but overly impressed to see such a lot of great work being done.  For a NooB like me, even more so with Java, I had a question that I was wondering if anyone had a potential answer or guide on.

So, let's say I need to create a Patient Model FHIR resource.  I do understand there are plenty of "get/set/add" methods for the various (what I guess I will call them) 'datatypes' which *could* be populated.  For some of these, it seems like if you issue an add/set but actually have NO data to add in, it accepts it, v.s. others that do not.  What I'm really hoping for input on was if there is, and what would be the best way, to be able to use the libraries and create a fully backed out JSON representation of a particular class, without having to painfully go through and create something generic that would populate everything before encoding it.

Basically, I am looking for a quick way/hack to provide the full JSON structure of say a Patient Model  with everything being completely empty.

i.e. I know Patient contains identifier, which could contain use/type/system/value/period/assigner.

And type could contain coding which could contain additional types.  Without physically adding these to a Patient Model using the FHIR adds/set - is there a way to print out this fully baked JSON assuming everything was populated?

Hope this makes sense, and thanks for the reading!

Keith Boone

unread,
May 9, 2019, 10:30:39 PM5/9/19
to David Froelich, HAPI FHIR
This is close to what I’m hearing you want: http://hl7.org/fhir/patient.html (click on the JSON tab), and from there you can click on other links to get substructure.

All the data used to create that page comes from data in structure deinition resources you can download from the FHIR definitions section of this page: http://hl7.org/fhir/downloads.html

Keith Boone, Enterprise Architect
kbo...@ainq.com | (617) 640-7007
 
AUDACIOUS INQUIRY
Bold Solutions for Connected Healthcare®
ainq.com | Twitter |  YouTube | Facebook | LinkedIn

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/6225efbf-239e-4390-bcf1-b820bcd7c177%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Froelich

unread,
May 10, 2019, 11:05:31 AM5/10/19
to HAPI FHIR
Thanks for pointing this out, Keith.  I did find these earlier, but wasn't clear how all the files were hooked together.  I'm going through the fhir schema json file, and it seems like this is a "self contained" file with references to other nodes inside of it for the structure.  So I guess one would have to parse this and recursively look up the other keys to form the potential structures, starting from the parent resource.  The file seems somewhat useful for my purposes. 

BTW -on a side comment, this JSON seems to be incomplete for ACCOUNT, as it contains status, type, name, subject, servicePeriod, coverage, owner, description, gaurantor, partOf.  However, I do not see "priority".  
I might assume the download files are from some earlier versions, perhaps?  

This is sort of why I was looking for a way, problematically, to physically use the .java classes from the application structure.  But, based on my experience with Java and these serializers/deserializers and use/implementation of these classes, you really can't "output" a structure unless it is populated.  

But alas - going back to my comment on the fact it "appears" the json schema file is self contained, is that a correct assumption? Should there be any need to consider going through the dataelements.json?
Reply all
Reply to author
Forward
0 new messages