/
GuidanceOnCohortDefinitionSetRObject.Rmd
53 lines (41 loc) · 1.78 KB
/
GuidanceOnCohortDefinitionSetRObject.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: "Guidance on Cohort Definition Set R Object"
author: "Gowtham A. Rao"
date: "`r Sys.Date()`"
output:
html_document:
number_sections: no
toc: no
pdf_document:
toc: no
vignette: >
%\VignetteIndexEntry{Guidance on Cohort Definition Set R Object}
%\VignetteEncoding{UTF-8}
%\VignetteEngine{knitr::rmarkdown}
---
```{r, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(
cache = FALSE,
comment = "#>",
error = FALSE,
tidy = FALSE
)
```
*This document is a DRAFT guidance.*
# How to Create a Cohort Definition Set Object
## Structure
### Downloading Cohorts from ATLAS
You can create cohorts using [ATLAS](https://github.com/OHDSI/Atlas) and extract them using the [ROhdsiWebApi](https://github.com/OHDSI/ROhdsiWebApi) package:
```{r eval = FALSE, echo=TRUE}
cohortIds <- c(1778211, 1778212, 1778213)
ROhdsiWebApi::authorizeWebApi(baseUrl = baseUrl, authMethod = "windows")
cohortDefinitionSet <- ROhdsiWebApi::exportCohortDefinitionSet(
baseUrl = baseUrl,
cohortIds = cohortIds
)
```
The code connects to ATLAS' WebAPI, retrieves the `cohortDefinitions`, and returns a data.frame object with the required fields. The following columns are considered mandatory for OHDSI submission:
- **cohortId**: The cohortId will be the same as the atlasId upon export from ATLAS. This column is provided in case you'd like to alter the numbering scheme for your cohort definition set.
- **cohortName**: The name of the cohort in ATLAS.
- **json**: The [Circe](https://github.com/OHDSI/circe-be) compliant JSON representation of the cohort definition.
When the cohort JSON is submitted, the PhenotypeLibrary will create the SQL using Circe. The submitted SQL will only be used when the cohort definitions do not conform to the circe/atlas cohort definition standard.