Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] OHDSICohortExpressions not Yielding Cohort While CirceR Does #3

Closed
TheCedarPrince opened this issue Feb 14, 2022 · 5 comments
Closed

Comments

@TheCedarPrince
Copy link

Hi @xitology ,

I was using OHDSICohortExpressions the other day and ran into a strange issue concerning the creation of a cohort.
When using the following Cohort Definition, I do not get an expected returned Cohort on my OMOP database.
Yet, when I use the same definition in CirceR and CohortGenerator, I do get people matched to my cohort.
There seems to be some kind of bug here but I do not know what else to report.
Thank you!

Here is my code:

using DBInterface
using LibPQ
using OHDSICohortExpressions: translate, Model

cohort = read("depression_total.json", String)

model = Model(
    cdm_version = v"5.3.1",
    cdm_schema = "test",
    vocabulary_schema = "test",
    results_schema = "test",
    target_schema = "test",
    target_table = "my_cohort_table",
);

tsql = translate(cohort, dialect = :postgresql, model = model, cohort_definition_id = 1);

LibPQ.execute(conn, tsql)
Cohort Definition
{
"ConceptSets": [
  {
    "id": 3,
    "name": "[JZ] Depression",
    "expression": {
      "items": [
        {
          "concept": {
            "CONCEPT_CLASS_ID": "Clinical Finding",
            "CONCEPT_CODE": "35489007",
            "CONCEPT_ID": 440383,
            "CONCEPT_NAME": "Depressive disorder",
            "DOMAIN_ID": "Condition",
            "INVALID_REASON": "V",
            "INVALID_REASON_CAPTION": "Valid",
            "STANDARD_CONCEPT": "S",
            "STANDARD_CONCEPT_CAPTION": "Standard",
            "VOCABULARY_ID": "SNOMED"
          },
          "includeDescendants": true
        }
      ]
    }
  }
],
"PrimaryCriteria": {
  "CriteriaList": [
    {
      "ConditionOccurrence": {
        "CodesetId": 3
      }
    }
  ],
  "ObservationWindow": {
    "PriorDays": 365,
    "PostDays": 0
  },
  "PrimaryCriteriaLimit": {
    "Type": "First"
  }
},
"AdditionalCriteria": {
  "Type": "ANY",
  "CriteriaList": [],
  "DemographicCriteriaList": [],
  "Groups": []
},
"QualifiedLimit": {
  "Type": "First"
},
"ExpressionLimit": {
  "Type": "First"
},
"InclusionRules": [],
"CensoringCriteria": [],
"CollapseSettings": {
  "CollapseType": "ERA",
  "EraPad": 0
},
"CensorWindow": {},
"cdmVersionRange": ">=5.0.0"
}
@TheCedarPrince
Copy link
Author

Maybe it has something to do with the cdm_version variable?

@xitology
Copy link
Member

This should be fixed in cdba885.

@xitology
Copy link
Member

The fix is included to the new release v0.1.4.

@clarkevans
Copy link
Contributor

@TheCedarPrince -- would you verify this is complete with v0.2 and if it works as expected, close this ticket?

@TheCedarPrince
Copy link
Author

Yes, this is fixed now. Thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants