| Type: | Package | 
| Title: | Construct Cohort Inclusion and Restriction Criteria Expressions | 
| Version: | 1.3.3 | 
| Date: | 2024-03-20 | 
| Maintainer: | Chris Knoll <cknoll@ohdsi.org> | 
| Description: | Wraps the 'CIRCE' (https://github.com/ohdsi/circe-be) 'Java' library allowing cohort definition expressions to be edited and converted to 'Markdown' or 'SQL'. | 
| License: | Apache License 2.0 | 
| URL: | https://ohdsi.github.io/CirceR/, https://github.com/OHDSI/CirceR/ | 
| BugReports: | https://github.com/OHDSI/CirceR/issues/ | 
| SystemRequirements: | Java (>= 8) | 
| Depends: | R (≥ 3.5.0) | 
| Imports: | rJava, RJSONIO | 
| Suggests: | testthat, knitr, rmarkdown | 
| NeedsCompilation: | no | 
| RoxygenNote: | 7.3.1 | 
| Language: | en-US | 
| Encoding: | UTF-8 | 
| Packaged: | 2024-04-18 16:42:02 UTC; cknoll1 | 
| Author: | Chris Knoll [aut, cre], Martijn Schuemie [aut] | 
| Repository: | CRAN | 
| Date/Publication: | 2024-04-18 19:42:49 UTC | 
CirceR: Construct Cohort Inclusion and Restriction Criteria Expressions
Description
Wraps the 'CIRCE' (https://github.com/ohdsi/circe-be) 'Java' library allowing cohort definition expressions to be edited, and converted to 'Markdown' or 'SQL'.
Author(s)
Maintainer: Chris Knoll cknoll@ohdsi.org
Authors:
Martijn Schuemie
See Also
Useful links:
Report bugs at https://github.com/OHDSI/CirceR/issues/
Build cohort SQL
Description
Generates the OMOP CDM Sql to generate the cohort expression
Usage
buildCohortQuery(expression, options)
Arguments
expression | 
 result of cohortExpressionFromJson containing the cohort expression.  | 
options | 
 The options built using createGenerateOptions()  | 
Value
A character vector containing the OHDSI Sql for the cohort expression
Build conceptset SQL
Description
Generates the OMOP CDM Sql to resolve the concept set expression
Usage
buildConceptSetQuery(conceptSetJSON)
Arguments
conceptSetJSON | 
 a string containing the JSON for the conceptset expression.  | 
Value
A character vector containing the OHDSI Sql for the conceptset expression
An example cohort definition
Description
An example cohort definition
Usage
data(cohortDefinitionJson)
Format
A character vector containing a JSON string
Details
An example cohort expression in JSON format
Render read JSON into a CohortExpression instance
Description
Reads a String (json) and deserializes it into a org.ohdsi.circe.cohortdefinition.CohortExpression
Usage
cohortExpressionFromJson(expressionJson)
Arguments
expressionJson | 
 A character vector containing the cohort expression.  | 
Value
A java instance of org.ohdsi.circe.cohortdefinition.CohortExpression.
Render cohort print-friendly
Description
Generates a print-friendly (human-readable) representation of the cohort definition. This can for example be used in a study protocol.
Usage
cohortPrintFriendly(expression)
Arguments
expression | 
 A character vector or result of cohortExpressionFromJson containing the cohort expression.  | 
Value
A character vector containing the markdown.
Render read JSON into a ConceptSetExpression instance
Description
Reads a String (json) and deserializes it into a org.ohdsi.circe.vocabulary.CohortExpression
Usage
conceptSetExpressionFromJson(expressionJson)
Arguments
expressionJson | 
 A character vector containing the cohort expression.  | 
Value
A java instance of org.ohdsi.circe.cohortdefinition.CohortExpression.
An example concept set
Description
An example concept set
Usage
data(conceptSetJson)
Format
A character vector containing a JSON string
Details
An example concept set in JSON format
An example concept set list
Description
An example concept set list
Usage
data(conceptSetListJson)
Format
A character vector containing a JSON string
Details
An example concept set list in JSON format
Render conceptSet array for print-friendly
Description
Generates a print-friendly (human-readable) representation of an array of concept sets. This can for example be used in a study protocol.
Usage
conceptSetListPrintFriendly(conceptSetList)
Arguments
conceptSetList | 
 A ConceptSet[] (from cohortExpression.conceptSets), a JSON string, or a list from RJSONIO::fromJson  | 
Value
A character vector containing the markdown.
Render conceptSet array for print-friendly
Description
Generates a print-friendly (human-readable) representation of a single concept set. This can for example be used in a study protocol.
Usage
conceptSetPrintFriendly(conceptSet)
Arguments
conceptSet | 
 A ConceptSet (from cohortExpression.conceptSets[i]), a JSON string, or a list from RJSONIO::fromJson  | 
Value
A character vector containing the markdown.
Create Generation Options
Description
Creates the generation options object for use in generateSql()
Usage
createGenerateOptions(
  cohortIdFieldName,
  cohortId,
  cdmSchema,
  targetTable,
  resultSchema,
  vocabularySchema,
  generateStats
)
Arguments
cohortIdFieldName | 
 The field that contains the cohortId in the cohort table.  | 
cohortId | 
 The generated cohort ID.  | 
cdmSchema | 
 The value of the CDM schema.  | 
targetTable | 
 the cohort table name.  | 
resultSchema | 
 the schema the cohort table belongs to.  | 
vocabularySchema | 
 the schema of the vocabulary tables (defaults to cdmSchema)  | 
generateStats | 
 a boolean representing if the query should include inclusion rule statistics calculation  | 
Value
A jObj that can be passed to generateSql().