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

Correct concept representing table and column for your CDM version #16

Open
don-torok opened this issue Jan 29, 2021 · 0 comments
Open

Comments

@don-torok
Copy link

Version 6.0 cost.cost_event_field_concept_id, observation.obs_event_field_concept_id and note.note_event_field_concept_id require the concept that represents the CDM Version/Table/column that the cost, observation or note refers to. This concept is specific to the CDM version. Query input is table.column, output is CDM version, concept_id for table.column and the text for table.column.

SELECT version_concept.concept_name, column_concept.concept_id, column_concept.concept_name
  FROM concept column_concept
  JOIN concept_relationship cr ON column_concept.concept_id = cr.concept_id_1 
      AND cr.invalid_reason IS NULL 
      AND cr.relationship_id = 'Contained in version'
  JOIN concept version_concept ON version_concept.concept_id = cr.concept_id_2 
WHERE column_concept.concept_class_id = 'Field' 
    AND column_concept.standard_concept = 'S' 
    AND column_concept.concept_name = 'drug_exposure.drug_exposure_id'
ORDER BY version_concept.concept_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant