Stream: implementers
Topic: Entity Relationships
Ryan Christensen (Dec 03 2019 at 20:43):
How are you handling relationships between Patients/Person/User/Organization/Practitioner? We like the idea of the RelatedPerson resource but not the required patient property, we'd rather have this property be used for any resource. Links seem to have some potential if we extend the link property to Organization and Practitioner but we still need to add properties for relationship type and other things.
Lloyd McKenzie (Dec 03 2019 at 21:11):
Person only exists as a linkage resource - you can't actually point to Person from any other resource. You always have to point to Practitioner, Patient or RelatedPerson.
RelatedPerson is 'owned' by it's associated Patient. The resource represents someone who's acting based on their personal relationship with a specific patient (mother, child, friend, neighbor). If you want to capture the fact that Dr. Smith is mother of Dr. Jones and neighbor of Dr. Johnson (for 'smarter' auditing of data access violations?), that would need to be handled by extensions at the moment
Lloyd McKenzie (Dec 03 2019 at 21:14):
The problem of extending RelatedPerson is we generally don't have a use-case for "this procedure was performed by Dr. Jones acting in their capacity as a neighbor of Dr. Johnson". We do have a use-case for "this procedure was performed by Mrs. Jones acting in their capacity as neighbor of Mr. Johnson".
Farrukh Najmi (Jun 28 2021 at 15:56):
@Lloyd McKenzie and colleagues, I am looking for a generic Relationship type that can define arbitrary relationships between any two entities as follows:
- A relationship SHALL be defined by an instance of a new Relationship class with properties source, target, type and extensions
- The source property of Relationship instance SHALL reference the source entity by its id property value
- The target property of Relationship instance SHALL reference the target entity by its id property value
- The type property of Relationship instance may optionally be specified to define the type of relationship. This is useful when there are multiple relationships between the same two entities.
- An extensions property of Relationship instance may be used to define additional properties of the relationship
The basic idea is that changes to relationship between two entities do not require changing either entity but only changing a Relationship entity.
Has a generic relationship feature like above been considered for FHIR? Has anyone implemented something like this as an extension to FHIR and has any experience to share? TIA.
Lloyd McKenzie (Jun 28 2021 at 16:11):
Managing relationships separately from the resources adds significant additional complexities, including queries, creating instances, indexing, etc. It would also mean a complete revamp of FHIR - so I don't think it's realistically an option at this point.
Elliot Silver (Jun 28 2021 at 16:20):
I think part of the argument is that there is usually only a limited number of likely relationships between two resources, and so making those relationships explicit in the resource is clearer. (And extensions can be used to add the unlikely relationships, if needed for specific use cases. )
Lloyd McKenzie (Jun 28 2021 at 17:16):
True. That's also a fairly key thing from conformance management.
Farrukh Najmi (Jun 28 2021 at 18:24):
Thanks guys for sharing your insights.
Managing relationships separately from the resources adds significant additional complexities, including queries, creating instances, indexing, etc. It would also mean a complete revamp of FHIR - so I don't think it's realistically an option at this point.
I agree with above. However, FHIR is already a very complex model in order to handle a broad range of use cases. As such, I think the generic relationships support is a reasonable requirement to consider.
think part of the argument is that there is usually only a limited number of likely relationships between two resources, and so making those relationships explicit in the resource is clearer. (And extensions can be used to add the unlikely relationships, if needed for specific use cases. )
I do not think there are a limited number of relationships between two resources. Many entities have fairly open-ended relationships. For example, a relationship between a Person and an Organization may have many unique relationships.
Lloyd McKenzie (Jun 28 2021 at 19:35):
Most existing systems only support specific relationships and conformance is managed on the basis of specific relationships. We could have created a model that supported generic typed elements as well. The decision to be concrete was a conscious one. In fact we've specifically said that typed relationships are an anti-pattern and should only be used with caution.
Last updated: Apr 12 2022 at 19:14 UTC