Question

I am exploring the Java FHIR reference implementation, and I'm looking to represent my data model as FHIR objects. From what I understand, FHIR seems to be HTTP REST based, or at least built with that in mind. Suppose I simply want in-memory FHIR objects that represent my data -- I don't yet have the need to expose them as a REST service, I am just looking for a common representation of the data. Specifically, I'm looking at this:

org.hl7.fhir.instance.model.ResourceReference

So, what is best-practice for creating references between in-memory objects? How do a build a ResourceReference for this type of relationship?

Was it helpful?

Solution

At present, I use Map where the key is a uri which is the content of the resource reference value. Exposing the data across a RESTful interface, or acquiring the data from one, will impose limitations on the URI, but not change the basic model

OTHER TIPS

Alternatively, you can use the AtomEntry to keep both your resource and it's reference (which is stored in the AtromEntry's Id property) together. The FhirClient sticks to this pattern: the Read() operation will return AtomEntry rather than the Resource itself, so the Resource and it's metadata (which is not only it's Url, but also tags, last updated date etc.) can be handled as one object.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top