OHDSI Home | Forums | Wiki | Github

PrimaryCriteria question circe-be software

I have used the java software circe-be to create the json string and upload it into Atlas (Cohort Definitions --> Export -->JSON) However something like text below will not work because the PrimaryCriteria includes the part of CorrelatedCriteria as in the example. It will work adding the same to AdditionalCriteria. This is just an example and the part in bold face does not really upload in Atlas. However, according to the software the PrimaryCriteria has a Criteria[] array and each Criteria may have a CriteriaGroup which name is CorrelatedCriteria. I can add the Critera given a class like ConditionOccurrence and all inside Criteria class ConditionOccurrence works, but not the CriteriaGroup part of it. I can certainly add it to AdditionalCriteria as below but I was wondering why it does not upload
{
“Title” : “734 Fla-10-17 y@15:46:41”,
“PrimaryCriteria” : {
“CriteriaList” : [ {
“ConditionOccurrence” : {
"CorrelatedCriteria" : {
"CriteriaList" : [ {
"RestrictVisit" : true,
"IgnoreObservationPeriod" : false,
"Occurrence" : {
"Type" : 2,
"Count" : 1,
"IsDistinct" : true
}
} ],
"DemographicCriteriaList" : [ ],
"Groups" : [ ]
},
“CodesetId” : 1,
“ConditionTypeExclude” : true
}
} ],
“ObservationWindow” : {
“PriorDays” : 0,
“PostDays” : 0
},
“PrimaryCriteriaLimit” : {
“Type” : “First”
}
},
“AdditionalCriteria” : {
“Type” : “ALL”,
“CriteriaList” : [ ],
“DemographicCriteriaList” : [ ],
“Groups” : [ {
“Type” : “ANY”,
“CriteriaList” : [ {
“Criteria” : {
“ConditionOccurrence” : {
“CodesetId” : 1,
“ConditionTypeExclude” : true,
“Age” : {
“Value” : 10,
“Op” : “bt”,
“Extent” : 17
}
}
},
“StartWindow” : {
“Start” : {
“Coeff” : -1
},
“End” : {
“Coeff” : 1
},
“UseIndexEnd” : false
},
“RestrictVisit” : true,
“IgnoreObservationPeriod” : false
}, {
“Criteria” : {
“ConditionOccurrence” : {
“CodesetId” : 1,
“ConditionTypeExclude” : true,
“Age” : {
“Value” : 18,
“Op” : “bt”,
“Extent” : 34
}
}
},
“StartWindow” : {
“Start” : {
“Coeff” : -1
},
“End” : {
“Coeff” : 1
},
“UseIndexEnd” : false
},
“RestrictVisit” : true,
“IgnoreObservationPeriod” : false
}, {
“Criteria” : {
“ConditionOccurrence” : {
“CodesetId” : 1,
“ConditionTypeExclude” : true,
“Age” : {
“Value” : 35,
“Op” : “bt”,
“Extent” : 44
}
}
},
“StartWindow” : {
“Start” : {
“Coeff” : -1
},
“End” : {
“Coeff” : 1
},
“UseIndexEnd” : false
},
“RestrictVisit” : true,
“IgnoreObservationPeriod” : false
}, {
“Criteria” : {
“ConditionOccurrence” : {
“CodesetId” : 1,
“ConditionTypeExclude” : true,
“Age” : {
“Value” : 55,
“Op” : “bt”,
“Extent” : 64
}
}
},
“StartWindow” : {
“Start” : {
“Coeff” : -1
},
“End” : {
“Coeff” : 1
},
“UseIndexEnd” : false
},
“RestrictVisit” : true,
“IgnoreObservationPeriod” : false
} ],
“DemographicCriteriaList” : [ ],
“Groups” : [ ]
} ]
},
“ConceptSets” : [ {
“id” : 1,
“name” : “734 Flat foot”,
“expression” : {
“items” : [ {
“concept” : {
“CONCEPT_ID” : 437969,
“CONCEPT_NAME” : “ICD9CM:734”,
“STANDARD_CONCEPT” : “N”,
“STANDARD_CONCEPT_CAPTION” : “Non-Standard”,
“INVALID_REASON” : “V”,
“INVALID_REASON_CAPTION” : “Valid”,
“CONCEPT_CODE” : “734”,
“DOMAIN_ID” : “Condition”,
“VOCABULARY_ID” : “ICD9CM”,
“CONCEPT_CLASS_ID” : “3-dig billing code”
},
“isExcluded” : false,
“includeDescendants” : false,
“includeMapped” : false
} ]
}
} ],
“QualifiedLimit” : {
“Type” : “First”
},
“ExpressionLimit” : {
“Type” : “First”
},
“InclusionRules” : [ ],
“CollapseSettings” : {
“CollapseType” : “ERA”,
“EraPad” : 0
}
}

I made this simple example in the ohdsi atlas enviornment, and it did import properly:

{
  "ConceptSets": [
    {
      "id": 0,
      "name": "Test",
      "expression": {
        "items": []
      }
    }
  ],
  "PrimaryCriteria": {
    "CriteriaList": [
      {
        "ConditionOccurrence": {
          "CorrelatedCriteria": {
            "Type": "ALL",
            "CriteriaList": [
              {
                "Criteria": {
                  "ConditionOccurrence": {
                    "CodesetId": 0
                  }
                },
                "StartWindow": {
                  "Start": {
                    "Days": 30,
                    "Coeff": -1
                  },
                  "End": {
                    "Days": 1,
                    "Coeff": -1
                  },
                  "UseEventEnd": false
                },
                "RestrictVisit": true,
                "Occurrence": {
                  "IsDistinct": true,
                  "Type": 2,
                  "Count": 1
                }
              }
            ],
            "DemographicCriteriaList": [],
            "Groups": []
          },
          "CodesetId": 0
        }
      }
    ],
    "ObservationWindow": {
      "PriorDays": 0,
      "PostDays": 0
    },
    "PrimaryCriteriaLimit": {
      "Type": "First"
    }
  },
  "QualifiedLimit": {
    "Type": "First"
  },
  "ExpressionLimit": {
    "Type": "First"
  },
  "InclusionRules": [],
  "CensoringCriteria": [],
  "CollapseSettings": {
    "CollapseType": "ERA",
    "EraPad": 0
  },
  "CensorWindow": {}
}

I think the problem is that your inner criteria isn’t wrapped properly. This is what your innter criteria (of correlated criteria) should look like:

          "CorrelatedCriteria": {
            "Type": "ALL",
            "CriteriaList": [
              {
                "Criteria": {
                  "ConditionOccurrence": {
                    "CodesetId": 0
                  }
                },
                "StartWindow": {
                  "Start": {
                    "Days": 30,
                    "Coeff": -1
                  },
                  "End": {
                    "Days": 1,
                    "Coeff": -1
                  },
                  "UseEventEnd": false
                },
                "RestrictVisit": true,
                "Occurrence": {
                  "IsDistinct": true,
                  "Type": 2,
                  "Count": 1
                }
              }
            ],
            "DemographicCriteriaList": [],
            "Groups": []
          }

Note, each element in the CriteriaList array contains a Criteria element (the domain criteria wrapper), StartWindow, RestrictVisit and Occurrence. Your highlighted part of the expression has the Criteria List, but it doesn’t have a ‘Criteria’ element.

t