Hi team,
we have our own FHIR HAPI server instance where we uploaded the LOINC terminology. After uploading i am able check few queries by searching with filter term…
eg: http://144.76.65.203:8080/fhir/ValueSet/$expand?url=http://loinc.org/vs&filter=Lipid
My use case is to get Parent and child data sets using FHIR API. like i need to get all children of particular code 100898-6 , how to get this?
Hi,
To retrieve the parent and child data sets (i.e., hierarchical relationships) of a particular LOINC code using the FHIR API on your HAPI FHIR server, you can leverage the ValueSet/$expand
operation or the CodeSystem/$lookup
operation.
1. Using CodeSystem/$lookup for Hierarchical Relationships
The CodeSystem/$lookup operation can be used to retrieve information about a specific code, including its hierarchy.
Example:
To get information about the code 100898-6, including its parents and children, you can use the following request:
system=http://loinc.org
: This specifies that you are querying the LOINC code system.code=100898-6
: This is the specific LOINC code you are looking up.property=parent&property=child
: This indicates that you want the parent and child relationships of the code.
If you are working with a ValueSet that includes hierarchical definitions?
Anil
Hi,
thanks for the reply,
but its not getting filtered with property parameter, i get same results for both the API’s
http://144.76.65.203:8080/fhir/CodeSystem/$lookup?system=http://loinc.org&code=100898-6&property=parent&property=child
and
http://144.76.65.203:8080/fhir/CodeSystem/$lookup?system=http://loinc.org&code=100898-6
not sure how to check actually this is getting filtered with parent and child values…
I really appreciate this discussion, especially here on the LOINC Forum where we can learn from each other.
I suggest first looking at our Hierarchy Browser tool for context. The default hierarchy (Component By System) is the same one used by the LOINC Terminology Service and in HAPI-FHIR. For instance, if you search for 100898-6 you can see Part codes (LP prefix) are used to organize. The parent for 100898-6 is LP248770-2 (Lab terms not yet categorized).
The examples below reference the LOINC TS but they should work the same in your HAPI-FHIR instance provided the LOINC terminology has been loaded.
LOINC codes only exist at the leaf level in the Component Hierarchy by System so they will have a parent but no children. On the other hand, if you specify a Part code for a branch, you can find both its parent and children. Again, the Hierarchy Browser can help visualize these.
Parent of LP15711-2 (Lipoprotein) is LP7786-9 (CHEM): https://fhir.loinc.org/CodeSystem/$lookup?system=http://loinc.org&code=LP15711-2&property=parent
LP15711-2 has four child branches: https://fhir.loinc.org/CodeSystem/$lookup?code=LP15711-2&system=http%3A%2F%2Floinc.org&_format=json&property=child
If you want both Parent and Child, simply remove the property argument.
I hope this information helps. Let’s keep the conversation going.
yes its lot if learning here…
let me put my question or use case correctly…
I need to get all the Questions under the code 100898-6 , till now i was thinking like its parent and child relationship…it may not…
its code and its Questions list
they use below API to get the data
Questionnaire definition
“https://fhir.loinc.org/Questionnaire/?url=http://loinc.org/q/100898-6”
similarly what is the equivalent API i can use in my FHIR server to get the Questionnaires for a code 100898-6 ?
Hello Srinivasa,
There is a lot of nuance that needs to be addressed here. There is a significant number of LOINC codes which represent collections of LOINC codes. They can be order panels, forms, surveys, etc. LOINC 100898-6 is an order-able Lipid panel. It was populated in the Questionnaire resource because it made the most sense at that time. The request you specified will return the members of the panel.
For an actual questionnaire/assessment like PHQ-9, a corresponding Questionnaire request, https://fhir.loinc.org/Questionnaire/?url=http://loinc.org/q/44249-1, should return the survey questions as identified in the individual LOINC codes.
It’s important to note we may choose to represent these differently in the future. For example, they are better served in the ValueSet resource as our Answer Lists and Groups are. I do not think we will use parent/child relationships in CodeSystem for these.
Everyone’s feedback is important in how we model these going forward. Feel free to submit comments here or via our contact form.