MechanicalRabbit / OHDSICohortExpressions.jl

reimplementation of OHDSI's Circe JSON->SQL compiler
Other
7 stars 1 forks source link

[BUG] Cohort Definition Executes Successfully but Nothing Gets Generated #12

Closed TheCedarPrince closed 2 weeks ago

TheCedarPrince commented 2 weeks ago

I have the following cohort definition JSON:

Cohort Definition ```json { "ConceptSets": [ { "id": 0, "name": "Diabetic on insulin", "expression": { "items": [ { "concept": { "CONCEPT_CLASS_ID": "Clinical Finding", "CONCEPT_CODE": "170747006", "CONCEPT_ID": 440922, "CONCEPT_NAME": "Diabetic on insulin", "DOMAIN_ID": "Observation", "INVALID_REASON": "V", "INVALID_REASON_CAPTION": "Valid", "STANDARD_CONCEPT": "S", "STANDARD_CONCEPT_CAPTION": "Standard", "VOCABULARY_ID": "SNOMED" } } ] } } ], "PrimaryCriteria": { "CriteriaList": [ { "ConditionOccurrence": {} }, { "Observation": {} } ], "ObservationWindow": { "PriorDays": 0, "PostDays": 0 }, "PrimaryCriteriaLimit": { "Type": "First" } }, "QualifiedLimit": { "Type": "First" }, "ExpressionLimit": { "Type": "First" }, "InclusionRules": [ { "name": "Diabetics on Insulin", "expression": { "Type": "ANY", "CriteriaList": [ { "Criteria": { "ConditionOccurrence": { "CodesetId": 0 } }, "StartWindow": { "Start": { "Coeff": -1 }, "End": { "Coeff": 1 }, "UseEventEnd": false }, "Occurrence": { "Type": 2, "Count": 1 } }, { "Criteria": { "Observation": { "CodesetId": 0 } }, "StartWindow": { "Start": { "Coeff": -1 }, "End": { "Coeff": 1 }, "UseEventEnd": false }, "Occurrence": { "Type": 2, "Count": 1 } } ], "DemographicCriteriaList": [], "Groups": [] } } ], "CensoringCriteria": [], "CollapseSettings": { "CollapseType": "ERA", "EraPad": 0 }, "CensorWindow": {}, "cdmVersionRange": ">=5.0.0" } ```

Which generates 3 patients in my database (correct for my small database) using CohortGenerator. However, when I run the same definition with OHDSICohortExpressions.jl, it executes successfully it appears but nothing is generated in my cohort. What is going wrong here? There are no errors thrown from the looks of it.

I am on FunSQL version 0.14.1 and OHDSICohortExpressions version 0.2.0.

TheCedarPrince commented 2 weeks ago

Wait, curiously, the result is not saved into the database anymore (i.e. cohort table) but rather only into a dataframe? Why is that? Is there a way to persist that generation to the database?

TheCedarPrince commented 2 weeks ago

Ah #4 and #3 just solved my questions. Thanks folks! Cheers and I'll be in touch!