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] Cohort Definition Executes Successfully but Nothing Gets Generated #12

Closed
TheCedarPrince opened this issue Sep 4, 2024 · 2 comments

Comments

@TheCedarPrince
Copy link

I have the following cohort definition JSON:

Cohort Definition
{
  "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
Copy link
Author

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
Copy link
Author

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

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

1 participant