Skip to content
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

LOINC basophils in blood descendant of Urinalysis #517

Open
meerapatelmd opened this issue Jul 29, 2021 · 10 comments
Open

LOINC basophils in blood descendant of Urinalysis #517

meerapatelmd opened this issue Jul 29, 2021 · 10 comments

Comments

@meerapatelmd
Copy link

select * from concept_ancestor
where ancestor_concept_id = 37072338 and descendant_concept_id = 3006315.

3006315 relates to a blood specimen, but falls under a UA concept.

@mpatel-cai
Copy link

mpatel-cai commented Jul 29, 2021

Concept Relationship row that is the culprit:
37042222 3006315 Subsumes 1970-01-01 2099-12-31

@Alexdavv
Copy link
Member

Conept Relationship row that is the culprit:
37042222 3006315 Subsumes 1970-01-01 2099-12-31

For me it looks pretty nice:
Basophils | Blood | Hematology and Cell counts
Subsumes
Basophils [#/volume] in Blood.

where ancestor_concept_id = 37072338 and descendant_concept_id = 3006315

Such a record does exist. But what is really weird is that I can't follow a path of valid hierarchical relationships between them.
@hardhouse Can you please help?

@Alexdavv
Copy link
Member

To be more specific:

select * from concept_ancestor
where ancestor_concept_id = 37072338 and descendant_concept_id = 37042222;

This query tells me that they're hierarchically connected (1 level of ancestry).

While this one returns no valid relationships between them:

SELECT *
FROM concept_relationship cr
WHERE cr.concept_id_1 = 37042222
AND cr.concept_id_2 = 37072338
    AND cr.invalid_reason IS NULL;

@mpatel-cai
Copy link

@Alexdavv thanks for your help.

@hardhouse
Copy link
Contributor

hardhouse commented Jul 29, 2021

@Alexdavv

select * from vocabulary_pack.GetAncestorPath (37072338,3006315);
37072338 'Subsumes' 40785816 'Subsumes' 40782521 'Subsumes' 40795977 'Subsumes' 40785796 'Subsumes' 37042222 'Subsumes' 3006315
level=1+0+0+0+0+1=2, so min=2

select * from vocabulary_pack.GetAncestorPath (37072338,37042222);
37072338 'Subsumes' 40785816 'Subsumes' 40782521 'Subsumes' 40795977 'Subsumes' 40785796 'Subsumes' 37042222
level=1+0+0+0+0=1, so min=1

about levels see https://github.com/OHDSI/Vocabulary-v5.0/blob/master/working/packages/vocabulary_pack/pConceptAncestor.sql#L31

@hardhouse hardhouse assigned Alexdavv and unassigned hardhouse Jul 29, 2021
@mpatel-cai
Copy link

Conept Relationship row that is the culprit:
37042222 3006315 Subsumes 1970-01-01 2099-12-31

For me it looks pretty nice:
Basophils | Blood | Hematology and Cell counts
Subsumes
Basophils [#/volume] in Blood.

where ancestor_concept_id = 37072338 and descendant_concept_id = 3006315

Such a record does exist. But what is really weird is that I can't follow a path of valid hierarchical relationships between them.
@hardhouse Can you please help?

select * from omop_vocabulary.concept_ancestor ca 
INNER JOIN (select * from omop_vocabulary.concept_ancestor WHERE ancestor_concept_id = 37072338) ca2 
ON ca2.descendant_concept_id = ca.ancestor_concept_id 
where ca.descendant_concept_id = 3006315 AND ca.min_levels_of_separation = 1;

UA and blood basophils are linked via 3704222. The relationship between the two should not exist unless I'm missing something.

@Alexdavv
Copy link
Member

Alexdavv commented Jul 29, 2021

37072338 'Subsumes' 40785816 'Subsumes' 40782521 'Subsumes' 40795977 'Subsumes' 40785796 'Subsumes' 37042222 'Subsumes' 3006315
level=1+0+0+0+0+1=2, so min=2

That actually means that non-Standard concepts still support the hieararhy, but don't consider to be a level. And simply get dropped from the ancestor table at the end.
@cgreich Is it by design?

UA and blood basophils are linked via 3704222. The relationship between the two should not exist unless I'm missing something.

The problem is that long chain from Urinalysis to Basophils | Blood | Hematology and Cell counts through the Cells, Leukocytes, Granulocytes, Basophils.
Most of the guys are LOINC Components, while the Urinalysis and Basophils | Blood | Hematology and Cell counts are just LOINC parts (without a designated group). So LOINC basically tells you first what can be found in urine, and then doesn't remember that we're in the urine branch.

We need to investigate this. Probably we should not put Components and other parts into the same hierarchy.

But if concept_ancestor works his way, I'm wondering why these issues have happened: #508, #438, #301

@Alexdavv Alexdavv added this to Needs triage in Vocabulary defect handling via automation Jul 29, 2021
@Alexdavv Alexdavv removed their assignment Jul 29, 2021
@Alexdavv
Copy link
Member

But if concept_ancestor works his way, I'm wondering why these issues have happened: #508, #438, #301

Ah, I see. You can't pick a non-Standard LOINC part guy (because it's simply dropped from the ancestor table), while other parts are Classifications that are linked to tests through the non-Standard LOINC Components also.

It's really tricky.

@meerapatelmd
Copy link
Author

@Alexdavv I'm wondering if similar issues exist that have not been found.

@Alexdavv
Copy link
Member

Alexdavv commented Aug 4, 2021

@Alexdavv I'm wondering if similar issues exist that have not been found.

Probably yes - the whole LOINC is done in such a way. We need to investigate how they support/allow to use LOINC grouper concepts.

It would be interesting to check what other vocabularies have the hierarchical branches supported only by non-Standard concepts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants