inst/QueryLibrary/Aggregate/condition/C07.md

C07: Find a pathogen by keyword

Description

This query enables a search of all pathogens using a keyword as input. The resulting concepts could be used in query C09 to identify diseases caused by a certain pathogen.

Query

The following is a sample run of the query to list all pathogens specified using a keyword as input.

SELECT
  c.concept_id       AS pathogen_concept_id,
  c.concept_name     AS pathogen_concept_name,
  c.concept_code     AS pathogen_concept_code,
  c.concept_class_id AS pathogen_concept_class,
  c.standard_concept AS pathogen_standard_concept,
  c.vocabulary_id    AS pathogen_concept_vocab_id
FROM @vocab.concept AS c
WHERE
  lower(c.concept_class_id) = 'organism' AND
  lower(c.concept_name) LIKE CONCAT('%', lower($1::text), '%') AND
  c.invalid_reason IS NULL
;

Input

| Parameter | Example | Mandatory | Notes | | --- | --- | --- | --- | | Keyword for pathogen | 'Trypanosoma' | Yes | Keyword without quotes |

Output

| Field | Description | | --- | --- | | Pathogen_Concept_ID | Concept ID of SNOMED-CT pathogen concept | | Pathogen_Concept_Name | Name of SNOMED-CT pathogen concept with keyword entered as input | | Pathogen_Concept_Code | Concept Code of SNOMED-CT pathogen concept | | Pathogen_Concept_Class | Concept class of SNOMED-CT pathogen concept | | Pathogen_Standard_Concept | Indicator of standard concept of SNOMED-CT pathogen concept | | Pathogen_Vocab_ID | Vocabulary ID of the vocabulary from which the pathogen concept is derived from (1 for SNOMED-CT) |

Example output record

| Field | Value | | --- | --- | | Pathogen_Concept_ID | 4085768 | | Pathogen_Concept_Name | Trypanosoma brucei | | Pathogen_Concept_Code | 243659009 | | Pathogen_Concept_Class | Organism | | Pathogen_Standard_Concept | S | | Pathogen_Vocab_ID | SNOMED |

Documentation

https://github.com/OHDSI/CommonDataModel/wiki/concept



sib-swiss/dsQueryLibraryServer documentation built on Feb. 13, 2025, 8:07 p.m.