inspectomop.queries.general.children_for_concept_id

inspectomop.queries.general.children_for_concept_id(concept_id, inspector, return_columns=None)

Find all child concepts for a concept_id.

Parameters:
  • concept_id (int) – concept_id of interest from the concept table
  • inspector (inspectomop.inspector.Inspector) –
  • return_columns (list of str, optional) –
    • optional subset of columns to return from the query
    • columns : [‘child_concept_id’,’child_concept_name’, ‘child_concept_code’, ‘child_concept_class_id’, ‘child_concept_vocabulary_id’, ‘child_concept_vocab_name’]
Returns:

results

Return type:

inspectomop.results.Results

Notes

Original SQL

G11: Find children for a given concept:

SELECT
    D.concept_id Child_concept_id,
    D.concept_name Child_concept_name,
    D.concept_code Child_concept_code,
    D.concept_class_id Child_concept_class_id,
    D.vocabulary_id Child_concept_vocab_ID,
    VS.vocabulary_name Child_concept_vocab_name
FROM
    concept_ancestor CA,
    concept D,
    vocabulary VS
WHERE
    CA.ancestor_concept_id = 192671 AND
    CA.min_levels_of_separation = 1 AND
    CA.descendant_concept_id = D.concept_id AND
    D.vocabulary_id = VS.vocabulary_id AND
    sysdate BETWEEN D.valid_start_date AND D.valid_end_date;