inst/QueryLibrary/Aggregate/condition/C06.md

C06: Translate a given condition to source codes

Description

This query allows to search all source codes that are mapped to a SNOMED-CT clinical finding concept. It can be used to translate SNOMED-CT to ICD-9-CM, ICD-10-CM, Read or OXMIS codes.

Query

The following is a sample run of the query to list all source codes that map to a SNOMED-CT concept entered as input.

SELECT DISTINCT
  c1.concept_code     AS source_code,
  c1.concept_name     AS source_name,
  c1.vocabulary_id    AS source_vocabulary_id,
  c1.domain_id        AS source_domain_id,
  c2.concept_id       AS target_concept_id,
  c2.concept_name     AS target_concept_name,
  c2.concept_code     AS target_concept_code,
  c2.concept_class_id AS target_concept_class,
  c2.vocabulary_id    AS target_concept_vocab_id
FROM @vocab.concept_relationship AS cr
  JOIN @vocab.concept AS c1 ON cr.concept_id_1 = c1.concept_id
  JOIN @vocab.concept AS c2 ON cr.concept_id_2 = c2.concept_id
WHERE
  cr.relationship_id = 'Mapped from' AND
  c1.concept_id = $1 AND
  c2.invalid_reason IS NULL
;

Input

| Parameter | Example | Mandatory | Notes | | --- | --- | --- | --- | | SNOMED-CT Concept ID | 312327 | Yes | Concept IDs are numeric.|

Output

| Field | Description | | --- | --- | | Source_Code | Source code for the disease entered as input | | Source_Code_Description | Description of the source code entered as input | | Source_Vocabulary_ID | Vocabulary the disease source code is derived from as vocabulary code | | Source_Domain_ID | Type of mapping or mapping domain, from source code to target concept. Example Condition, Procedure, Drug etc. | | Target_Concept_ID | Concept ID of the SNOMED-CT concept entered as input | | Target_Concept_Name | Name of the SNOMED-CT concept entered as input | | Target_Concept_Code | Concept code of the SNOMED-CT concept entered as input | | Target_Concept_Class | Concept class of the SNOMED-CT concept entered as input | | Target_Concept_Vocab_ID | Vocabulary of concept entered as input is derived from, as vocabulary ID |

Example output record

| Field | Value | | --- | --- | | Source_Code | 57054005 | | Source_Code_Description | Acute myocardial infarction | | Source_Vocabulary_ID | SNOMED | | Source_Domain_ID | CONDITION | | Target_Concept_ID | 44820861 | | Target_Concept_Name | Acute myocardial infarction, unspecified site, subsequent episode of care | | Target_Concept_Code | 410.92 | | Target_Concept_Class | 5-dig billing code | | Target_Concept_Vocab_ID | ICD9CM |

Documentation

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



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