New Generate Button: you can now generate cohorts (after saving them first).
New database table: cohort_definition_info: contains information about the cohort generation (if it exists). Currently consists of isValid (false if there were errors), start time, duration, and status.
New Jobs: GenerateChort: will generate a cohort definition in a background task.
I created a test cohort definition called “Females with Hairy Cell Leukemia” and “Preterm Infant”. When I click the “Show SQL” button, the MSSQL and Postgres look identical and the Redshift SQL looks a lot like Postgres, but will not execute on a my local Postgres 9.2.
Glad you are trying it! As it turns out, I had the wrong dialect key for postgresql in the app. I’ve updated it and pushed it out. The temp tables are now being created with ‘Create TEMP table’ instead of leaving it as # for mssql. Thank you for catching this!
I’ve generated the sql but unfortunately I do not have a CDM to test the query on.
The other thing to note is that the generated SQL has @tokens left in the text that needs to be replaced. If you click the ‘add options’ button next to the Show SQL button, you will be provided with text boxes to input the replacement values. If you do that, you should get runnable sql right out of the gate.
The values are:
CDM Schema: this is prefixed in front of the cdm tables (for example @CDM_schema.CONCEPT). Set this value to the value of your cdm schema.
Target Schema: Not used! I need to take this out.
Target Table: The fully qualified table name that you want to write the cohort results to. soemthing like {schema}.{cohortTable}
Cohort Def Id: A number you want to assign to this cohort.
Note: when clicking on generate, it gets these values from the configuration of the WebAPI. The ShowSQL (and Options) are just for testing/preview purposes. Setting these values in ‘Add Options’ has no impact on what happens when you click ‘Generate’.
Yeah, in SqlRender we handle converting the MSSQL function ‘YEAR’ (ex;
YEAR(C.CONDITION_START_DATE) ), but we never had a use for the DATEPART
function so I don’t think it’s in there. We could just change it from
DATEPART to YEAR and it’ll work cross-platform.