OHDSI Home | Forums | Wiki | Github

Edit CovariateSettings within ATLAS-generated PLE package

Hello,

I am looking into adding custom covariates to a PLE study package generated in ATLAS. I have seen the directions here (Creating covariates using cohort attributes • FeatureExtraction), which reference editing the CovariateSettings section within FeatureExtraction. This seems relatively straightforward except I don’t see this section in any part of the ATLAS-generated study package. I am wondering then, is it possible?

Thank you!

Yes, this should be possible, but not straightforward. It takes two steps:

  1. If you’re going the route of using the covariate builder using cohort attributes you need to add code to the package that constructs and populates the cohort attributes table. (If, instead, you want to create a completely new custom covariate builder then that builder will need to be added to the package).

  2. Modify the analysis settings to include the custom covariate settings. ATLAS will have generated a settings file like this. You’ll need to edit that JSON to also reference the custom covariate builder.

For 2, you may want to leverage this function for creating the settings JSON file.

Hope this helps. In the future all of this should be much easier, when we allow cohort-based covariates.

Thank you! So for Step 1 would it be following these directions, starting with the sql step? Creating covariates using cohort attributes • FeatureExtraction

In Step 2, I also see the option to edit " “includedCovariateConceptIds”: []". Would it maybe be possible to simply add concept ids to this section to use as coviarates?

For the second step, you’ll need to create the JSON equivalent of the R code you’d use to create the covariate settings. Either you use only your new custom covariates, in which case you’ll need to use the createCohortAttrCovariateSettings() function, or you use both custom and default covariates, in which case you’ll need to combine them in a list as described here.

It is probably easiest to generate the (combined) settings in R, and then export to JSON using ParallelLogger::convertSettingsToJson(), then copy-paste that JSON into the overall settings.

Alternatively, you could edit the JSON directly by hand.

t