OHDSI Home | Forums | Wiki | Github

ATLAS Characteristions Feature Analyses design

Hi all,
I have some questions about Characterizations on ATLAS :

  1. How could I design new feature analyses using aggregated functions. e.g. patient maximum temperature in the first 24 h of admission

  2. How can I report missing data in characterization?

  3. where could I find SQL code for existing feature analyses? now the #71 Demographics Age Group analysis is in 5 year age groups, I want to edit the age groups to 10 year age. Is there any method to see the original design and edit based on it?

In 2.8, you can now define distribution statistics, such as max temp within a time window of cohort entry. Assuming your cohort entry is the admission, the following link will take you to a distribution criteria that will find the max temp (C and F separately, there may be other ways to measure temp? (K)?) You add it to your cohort characterization to use:
http://atlas-demo.ohdsi.org/#/cc/feature-analyses/172

Iā€™m not sure what you mean by ā€˜missing dataā€™.

The demographics age group SQL is found here: https://github.com/OHDSI/FeatureExtraction/blob/master/inst/sql/sql_server/DemographicsAgeGroup.sql.

You can make your own SQL and create a custom feature where you provide your own custom SQL script. If you go to ā€˜new featureā€™ and look at the sample sql, you can see how you need to return the appropriate columns in order for the custom sql to work. here is the template:

-- Custom analysis producing same results as Feature Extraction's "One covariate per drug in the drug_era table overlapping with any time prior to index."
SELECT
  CAST(drug_concept_id AS BIGINT) * 1000 + @analysis_id AS covariate_id,
  c.concept_name                                                                  AS covariate_name,
  drug_concept_id                                                                 AS concept_id,
  COUNT(*)                                                                            AS sum_value,
  COUNT(*) * 1.0 / stat.total_cnt * 1.0                                   AS average_value
FROM (
       SELECT DISTINCT
         drug_concept_id,
         cohort.subject_id,
         cohort.cohort_start_date
       FROM @cohort_table cohort
         INNER JOIN @cdm_database_schema.drug_era ON cohort.subject_id = drug_era.person_id
       WHERE drug_era_start_date <= cohort.cohort_start_date
             AND drug_concept_id != 0
             AND cohort.cohort_definition_id = @cohort_id
     ) drug_entries
  JOIN @cdm_database_schema.concept c ON drug_entries.drug_concept_id = c.concept_id
  CROSS JOIN (SELECT COUNT(*) total_cnt
              FROM @cohort_table
              WHERE cohort_definition_id = @cohort_id) stat
GROUP BY drug_concept_id, c.concept_name, stat.total_cnt
        

Note the place holders of @cdm_database_schema and @cohort_table must be used in your own SQL in order for the program to properly replace the cohort and schemas in your local CDM.

2 Likes

Thank you!

Hi @Chris_Knoll ,

This was helpful. If I wanted to incorporate this feature, for example, into an estimation study that I downloaded from Atlas, how would I do this?

Thanks

If you used custom sql, then you can follow the instructions here.

Thatā€™s what Iā€™m doing, but I donā€™t know how to get the custom feature added to an estimation package. The package I downloaded from Atlas has all the analyses in cmAnalysisList.json and I want to add this new feature into it. In the package this line loads the analyses:

cmAnalysisList ā† CohortMethod::loadCmAnalysisList(cmAnalysisListFile)

and ten it calls:

results ā† CohortMethod::runCmAnalyses(ā€¦)

to run the analyses. Iā€™m not sure how I would add the covariateSettingsList
and subsequently call getDbCovariateData with runCmAnalyses.

I believe in the instructions I sent you, you can add additional elements to cmAnalysisList before you call runCmAnalyses.

Thatā€™s what I was thinking. Iā€™ll investigate to create an analysis and add the covariate setting to it.

t