Using The NDF-RT
The key connections of NDFRT and HL7-RIM/SPL today are through
- UNII, and
- SNOMED CT
NDF_KIND is a mixed bag, but some of them are clearly mappable to active moieties UNIIs. For those that are (e.g., METOPROLOL) the has_Ingredient relationship to INGREDIENT_KIND is a simple identity relationship of an NDF_KIND and an INGREDIENT_KIND. That way we can find ingredient combination terms in NDF_KIND terms that have multiple has_Ingredient links. This can simplify the odd NDFRT structure into a more logic structure. Most domain knowledge (may_*, CI_*, etc.) hangs off these simple ingredient-like NDF_KIND terms that can be mapped to UNII. Diseases are already mapped to SNOMED. So we can now enrich SPLs with this data all based on active moieties. We simply summarize and merge the moiety knowledge on the product level. There they also need to be reconciliated (if two ingredients contribute similar indications).
In our application, we may be content with taking these domain knowledge relationships from the active moieties only. This may be more manageable. Might be more manageable for FDA also.
UNII to NDF-RT
See new separate page UNII to NDF-RT.
SPL Active Moieties and their coverage in NDFRT
Let's make an overview of what roles we get from just these mapped active moieties:
SELECT name, scount, ncount, ROUND(scount/ncount*100,2) as spct, ucount,
ROUND(ucount/(SELECT COUNT(1) FROM UNII_NDFRT_MAP)*100,2) AS upct
FROM (
SELECT d.name, count(1) AS ncount
FROM umls.ndfrt_concept s
INNER JOIN umls.ndfrt_role r ON(s.id = r.source_id)
INNER JOIN umls.ndfrt_role_def d ON(d.id = r.role_def_id)
WHERE r.target_id IS NOT NULL
AND s.kind = 9
GROUP BY d.name
) a INNER JOIN (
SELECT name, count(1) as ucount, sum(scount) as scount FROM (
SELECT d.name, count(1) as scount
FROM UMLS.UNII_NDFRT_MAP u
INNER JOIN UMLS.NDFRT_ROLE r ON(r.source_id = u.id)
INNER JOIN UMLS.NDFRT_ROLE_DEF d ON(d.id = r.role_def_id)
WHERE r.target_id IS NOT NULL
GROUP BY d.name, u.unii_code
) GROUP BY name
) s USING(name)
ORDER BY name ASC, scount DESC
| NAME | SCOUNT | NCOUNT | SPCT | UCOUNT | UPCT |
| CI_ChemClass | 195 | 283 | 68.9 | 72 | 5.62 |
| CI_MoA | 50 | 81 | 61.73 | 49 | 3.83 |
| CI_PE | 33 | 61 | 54.1 | 31 | 2.42 |
| CI_with | 2331 | 4346 | 53.64 | 726 | 56.67 |
| VA_Product_Component | 1 | 30757 | 0 | 1 | 0.08 |
| definingConcept | 842 | 137936 | 0.61 | 841 | 65.65 |
| effect_may_be_inhibited_by | 1 | 1 | 100 | 1 | 0.08 |
| has_Ingredient | 727 | 4719 | 15.41 | 727 | 56.75 |
| has_MoA | 936 | 1951 | 47.98 | 746 | 58.24 |
| has_PE | 1540 | 3079 | 50.02 | 721 | 56.28 |
| has_PK | 48 | 51 | 94.12 | 25 | 1.95 |
| has_active_metabolites | 3 | 4 | 75 | 3 | 0.23 |
| induces | 36 | 132 | 27.27 | 29 | 2.26 |
| may_diagnose | 31 | 135 | 22.96 | 21 | 1.64 |
| may_prevent | 289 | 721 | 40.08 | 183 | 14.29 |
| may_treat | 3201 | 5590 | 57.26 | 703 | 54.88 |
| metabolized_by_recip_structure | 56 | 64 | 87.5 | 20 | 1.56 |
| site_of_metabolism | 22 | 25 | 88 | 21 | 1.64 |
Obviously we are missing something here. Let's just focus on may_treat (R35) to find out:
- 57.26 of their indications apply to our active moieties
- 54.88 of our active moieties have such indication
So we loose about >40% of content in both ways. Why is that?
- it is possible that SPL moieties only cover ~70% of NDFRT moieties
- it is possible that NDFRT roles are associated with somehow related medicines (e.g. precise ingredients rather than moieties) and we loose those by only looking at moieties.
To be sure, there are often multiple may_treat roles per NDFRT concept:
SELECT count(1) count, min(rcount), median(rcount), avg(rcount), max(rcount) FROM ( SELECT source_id, count(1) rcount FROM UMLS.NDFRT_ROLE WHERE ROLE_DEF_ID = 'R35' GROUP BY source_id )
- 1473 have any may_treat
- minimum 1
- median 3
- average 3.79
- maximum 30
This may help us to explore the mismatches:
SELECT source_id, unii_code, c.name, n.name, min(r.rcount), max(r.rcount)
FROM (SELECT source_id, count(DISTINCT target_id) as rcount
FROM UMLS.NDFRT_ROLE WHERE ROLE_DEF_ID IN ('R35', 'R43', 'R39', 'R41')
GROUP BY source_id) r
FULL OUTER JOIN UMLS.UNII_NDFRT_MAP u ON(r.source_id = u.id)
LEFT OUTER JOIN UMLS.NDFRT_CONCEPT c ON(c.id = r.source_id)
LEFT OUTER JOIN (SELECT code, min(displayName) as name FROM UNII GROUP BY code) n ON(n.code = u.unii_code)
GROUP BY source_id, unii_code, c.name, n.name
ORDER BY coalesce(c.name, n.name)
From inspection we do not see a specific pattern, i.e., no large scale systematic misses which seem to be preventable. There are known issues with electrolytes and with insulins, but those appear to be of minor value to fix. There is a larger set of NDFRT concepts not yet reflected in UNII and a small set of UNIIs not yet in NDFRT, but none of this we can do anything about.
So, let's conclude with numbers: How many of our active moieties have any indications?
SELECT unii_code, count(source_id) count, min(rcount), median(rcount), avg(rcount), max(rcount)
FROM (
SELECT source_id, unii_code /*, c.name, n.name*/, avg(r.rcount) rcount
FROM (SELECT source_id, count(DISTINCT target_id) as rcount
FROM UMLS.NDFRT_ROLE WHERE ROLE_DEF_ID IN ('R35', 'R43', 'R39', 'R41')
GROUP BY source_id) r
FULL OUTER JOIN UMLS.UNII_NDFRT_MAP u ON(r.source_id = u.id)
-- LEFT OUTER JOIN UMLS.NDFRT_CONCEPT c ON(c.id = r.source_id)
-- LEFT OUTER JOIN (SELECT code, min(displayName) as name FROM UNII GROUP BY code) n ON(n.code = u.unii_code)
GROUP BY unii_code, source_id --, c.name, n.name
) GROUP BY unii_code
- 118 UNIIs have no indication.
- 841 UNIIs exist
- 843 NDFRT indications have no UNII
Now let's move on.
DISEASE_KIND to SNOMED mapping
There are SNOMED mappings in NDFRT, so this might be trivial.
SELECT name, term_has_mapping, mapping_is_finding, count(1)
FROM (
SELECT d.name,
CASE WHEN r.target_value IS NULL THEN 0 ELSE 1 END term_has_mapping,
CASE WHEN s.code IS NULL THEN 0 ELSE 1 END mapping_is_finding
FROM umls.ndfrt_role c
INNER JOIN umls.ndfrt_role_def d ON(d.id = c.role_def_id)
LEFT OUTER JOIN umls.ndfrt_role r ON(c.target_id = r.source_id AND r.role_def_id = 'P262795')
LEFT OUTER JOIN umls.snomed_finding s ON(s.code = r.target_value)
WHERE c.role_def_id IN ('R37', 'R41', 'R43', 'R39', 'R35')
) GROUP BY ROLLUP(name, term_has_mapping, mapping_is_finding)
And of course we have losses everywhere:
| ROLE | TERM_HAS_MAPPING | MAPPING_IS_FINDING | COUNT |
| CI_with | 0 | 0 | 85 |
| CI_with | 0 | * | 85 |
| CI_with | 1 | 0 | 559 |
| CI_with | 1 | 1 | 10815 |
| CI_with | 1 | * | 11374 |
| CI_with | * | * | 11459 |
| induces | 0 | 0 | 7 |
| induces | 0 | * | 7 |
| induces | 1 | 0 | 8 |
| induces | 1 | 1 | 262 |
| induces | 1 | * | 270 |
| induces | * | * | 277 |
| may_treat | 0 | 0 | 510 |
| may_treat | 0 | * | 510 |
| may_treat | 1 | 0 | 270 |
| may_treat | 1 | 1 | 10244 |
| may_treat | 1 | * | 10514 |
| may_treat | * | * | 11024 |
| may_prevent | 0 | 0 | 72 |
| may_prevent | 0 | * | 72 |
| may_prevent | 1 | 0 | 44 |
| may_prevent | 1 | 1 | 1371 |
| may_prevent | 1 | * | 1415 |
| may_prevent | * | * | 1487 |
| may_diagnose | 0 | 0 | 12 |
| may_diagnose | 0 | * | 12 |
| may_diagnose | 1 | 0 | 2 |
| may_diagnose | 1 | 1 | 312 |
| may_diagnose | 1 | * | 314 |
| may_diagnose | * | * | 326 |
| * | * | * | 24573 |
So we need to check which terms are not mapped properly? And indeed there are issues.
SELECT d.name, c.target_id, cc.name, r.target_value, m.STR, m.tty
FROM umls.ndfrt_role c
INNER JOIN umls.ndfrt_role_def d ON(d.id = c.role_def_id)
INNER JOIN umls.ndfrt_concept cc ON(cc.id = c.target_id)
INNER JOIN umls.ndfrt_role r ON(c.target_id = r.source_id AND r.role_def_id = 'P262795')
LEFT OUTER JOIN umls.snomed_finding s ON(s.code = r.target_value)
LEFT OUTER JOIN umls.mrconso m ON(m.code = r.target_value AND m.sab = 'SNOMEDCT' AND m.tty IN ('FN', 'OF'))
WHERE c.role_def_id IN ('R37', 'R41', 'R43', 'R39', 'R35')
AND r.target_value IS NOT NULL
AND s.code IS NULL
GROUP BY d.name, c.target_id, cc.name, r.target_value, m.STR, m.tty
| ROLE | ID | NAME | SNOMED | SNOMED NAME | TTY |
| may_treat | 791 | Adenocarcinoma [Disease/Finding] | 35917007 | Adenocarcinoma, no subtype (morphologic abnormality) | FN |
| may_treat | 799 | Adenoma [Disease/Finding] | 32048006 | Adenoma, no subtype (morphologic abnormality) | FN |
| CI_with | 811 | Adhesions [Disease/Finding] | 42685002 | Adhesion (morphologic abnormality) | FN |
| CI_with | 31787 | Adolescent [Disease/Finding] | 133937008 | Adolescent (person) | FN |
| may_treat | 1293 | Bites, Human [Disease/Finding] | 43028005 | Human bite (morphologic abnormality) | FN |
| may_prevent | 1473 | Calculi [Disease/Finding] | 56381008 | Calculus (morphologic abnormality) | FN |
| may_prevent | 1473 | Calculi [Disease/Finding] | 125243009 | Single calculus (morphologic abnormality) | FN |
| may_treat | 7659 | Carcinoma, Medullary [Disease/Finding] | 32913002 | Medullary carcinoma (morphologic abnormality) | FN |
| CI_with | 1507 | Carcinoma [Disease/Finding] | 68453008 | Carcinoma, no subtype (morphologic abnormality) | FN |
| may_treat | 1507 | Carcinoma [Disease/Finding] | 68453008 | Carcinoma, no subtype (morphologic abnormality) | FN |
| CI_with | 31769 | Child [Disease/Finding] | 410601007 | Childhood age person (person) | FN |
| induces | 1985 | Death [Disease/Finding] | 419620001 | Death (event) | FN |
| may_prevent | 1985 | Death [Disease/Finding] | 419620001 | Death (event) | FN |
| CI_with | 7177 | Diabetic Ketoacidosis [Disease/Finding] | 24927004 | Diabetes with ketoacidosis (disorder) | OF |
| may_diagnose | 7177 | Diabetic Ketoacidosis [Disease/Finding] | 24927004 | Diabetes with ketoacidosis (disorder) | OF |
| may_treat | 7177 | Diabetic Ketoacidosis [Disease/Finding] | 24927004 | Diabetes with ketoacidosis (disorder) | OF |
| CI_with | 2093 | Diabetic Nephropathies [Disease/Finding] | 21858001 | Diabetes with renal manifestations (disorder) | OF |
| may_prevent | 2093 | Diabetic Nephropathies [Disease/Finding] | 21858001 | Diabetes with renal manifestations (disorder) | OF |
| may_treat | 2093 | Diabetic Nephropathies [Disease/Finding] | 21858001 | Diabetes with renal manifestations (disorder) | OF |
| may_treat | 2095 | Diabetic Neuropathies [Disease/Finding] | 267382005 | Diabetes mellitus with neurological manifestation (disorder) | OF |
| may_treat | 2203 | Dwarfism [Disease/Finding] | 190584003 | Constitutional short stature (disorder) | OF |
| CI_with | 2293 | Edema [Disease/Finding] | 20741006 | Hydrops (morphologic abnormality) | FN |
| CI_with | 2293 | Edema [Disease/Finding] | 79654002 | Edema (morphologic abnormality) | FN |
| may_treat | 2293 | Edema [Disease/Finding] | 79654002 | Edema (morphologic abnormality) | FN |
| may_treat | 2293 | Edema [Disease/Finding] | 20741006 | Hydrops (morphologic abnormality) | FN |
| CI_with | 31785 | Elderly adult [Disease/Finding] | 207528003 | [D]Senescence (situation) | FN |
| CI_with | 31785 | Elderly adult [Disease/Finding] | 207528003 | [D]Senescence (context-dependent category) | OF |
| CI_with | 31785 | Elderly adult [Disease/Finding] | 271872005 | Old age (qualifier value) | FN |
| CI_with | 31785 | Elderly adult [Disease/Finding] | 207527008 | [D]Old age (situation) | FN |
| CI_with | 31785 | Elderly adult [Disease/Finding] | 207527008 | [D]Old age (context-dependent category) | OF |
| may_treat | 2413 | Ependymoma [Disease/Finding] | 57706008 | Ependymoma, no ICD-O subtype (morphologic abnormality) | FN |
| may_treat | 2675 | Fibrosarcoma [Disease/Finding] | 53654007 | Fibrosarcoma (morphologic abnormality) | FN |
| may_treat | 2677 | Fibrosis [Disease/Finding] | 112674009 | Fibrosis (morphologic abnormality) | FN |
| induces | 2701 | Flatulence [Disease/Finding] | 249505007 | Farting (finding) | OF |
| induces | 2701 | Flatulence [Disease/Finding] | 275298000 | Wind symptom (context-dependent category) | OF |
| induces | 2701 | Flatulence [Disease/Finding] | 275298000 | Wind symptom (finding) | OF |
| may_prevent | 2701 | Flatulence [Disease/Finding] | 275298000 | Wind symptom (context-dependent category) | OF |
| may_prevent | 2701 | Flatulence [Disease/Finding] | 275298000 | Wind symptom (finding) | OF |
| may_prevent | 2701 | Flatulence [Disease/Finding] | 249505007 | Farting (finding) | OF |
| may_treat | 2701 | Flatulence [Disease/Finding] | 275298000 | Wind symptom (finding) | OF |
| may_treat | 2701 | Flatulence [Disease/Finding] | 275298000 | Wind symptom (context-dependent category) | OF |
| may_treat | 2701 | Flatulence [Disease/Finding] | 249505007 | Farting (finding) | OF |
| may_treat | 2873 | Glioblastoma [Disease/Finding] | 63634009 | Glioblastoma (morphologic abnormality) | FN |
| may_treat | 2875 | Glioma [Disease/Finding] | 115240006 | Glioma (morphologic abnormality) | FN |
| may_treat | 2949 | Granuloma [Disease/Finding] | 45647009 | Granuloma (morphologic abnormality) | FN |
| CI_with | 3211 | Hernia [Disease/Finding] | 414403008 | Herniated structure (morphologic abnormality) | FN |
| may_treat | 3345 | Hyperemia [Disease/Finding] | 30098003 | Hyperemia (morphologic abnormality) | FN |
| may_treat | 7419 | Hypereosinophilic Syndrome [Disease/Finding] | 128835008 | Hypereosinophilic syndrome/chronic eosinophilic leukemia (morphologic abnormality) | FN |
| may_treat | 7419 | Hypereosinophilic Syndrome [Disease/Finding] | 128835008 | Hypereosinophilic syndrome (morphologic abnormality) | OF |
| CI_with | 3399 | Hypersensitivity [Disease/Finding] | 127072000 | Allergic disorder (disorder) | OF |
| may_treat | 3399 | Hypersensitivity [Disease/Finding] | 127072000 | Allergic disorder (disorder) | OF |
| may_diagnose | 3515 | Immune System Diseases [Disease/Finding] | 41266007 | Disorder of immune system (disorder) | OF |
| may_diagnose | 3515 | Immune System Diseases [Disease/Finding] | 41266007 | Disease of immune system (disorder) | OF |
| may_diagnose | 3515 | Immune System Diseases [Disease/Finding] | 41266007 | Disorder of immune system (navigational concept) | FN |
| may_treat | 3515 | Immune System Diseases [Disease/Finding] | 41266007 | Disorder of immune system (disorder) | OF |
| may_treat | 3515 | Immune System Diseases [Disease/Finding] | 41266007 | Disease of immune system (disorder) | OF |
| may_treat | 3515 | Immune System Diseases [Disease/Finding] | 41266007 | Disorder of immune system (navigational concept) | FN |
| CI_with | 31765 | Infant [Disease/Finding] | 133931009 | Infant (person) | FN |
| may_treat | 3539 | Infarction [Disease/Finding] | 55641003 | Infarct (morphologic abnormality) | FN |
| induces | 3553 | Inflammation [Disease/Finding] | 23583003 | Inflammation (morphologic abnormality) | FN |
| may_treat | 3553 | Inflammation [Disease/Finding] | 23583003 | Inflammation (morphologic abnormality) | FN |
| may_treat | 3783 | Leiomyoma [Disease/Finding] | 189793008 | [M]Leiomyomatous neoplasm NOS (morphologic abnormality) | FN |
| may_treat | 3783 | Leiomyoma [Disease/Finding] | 189787000 | [M]Leiomyomatous neoplasms (morphologic abnormality) | FN |
| may_treat | 3783 | Leiomyoma [Disease/Finding] | 189788005 | [M]Leiomyoma NOS (morphologic abnormality) | FN |
| may_treat | 6715 | Leukemia, Basophilic, Acute [Disease/Finding] | 69077002 | Acute basophilic leukemia (morphologic abnormality) | FN |
| may_treat | 6713 | Leukemia, Nonlymphocytic, Acute [Disease/Finding] | 413443009 | Acute myeloid leukemia - category (morphologic abnormality) | FN |
| may_treat | 6713 | Leukemia, Nonlymphocytic, Acute [Disease/Finding] | 17788007 | Acute myeloid leukemia, no ICD-O subtype (morphologic abnormality) | FN |
| may_treat | 8423 | Lithiasis [Disease/Finding] | 66058000 | Lithiasis (morphologic abnormality) | FN |
| may_treat | 4015 | Macular Degeneration [Disease/Finding] | 302891003 | Macular degeneration (disorder) | OF |
| may_treat | 4107 | Medulloblastoma [Disease/Finding] | 83217000 | Medulloblastoma (morphologic abnormality) | FN |
| may_treat | 7757 | Melanoma, Amelanotic [Disease/Finding] | 70594002 | Amelanotic melanoma (morphologic abnormality) | FN |
| may_treat | 31749 | Menopause [Disease/Finding] | 161712005 | Menopause, function (observable entity) | FN |
| may_treat | 31749 | Menopause [Disease/Finding] | 161712005 | Menopause (qualifier value) | OF |
| may_treat | 7637 | Mesothelioma, Cystic [Disease/Finding] | 86562005 | Cystic mesothelioma (morphologic abnormality) | FN |
| may_treat | 4185 | Mesothelioma [Disease/Finding] | 62064005 | Mesothelioma, malignant (morphologic abnormality) | FN |
| may_treat | 4325 | Mycoplasma Infections [Disease/Finding] | 186462007 | Eaton's agent infection (disorder) | OF |
| may_treat | 4341 | Myeloid Metaplasia [Disease/Finding] | 82513007 | Myeloid metaplasia (morphologic abnormality) | FN |
| CI_with | 4343 | Myeloproliferative Disorders [Disease/Finding] | 414794006 | Myeloproliferative disorder (morphologic abnormality) | FN |
| CI_with | 4343 | Myeloproliferative Disorders [Disease/Finding] | 128925001 | Myeloproliferative disease, no ICD-O subtype (morphologic abnormality) | FN |
| CI_with | 4343 | Myeloproliferative Disorders [Disease/Finding] | 414792005 | Myeloid neoplasm (morphologic abnormality) | FN |
| CI_with | 4343 | Myeloproliferative Disorders [Disease/Finding] | 128925001 | Myeloproliferative disease (morphologic abnormality) | OF |
| may_treat | 4343 | Myeloproliferative Disorders [Disease/Finding] | 414794006 | Myeloproliferative disorder (morphologic abnormality) | FN |
| may_treat | 4343 | Myeloproliferative Disorders [Disease/Finding] | 414792005 | Myeloid neoplasm (morphologic abnormality) | FN |
| may_treat | 4343 | Myeloproliferative Disorders [Disease/Finding] | 128925001 | Myeloproliferative disease (morphologic abnormality) | OF |
| may_treat | 4343 | Myeloproliferative Disorders [Disease/Finding] | 128925001 | Myeloproliferative disease, no ICD-O subtype (morphologic abnormality) | FN |
| may_treat | 4413 | Necrosis [Disease/Finding] | 6574001 | Necrosis (morphologic abnormality) | FN |
| may_treat | 4513 | Neuroblastoma [Disease/Finding] | 87364003 | Neuroblastoma (morphologic abnormality) | FN |
| CI_with | 4545 | Nevus [Disease/Finding] | 51697005 | Cutaneous hamartoma (morphologic abnormality) | FN |
| may_treat | 5535 | Osteosarcoma [Disease/Finding] | 21708004 | Osteosarcoma, no ICD-O subtype (morphologic abnormality) | FN |
| may_treat | 4733 | Paget's Disease, Extramammary [Disease/Finding] | 71447003 | Paget's disease, extramammary (except Paget's disease of bone) (morphologic abnormality) | FN |
| may_treat | 4769 | Papilloma [Disease/Finding] | 23730008 | Papilloma (except papilloma of bladder M-81201) (morphologic abnormality) | OF |
| may_treat | 4769 | Papilloma [Disease/Finding] | 23730008 | Papilloma, no ICD-O subtype (except papilloma of bladder M-81201) (morphologic abnormality) | FN |
| may_treat | 4983 | Pigmentation Disorders [Disease/Finding] | 201273003 | Dyschromia (disorder) | OF |
| CI_with | 31747 | Pregnancy [Disease/Finding] | 289908002 | Pregnancy (qualifier value) | OF |
| CI_with | 31747 | Pregnancy [Disease/Finding] | 289908002 | Pregnancy, function (observable entity) | FN |
| induces | 31747 | Pregnancy [Disease/Finding] | 289908002 | Pregnancy, function (observable entity) | FN |
| induces | 31747 | Pregnancy [Disease/Finding] | 289908002 | Pregnancy (qualifier value) | OF |
| may_prevent | 31747 | Pregnancy [Disease/Finding] | 289908002 | Pregnancy, function (observable entity) | FN |
| may_prevent | 31747 | Pregnancy [Disease/Finding] | 289908002 | Pregnancy (qualifier value) | OF |
| CI_with | 31845 | Pregnancy First Trimester [Disease/Finding] | 255246003 | First trimester (qualifier value) | FN |
| CI_with | 31847 | Pregnancy Second Trimester [Disease/Finding] | 255247007 | Second trimester (qualifier value) | FN |
| CI_with | 31849 | Pregnancy Third Trimester [Disease/Finding] | 255248002 | Third trimester (qualifier value) | FN |
| may_treat | 5527 | Sarcoma, Ewing's [Disease/Finding] | 76909002 | Ewing's sarcoma (morphologic abnormality) | FN |
| induces | 5583 | Sclerosis [Disease/Finding] | 43846000 | Sclerosis (morphologic abnormality) | FN |
| may_treat | 5733 | Snake Bites [Disease/Finding] | 125199004 | Snake bite (morphologic abnormality) | FN |
| may_treat | 5963 | Tachycardia, Paroxysmal [Disease/Finding] | 195078007 | Bouveret-Hoffmann syndrome (disorder) | OF |
| may_treat | 6225 | Trophoblastic Neoplasms [Disease/Finding] | 115234004 | Trophoblastic neoplasm (morphologic abnormality) | FN |
| may_prevent | 6277 | Tuberculosis, Pulmonary [Disease/Finding] | 397190009 | Respiratory tuberculosis (disorder) | OF |
| may_treat | 6277 | Tuberculosis, Pulmonary [Disease/Finding] | 397190009 | Respiratory tuberculosis (disorder) | OF |
| CI_with | 6303 | Ulcer [Disease/Finding] | 56208002 | Ulcer (morphologic abnormality) | FN |
| may_treat | 6303 | Ulcer [Disease/Finding] | 56208002 | Ulcer (morphologic abnormality) | FN |
| CI_with | 8327 | Venous Thrombosis [Disease/Finding] | 18266009 | Phlebothrombosis (disorder) | OF |
| may_prevent | 8327 | Venous Thrombosis [Disease/Finding] | 18266009 | Phlebothrombosis (disorder) | OF |
| may_treat | 8327 | Venous Thrombosis [Disease/Finding] | 18266009 | Phlebothrombosis (disorder) | OF |
| may_treat | 7917 | Ventricular Premature Complexes [Disease/Finding] | 195093006 | Ventricular ectopic beats (finding) | OF |
| may_treat | 7917 | Ventricular Premature Complexes [Disease/Finding] | 195093006 | Ventricular ectopic beats (disorder) | OF |
| may_treat | 6521 | Wounds, Nonpenetrating [Disease/Finding] | 3821009 | Blunt injury (morphologic abnormality) | FN |
| CI_with | 6517 | Wounds and Injuries [Disease/Finding] | 19130008 | Traumatic abnormality (morphologic abnormality) | FN |
| may_treat | 6517 | Wounds and Injuries [Disease/Finding] | 19130008 | Traumatic abnormality (morphologic abnormality) | FN |
| CI_with | 31773 | Young child [Disease/Finding] | 74489007 | Younger child (person) | FN |
Even if we use that "SPL_Problem_List_Mapping_ID" instead of the SNOMED id we still have losses.
SELECT name, term_has_mapping, mapping_is_finding, role_def_id, count(1)
FROM (
SELECT r.role_def_id,
d.name,
CASE WHEN r.target_value IS NULL THEN 0 ELSE 1 END term_has_mapping,
CASE WHEN s.code IS NULL THEN 0 ELSE 1 END mapping_is_finding
FROM umls.ndfrt_role c
INNER JOIN umls.ndfrt_role_def d ON(d.id = c.role_def_id)
LEFT OUTER JOIN umls.ndfrt_role r ON(c.target_id = r.source_id AND r.role_def_id IN ('P262795', 'P262796'))
LEFT OUTER JOIN umls.snomed_finding s ON(s.code = r.target_value)
WHERE c.role_def_id IN ('R37', 'R41', 'R43', 'R39', 'R35')
) GROUP BY ROLLUP(name, term_has_mapping, mapping_is_finding, role_def_id)
But now that we know what we're missing, we can move right ahead and complete the task before coming back and filling those gaps.
Extracting and Simplifying Useful Relationships
We want
- indication (may_treat, may_prevent, may_diagnose, and induces)
- classifications has_MoA, has_PE
- the ChemClass? through has_Ingredient and then definingConcept+
- interactions CI_MoA, CI_PE, CI_ChemClass
- contraindications CI_with
most of these we will attach directly. Exept the ChemClass?, which we get from the definingConcept.
- The INGREDIENT_KIND and NDF_KIND with single ingredient should be merged into a single ingredient.
- The NDF_KIND with multiple ingredients can link directly to the NDF_KIND with single ingredients.
We shall reformulate the NDFRT using the SPL conceptual model.
Ingredient Substances (Moieties)
Those are the single ingredient ones:
WITH ingr AS (
SELECT source_id, target_id
FROM umls.ndfrt_role
WHERE role_def_id = 'R25'
), single AS (
SELECT i.source_id as id
FROM ingr i
LEFT OUTER JOIN ingr j
ON(i.source_id = j.source_id AND i.target_id <> j.target_id)
WHERE j.source_id IS NULL
) SELECT *
FROM single
INNER JOIN umls.ndfrt_concept USING(id)
And double check if any of the remaining have no '/' in their name
WITH ingr AS (
...
), multi AS (
SELECT source_id AS id FROM ingr
MINUS
SELECT id FROM single
) SELECT *
FROM multi
INNER JOIN umls.ndfrt_concept USING(id)
WHERE name not like '%/%'
No, they don't. But aren't there some of the single ingredient items that have them?
WITH ingr AS (
...
) SELECT *
FROM single
INNER JOIN umls.ndfrt_concept USING(id)
INNER JOIN ingr ON(source_id = id)
WHERE name like '%/%'
ORDER BY id
yes there are. A lot. But what ingredient?
WITH ingr AS (
...
) SELECT *
FROM single
INNER JOIN umls.ndfrt_concept c USING(id)
INNER JOIN ingr i ON(source_id = id)
INNER JOIN umls.ndfrt_concept d ON(d.id = i.target_id)
WHERE c.name like '%/%'
those are mostly incomplete. Now do they carry any indications?
WITH ingr AS (
...
) SELECT *
FROM single
INNER JOIN umls.ndfrt_concept c USING(id)
INNER JOIN umls.ndfrt_role r ON(r.source_id = id AND r.role_def_id IN('R35', 'R43', 'R39', 'R41'))
WHERE c.name like '%/%'
no, nothing. So, never mind those.
Now we care for these single ingredient NDF_KIND terms because they carry the interesting knowledge. But we get those also from our UNII_NDFRT_MAP. We don't really care for the the mixtures, except for their carring extra information which the single ingredients don't have.
WITH ingr AS (
...
) SELECT *
FROM multi
INNER JOIN umls.ndfrt_concept c USING(id)
INNER JOIN umls.ndfrt_role r ON(r.source_id = id AND r.role_def_id IN('R35', 'R43', 'R39', 'R41'))
ORDER BY id
but there is only one of very low interest, so, never mind again.
Ready to make our interaction tables:
- by Chemical Class NdfRtInteractionTable.
- by Mechanism of Action NdfRtInteractionTableMoa
- by Physiologic Effect NdfRtInteractionTablePhysiologicEffect
![(please configure the [header_logo] section in trac.ini)](/mw/chrome/site/logo100.png)