-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General Feedback - FHIR Search: Challenges with Deep Chaining: Tagged Patients pattern #84
Comments
Example:Count a cohort from Patient->ResearchSubject->ResearchStudy
However, this seems to be unsupported Specimen->Patient->ResearchSubject->ResearchStudy
Your mileage may vary, but I see many examples in the spec for queries of the form:
However, I can't see any examples in the spec for:
|
@teslajoy Can you review and comment? |
LGTM 👍 confirming, don't see :_has |
Tags are a poor choice because of their odd update semanticsAn extension and a supported search parameter are better for linking to other resources than tags. This is because update operations for tags do not allow removing tags by default. Instead, the result is the union of old and new tags. I have also heard of servers that resurrect tags on a resource when it is deleted and re-created. The same problem exists for security labels. This is rarely an issue since security labels seldom change. Still, it is serious if you need to change them since it has implications for maintaining subject consent and privacy requirements. If you have access to your server's source code, the standard allows you to deviate from this default behavior, but we wouldn't want to limit the NCPI IG only to servers that users could customize in this way. Use extensionsInstead, I would want custom extensions. For example, one experimental internal system we set up has a "partOfStudy" extension of type "Reference(ResearchStudy)" and an associated search parameter. This can be searched directly or can be used for chaining. We put this on all resources derived from a particular study. This would reduce the example query to GovernanceUsing extensions also helps ensure good governance over the available "tags" - since we'd define an extension for each one. This is something commonly specified in an IG, so users would know exactly where to look and whether the IG handles a case or not. However, governance is not unique to this solution. One can also limit tags in an IG by sub-classing the Meta element and using the appropriate subclass in your IG-specialized resources. A note on chainingSome servers have limited reverse chaining ( |
@RadixSeven Thanks Eric. Agreed, you had me at Question: When you set this up, did you need to create a SearchParameter? Something like:
|
Yes. We created several |
The Challenge of Deep Chaining in FHIR Searches
FHIR’s RESTful API provides powerful mechanisms like chaining and reverse chaining for searching across interconnected resources. However, deep chaining—searching through multiple levels of relationships (e.g.,
ResearchStudy
→ResearchSubject
→Patient
→Specimen
)—often runs into practical and architectural limitations.The Issue with Deep Chaining
Performance Concerns:
Limited Server Support:
Ambiguous Results:
Usability Challenges:
Example Problem
A researcher may want to count all
Specimens
tied to aResearchStudy
. This involves the following chain:ResearchStudy
→ResearchSubject
→Patient
→Specimen
A direct query like this is not supported by many FHIR servers due to depth limitations.
A Potential Workaround: Tagging Patients
To address this, we can leverage tags or extensions on
Patient
resources to simplify queries:Tagging Patients:
Patient
resources with metadata indicating their association with a specificResearchStudy
.ResearchStudy
identifier as atag
orextension
to all relatedPatient
resources.Simplified Query:
Patients
by their tag and use reverse chaining to find associatedSpecimens
:Benefits:
Considerations for Tagging
By strategically tagging or extending resources, FHIR implementers can address the limitations of deep chaining, enabling efficient and effective data queries while maintaining compliance with the FHIR standard.
The text was updated successfully, but these errors were encountered: