Package 'CirceR'

Title: 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'.
Authors: Chris Knoll [aut, cre], Martijn Schuemie [aut]
Maintainer: Chris Knoll <[email protected]>
License: Apache License 2.0
Version: 1.3.3
Built: 2024-11-21 02:48:55 UTC
Source: https://github.com/ohdsi/circer

Help Index


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().