-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced reference to cohort_inclusion with temp table when doing inc…
…lusion rule analysis. Also fixed issue with censor window. Fixes #153.
- Loading branch information
1 parent
7d69686
commit e753b00
Showing
10 changed files
with
289 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/main/resources/resources/cohortdefinition/sql/cohortCensoredStats.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/resources/resources/cohortdefinition/sql/inclusionRuleTempTable.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis | ||
|
||
select cast(rule_sequence as int) as rule_sequence | ||
into #inclusion_rules | ||
from ( | ||
@inclusionRuleUnions | ||
) IR; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
src/test/resources/cohortgeneration/inclusionRules/simpleInclusionRule.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{ | ||
"ConceptSets": [ | ||
{ | ||
"id": 0, | ||
"name": "Entry Concept Set", | ||
"expression": { | ||
"items": [ | ||
{ | ||
"concept": { | ||
"CONCEPT_CLASS_ID": "Clinical Finding", | ||
"CONCEPT_CODE": "C1P1", | ||
"CONCEPT_ID": 2, | ||
"CONCEPT_NAME": "Child 1 [Parent: 1]", | ||
"DOMAIN_ID": "CONDITION", | ||
"INVALID_REASON": "V", | ||
"INVALID_REASON_CAPTION": "Valid", | ||
"STANDARD_CONCEPT": "S", | ||
"STANDARD_CONCEPT_CAPTION": "Standard", | ||
"VOCABULARY_ID": "TestVocab" | ||
}, | ||
"includeDescendants": true | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"id": 1, | ||
"name": "Inclusion Concept Set", | ||
"expression": { | ||
"items": [ | ||
{ | ||
"concept": { | ||
"CONCEPT_CLASS_ID": "Clinical Finding", | ||
"CONCEPT_CODE": "C2P1", | ||
"CONCEPT_ID": 3, | ||
"CONCEPT_NAME": "Child 2 [Parent: 1]", | ||
"DOMAIN_ID": "CONDITION", | ||
"INVALID_REASON": "V", | ||
"INVALID_REASON_CAPTION": "Valid", | ||
"STANDARD_CONCEPT": "S", | ||
"STANDARD_CONCEPT_CAPTION": "Standard", | ||
"VOCABULARY_ID": "TestVocab" | ||
}, | ||
"includeDescendants": true | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"PrimaryCriteria": { | ||
"CriteriaList": [ | ||
{ | ||
"ConditionOccurrence": { | ||
"CodesetId": 0 | ||
} | ||
} | ||
], | ||
"ObservationWindow": { | ||
"PriorDays": 0, | ||
"PostDays": 0 | ||
}, | ||
"PrimaryCriteriaLimit": { | ||
"Type": "First" | ||
} | ||
}, | ||
"QualifiedLimit": { | ||
"Type": "First" | ||
}, | ||
"ExpressionLimit": { | ||
"Type": "First" | ||
}, | ||
"InclusionRules": [ | ||
{ | ||
"name": "Prior Condition", | ||
"expression": { | ||
"Type": "ALL", | ||
"CriteriaList": [ | ||
{ | ||
"Criteria": { | ||
"ConditionOccurrence": { | ||
"CodesetId": 1 | ||
} | ||
}, | ||
"StartWindow": { | ||
"Start": { | ||
"Coeff": -1 | ||
}, | ||
"End": { | ||
"Days": 1, | ||
"Coeff": -1 | ||
}, | ||
"UseEventEnd": false | ||
}, | ||
"Occurrence": { | ||
"Type": 2, | ||
"Count": 1 | ||
} | ||
} | ||
], | ||
"DemographicCriteriaList": [], | ||
"Groups": [] | ||
} | ||
} | ||
], | ||
"CensoringCriteria": [], | ||
"CollapseSettings": { | ||
"CollapseType": "ERA", | ||
"EraPad": 0 | ||
}, | ||
"CensorWindow": {} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/test/resources/cohortgeneration/inclusionRules/simpleInclusionRule_PREP.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"cdm.person": [ | ||
{ | ||
"person_id":1, | ||
"gender_concept_id":0, | ||
"year_of_birth":0, | ||
"race_concept_id":0, | ||
"ethnicity_concept_id":0 | ||
}, | ||
{ | ||
"person_id":2, | ||
"gender_concept_id":0, | ||
"year_of_birth":0, | ||
"race_concept_id":0, | ||
"ethnicity_concept_id":0 | ||
} | ||
], | ||
"cdm.condition_occurrence": [ | ||
{ | ||
"condition_occurrence_id": 1, | ||
"person_id":1, | ||
"condition_concept_id":2, | ||
"condition_start_date":"2000-06-01", | ||
"condition_type_concept_id":0 | ||
}, | ||
{ | ||
"condition_occurrence_id": 2, | ||
"person_id":1, | ||
"condition_concept_id":3, | ||
"condition_start_date":"2000-01-01", | ||
"condition_type_concept_id":0 | ||
}, | ||
{ | ||
"condition_occurrence_id": 3, | ||
"person_id":2, | ||
"condition_concept_id":2, | ||
"condition_start_date":"2000-01-01", | ||
"condition_type_concept_id":0 | ||
} | ||
], | ||
"cdm.observation_period" : [ | ||
{ | ||
"observation_period_id": 1, | ||
"person_id":1, | ||
"observation_period_start_date":"2000-01-01", | ||
"observation_period_end_date":"2001-01-01", | ||
"period_type_concept_id": 0 | ||
}, | ||
{ | ||
"observation_period_id": 2, | ||
"person_id":2, | ||
"observation_period_start_date":"2000-01-01", | ||
"observation_period_end_date":"2001-01-01", | ||
"period_type_concept_id": 0 | ||
} | ||
] | ||
} |
Oops, something went wrong.