kevinpeterson
kevinpeterson

Reputation: 1172

FHIR resource linkages between in-memory objects

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?

Upvotes: 0

Views: 129

Answers (2)

Ewout Kramer
Ewout Kramer

Reputation: 1004

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.

Upvotes: 0

Grahame Grieve
Grahame Grieve

Reputation: 3586

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

Upvotes: 1

Related Questions