Compile a Capr cohort to json

Compile a Capr Concept Set to json

# S4 method for Cohort
compile(object, ...)

# S4 method for ConceptSet
compile(object, ...)

Arguments

object

A Capr Concept Set created with `cs`

...

Arguments passed on to jsonlite::toJSON. e.g. `pretty = TRUE` for nicely formatted json.

Value

The json representation of Capr cohorts

The json representation of Capr cohorts

Examples

ch <- cohort(conditionOccurrence(cs(1,2, name = "concepts")))
compile(ch)
#> [1] "{\"ConceptSets\":[{\"id\":0,\"name\":\"concepts\",\"expression\":{\"items\":[{\"concept\":{\"CONCEPT_ID\":1,\"CONCEPT_NAME\":\"\",\"STANDARD_CONCEPT\":\"\",\"STANDARD_CONCEPT_CAPTION\":\"\",\"INVALID_REASON\":\"\",\"INVALID_REASON_CAPTION\":\"\",\"CONCEPT_CODE\":\"\",\"DOMAIN_ID\":\"\",\"VOCABULARY_ID\":\"\",\"CONCEPT_CLASS_ID\":\"\"},\"isExcluded\":false,\"includeDescendants\":false,\"includeMapped\":false},{\"concept\":{\"CONCEPT_ID\":2,\"CONCEPT_NAME\":\"\",\"STANDARD_CONCEPT\":\"\",\"STANDARD_CONCEPT_CAPTION\":\"\",\"INVALID_REASON\":\"\",\"INVALID_REASON_CAPTION\":\"\",\"CONCEPT_CODE\":\"\",\"DOMAIN_ID\":\"\",\"VOCABULARY_ID\":\"\",\"CONCEPT_CLASS_ID\":\"\"},\"isExcluded\":false,\"includeDescendants\":false,\"includeMapped\":false}]}}],\"PrimaryCriteria\":{\"CriteriaList\":[{\"ConditionOccurrence\":{\"CodesetId\":0}}],\"ObservationWindow\":{\"PriorDays\":0,\"PostDays\":0},\"PrimaryCriteriaLimit\":{\"Type\":\"First\"}},\"QualifiedLimit\":{\"Type\":\"First\"},\"ExpressionLimit\":{\"Type\":\"First\"},\"InclusionRules\":[],\"CensoringCriteria\":[],\"CollapseSettings\":{\"CollapseType\":\"ERA\",\"EraPad\":0},\"CensorWindow\":{},\"cdmVersionRange\":\">=5.0.0\"}"