Stream: cimi
Topic: Profile Question
Kurt Allen (Jan 16 2020 at 19:51):
I am creating a profile that defines a hierarchy of fhir instances, comprised of a top level Diagnostic Report and multiple child Observations. There are some identical overlapping fields in Diagnostic Report and observation that if all are set would contain duplicate data references.
Example. Both Diagnostic Report and Observation contain a Subject reference. The subject reference in each item would be identical, 'cause they all pertain to the same subject.
Should I
a) set cardinality to zero everywhere except in the top level Diagnostic Report, and assume that anyone interested in the these values will look for it only in the Diagnostic Report
or
b) Create a duplicate reference to the same subject and encounter in each child observation.
Option a) is cleaner with identical data not being replicated in multiple locations.
Option b) allows searching on a child observation by these values (if searchable) and removes the need of searching up the hierarchy tree to find these values.
Any opinions/established precedent?
Grahame Grieve (Jan 17 2020 at 00:23):
yes this is specified explicitly in the base FHIR specification: (a) is not-conformant, and there's never any expectation that you should go and hunt around for resources that may or may not provide context, and that wouldn't affect the indexing - be specific on each resource. So it's definitely (b). Specifically:
Because resources are processed independently, relationships are not considered to be transitive. For example, if a Procedure resource references a Patient as its subject, and has a Procedure resource as its reason, there is no automatic rule or implication that the condition has the same patient for its subject. Instead, the subject of the condition must be established directly in the Condition resource itself. Another way to state this is that the context of the subject is not "inherited", nor does it "conduct" along the relationship to condition.
Last updated: Apr 12 2022 at 19:14 UTC