OHDSI Home | Forums | Wiki | Github

How to implement a LOINC lab test panel?

I have a lab test panel (Complete urine culture panel) which includes multiple test items such as RBC, WBC etc. The data is shown below.

The LOINC code 58077-9 belongs to Measurement domain. But if I put this data into Measurement table, there is no column to put the test item description information, i.e., PH, RBC, WBC etc. After reading some of the forum post, it looks like I should put this information into fact_relationship table. But I am not sure how because fact_relationship table only takes concept_id. Does this mean I need to map all the individual test item into standard concept_id? Also how do I get fact_id?

Good question.
As long as it’s a panel and doesn’t have the actual result but rather a set of test and results, you may simply split your records into separate tests. That what makes sense. If you’re really interested in this particular code, you may link the panel with the tests using fact_relationship.
And to get the tests you may use ‘Panel contains’ relationship in cocnept_relationship. After a number of iterations, you’ll eventually get your list of tests.
Like in your example you’ll get a link to Urinalysis and then to another panel and finally to a set of tests

Well, yes, you need to map.
So first you get the set of the tests contained in the panel (as @aostropolets said)
Then you need to match each testitem code to the concepts from this list.

581436 Parent to Child Measurement - the relationship_id for Panel to Test
581437 Child to Parent Measurement - the relationship_id for Test to Panel

look


fact_id_1: The unique identifier in the table corresponding to the domain of fact one.
fact_id_2: The unique identifier in the table corresponding to the domain of fact two.

So when you build Panel to Test relationship:
the fact_id_1 is the measurement_id for the Panel entry
and fact_id_2 is the measurement_id for the individual test entry
and relatationship_id = 581436 (Parent to Child Measurement)
and vice versa for the Test to Panel relationship

Thank you very much, Anna and Dmitry !

I’ve come across this similar issue again recently. For example the LOINC:
3002245 - Blood gas studies (set) - 18767-4

@aostropolets - I tried to use the OMOP Vocab to get from this LOINC to its parts using relationships like “Contained in Panel” and “Panel Contains” but I didn’t have luck. Could you show me how you would get its parts?

I think this aligns to what you are saying above, but I’m suggesting that a row be written for each panel item and additionally the panel itself. For this panel, there are 24 parts (e.g. pH, pCO2, pO2, …) meaning there would be 24 rows plus the actual LOINC itself - for a total of 25 rows. I would then overload the MEASUREMENT_SOURCE_VALUE with both the LOINC and panel (e.g. 18767-4 - ph, 18767-4 - pCO2, …) and map the MEASUREMENT_SOURCE_CONCEPT_ID to the CONCEPT_ID for the LOINC. You could use the FACT_RELATIONSHIP to tie them together, however I find in practice this doesn’t end up getting used much.

@Dymshyts, @clairblacketer, @aostropolets - what are your thoughts.

Tagging @BarisErdogan

1 Like

@ericaVoss I do not see any relationship in the vocabulary for LOINC 18767-4 Blood gas studies (set) to LOINC 24338-6 Gas panel - Blood. But starting with LOINC 24338-6 the following query get the components.

select distinct parent.concept_code, parent.concept_name,relationship_id
     , min_levels_of_separation, child.concept_code, child.concept_name
FROM concept parent
JOIN  concept_ancestor ON ancestor_concept_id = parent.concept_id
JOIN concept_relationship ON concept_id_1 = descendant_concept_id
JOIN concept child on child.concept_id = descendant_concept_id
where parent.concept_code = '24338-6'
AND relationship_id = 'Contained in panel'
ORDER by min_levels_of_separation, child.concept_code
concept_code concept_name relationship_id min_levels concept_code concept_name
24338-6 Gas panel - Blood Contained in panel 1 11555-0 Base excess in Blood by calculation
24338-6 Gas panel - Blood Contained in panel 1 11556-8 Oxygen [Partial pressure] in Blood
24338-6 Gas panel - Blood Contained in panel 1 11557-6 Carbon dioxide [Partial pressure] in Blood
24338-6 Gas panel - Blood Contained in panel 1 11558-4 pH of Blood
24338-6 Gas panel - Blood Contained in panel 1 19254-2 Oxygen [Partial pressure] adjusted to patient’s actual temperature in Blood
24338-6 Gas panel - Blood Contained in panel 1 1959-6 Bicarbonate [Moles/volume] in Blood
24338-6 Gas panel - Blood Contained in panel 1 20564-1 Oxygen saturation in Blood
24338-6 Gas panel - Blood Contained in panel 1 20565-8 Carbon dioxide, total [Moles/volume] in Blood
24338-6 Gas panel - Blood Contained in panel 1 2713-6 Oxygen saturation Calculated from oxygen partial pressure in Blood
24338-6 Gas panel - Blood Contained in panel 1 30318-0 Base deficit in Blood
24338-6 Gas panel - Blood Contained in panel 1 3150-0 Inhaled oxygen concentration
24338-6 Gas panel - Blood Contained in panel 1 3151-8 Inhaled oxygen flow rate
24338-6 Gas panel - Blood Contained in panel 1 33254-4 pH of Arterial blood adjusted to patient’s actual temperature
24338-6 Gas panel - Blood Contained in panel 1 34705-4 Carbon dioxide [Partial pressure] adjusted to patient’s actual temperature in Blood
24338-6 Gas panel - Blood Contained in panel 1 57800-5 Oxygen content in Blood by calculation
24338-6 Gas panel - Blood Contained in panel 1 718-7 Hemoglobin [Mass/volume] in Blood
24338-6 Gas panel - Blood Contained in panel 1 8310-5 Body temperature
1 Like
t