Comments (5)
I was able to parse this into JSON as follows
cdJson <- RJSONIO::toJSON(x = list(cd))
cdJSon <- RJSONIO::fromJSON(content = cdJson)[[1]]
cdJSon <- RJSONIO::toJSON(x = cdJSon, pretty = TRUE)
from capr.
The JSON is below - but it cannot be imported into ATLAs
{
"CohortDetails" : {
"Name" : "Testing Cohort",
"Description" : "Description for Testing Cohort",
"Author" : null,
"cdmVersionRange" : ">=5.0.0"
},
"PrimaryCriteria" : {
"MetaData" : {
"ComponentClass" : "PrimaryCriteria",
"Name" : "Concept Set Condition Occurrence",
"Description" : null
},
"CriteriaExpression" : {
"CriteriaList" : [
{
"Domain" : "ConditionOccurrence",
"CodesetId" : "47ada7d4-56e6-4cdc-909a-91694b48eec8",
"Attributes" : [
{
"Name" : "Age",
"Op" : "lt",
"Contents" : {
"Value" : 10,
"Extent" : null
}
}
]
}
],
"ObservationWindow" : {
"PriorDays" : 0,
"PostDays" : 0
}
},
"Limit" : {
"PrimaryCriteriaLimit" : {
"Type" : "All"
}
},
"ConceptSetExpression" : [
{
"id" : "47ada7d4-56e6-4cdc-909a-91694b48eec8",
"Name" : "Diabetes Melltius",
"Expression" : [
{
"Concept" : {
"CONCEPT_ID" : 201820,
"CONCEPT_NAME" : "Diabetes mellitus",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "73211009",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4008576,
"CONCEPT_NAME" : "Diabetes mellitus without complication",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "111552007",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4058243,
"CONCEPT_NAME" : "Diabetes mellitus during pregnancy, childbirth and the puerperium",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "199223000",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 192691,
"CONCEPT_NAME" : "Diabetes mellitus during pregnancy - baby not yet delivered",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "199227004",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4144583,
"CONCEPT_NAME" : "Diabetes mellitus due to cystic fibrosis",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "427089005",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4192852,
"CONCEPT_NAME" : "Diabetes mellitus due to insulin receptor antibodies",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "75682002",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4240589,
"CONCEPT_NAME" : "Diabetes mellitus associated with hormonal etiology",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "59079001",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4136889,
"CONCEPT_NAME" : "Diabetes mellitus induced by non-steroid drugs without complication",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "413183008",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4079850,
"CONCEPT_NAME" : "Diabetes mellitus in neonate small for gestational age",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "276560009",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4.575747e+07,
"CONCEPT_NAME" : "Diabetes mellitus type 2 without retinopathy",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "1481000119100",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4237068,
"CONCEPT_NAME" : "Diabetes mellitus due to structurally abnormal insulin",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "91352004",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4245270,
"CONCEPT_NAME" : "Diabetes mellitus associated with genetic syndrome",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "5969009",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4178452,
"CONCEPT_NAME" : "Diabetes mellitus associated with pancreatic disease",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "51002006",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4129516,
"CONCEPT_NAME" : "Diabetes-deafness syndrome maternally transmitted",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "237619009",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4322638,
"CONCEPT_NAME" : "Diabetes mellitus AND insipidus with optic atrophy AND deafness",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "70694009",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4235410,
"CONCEPT_NAME" : "Diabetes mellitus induced by non-steroid drugs",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "408540003",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4.575708e+07,
"CONCEPT_NAME" : "Diabetes mellitus due to pancreatic injury",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "105401000119101",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4143529,
"CONCEPT_NAME" : "Diabetes mellitus associated with cystic fibrosis",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "426705001",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4.576605e+07,
"CONCEPT_NAME" : "Diabetes mellitus in remission",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "703136005",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4.575767e+07,
"CONCEPT_NAME" : "Diabetes mellitus type 1 without retinopathy",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "31321000119102",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 3.668483e+07,
"CONCEPT_NAME" : "Diabetes mellitus type 2 with periodontal disease",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "368101000119109",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4.253768e+07,
"CONCEPT_NAME" : "Diabetes mellitus caused by chemical",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "737212004",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4.076934e+07,
"CONCEPT_NAME" : "History of Diabetes (regardless of treatment) [PhenX]",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "66678-4",
"DOMAIN_ID" : "Observation",
"VOCABULARY_ID" : "LOINC",
"CONCEPT_CLASS_ID" : "Clinical Observation"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4.353102e+07,
"CONCEPT_NAME" : "Diabetes mellitus, transient neonatal 2",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "609580007",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
},
{
"Concept" : {
"CONCEPT_ID" : 4.479311e+07,
"CONCEPT_NAME" : "Diabetes mellitus with multiple complications",
"STANDARD_CONCEPT" : "S",
"STANDARD_CONCEPT_CAPTION" : "Standard",
"INVALID_REASON" : "V",
"INVALID_REASON_CAPTION" : "Valid",
"CONCEPT_CODE" : "385041000000108",
"DOMAIN_ID" : "Condition",
"VOCABULARY_ID" : "SNOMED",
"CONCEPT_CLASS_ID" : "Clinical Finding"
},
"isExcluded" : false,
"includeDescendants" : true,
"includeMapped" : false
}
]
}
]
},
"AdditionalCriteria" : {
"MetaData" : {
"ComponentClass" : "Empty",
"Name" : null,
"Description" : null
},
"CriteriaExpression" : [],
"Limit" : [],
"ConceptSetExpression" : []
},
"InclusionRules" : {
"MetaData" : {
"ComponentClass" : "InclusionRules",
"Name" : "Inclusion Rules",
"Description" : null
},
"CriteriaExpression" : [],
"Limit" : {
"ExpressionLimit" : {
"Type" : "First"
}
},
"ConceptSetExpression" : []
},
"EndStrategy" : {
"MetaData" : {
"ComponentClass" : "EndStrategy",
"Name" : "End Strategy Date Offset",
"Description" : null
},
"CriteriaExpression" : [
{
"DateField" : "EndDate",
"Offset" : 0
}
],
"Limit" : [],
"ConceptSetExpression" : []
},
"CensoringCriteria" : {
"MetaData" : {
"ComponentClass" : "Empty",
"Name" : null,
"Description" : null
},
"CriteriaExpression" : [],
"Limit" : [],
"ConceptSetExpression" : []
},
"CohortEra" : {
"MetaData" : {
"ComponentClass" : "CohortEra",
"Name" : "Cohort Era Details",
"Description" : null
},
"CriteriaExpression" : {
"CollapseSettings" : {
"CollapseType" : "ERA",
"EraPad" : 1
},
"CensorWindow" : {
"StartDate" : null,
"EndDate" : null
}
},
"Limit" : [],
"ConceptSetExpression" : []
}
}
from capr.
from capr.
@gowthamrao Sorry for the delayed response. When you create the cohort definition use Capr::createCohortDefinition
this generates the R object version of the cohort definition. In order to get into the ATLAS version of the cohort you need to compile it into the Circe structure. In the vignette go to the next chunk you will see commands that compile the R object into a circe json and ohdisql structure. Capr::compileCohortDefinition(cd,genOps)
. The genOps object in this call is made from CirceR::createGenerateOptions
. Let me know if this is still an issue. Code block below:
cd <- Capr::createCohortDefinition( Name = "Testing Cohort", Description = desc, PrimaryCriteria = pc, InclusionRules = irs, EndStrategy = es, CohortEra = cohortEra)
genOp <- CirceR::createGenerateOptions(cohortIdFieldName = "cohort_definition_id", cohortId = 9999, cdmSchema = connectionDetails$schema, targetTable = "cohort", resultSchema = "results", vocabularySchema = connectionDetails$schema, generateStats = F)
#compile the cohort definition to create json and ohdisql
cohortInfo <- compileCohortDefinition(cd, genOp)
#if no errors preview the json and ohdisql
cat(cohortInfo$circeJson)
cat(cohortInfo$cohortRead)
cat(cohortInfo$ohdiSQL)
from capr.
This issue should be resolved. Also fixed a bug when compiling cohort definitions without additional criteria or inclusion rules. Can reopen if issue persists
from capr.
Related Issues (20)
- Setting observational start date for cohort HOT 4
- Typos using "-" instead of "-" in some documentation HOT 1
- Is there Capr support for Health Economics Data Tables HOT 4
- Support updates to Circe v1.11.0 HOT 5
- Add ability to generate `CohortGenerator` input tables HOT 4
- Possible bug in Example vignette code for applying inclusion criteria HOT 2
- Example (or tips) for using age() in defining a cohort within atttrition()? HOT 5
- R6 v S3/S4 in HADES HOT 4
- Released version failing R Check HOT 2
- Tips for using calendar date range requirement in defining entry (or attrition)? HOT 3
- Add Device exposure as an entry option HOT 1
- Are examples for unit() out of date due to a breaking change? HOT 1
- how to retrieve conceptid HOT 1
- How do I specify a date range? HOT 6
- Allow numeric as `offsetDays` HOT 2
- as.json not able to convert cohort HOT 1
- Add observation period criteria
- Add typeConceptIds as attributes to all domain criteria HOT 3
- Error when trying to specify unit for measurement HOT 3
- Error when calling cs function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capr.