-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathCriteria.java
More file actions
92 lines (79 loc) · 3.6 KB
/
Copy pathCriteria.java
File metadata and controls
92 lines (79 loc) · 3.6 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
*
* Copyright 2017 Observational Health Data Sciences and Informatics
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Authors: Christopher Knoll
*
*/
package org.ohdsi.circe.cohortdefinition;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.ohdsi.circe.cohortdefinition.builders.BuilderOptions;
import org.ohdsi.circe.cohortdefinition.builders.ColumnFieldData;
import org.ohdsi.circe.cohortdefinition.builders.ColumnFieldDataType;
/**
*
* @author Chris Knoll <cknoll@ohdsi.org>
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value = ConditionEra.class, name = "ConditionEra"),
@JsonSubTypes.Type(value = ConditionOccurrence.class, name = "ConditionOccurrence"),
@JsonSubTypes.Type(value = Death.class, name = "Death"),
@JsonSubTypes.Type(value = DeviceExposure.class, name = "DeviceExposure"),
@JsonSubTypes.Type(value = DoseEra.class, name = "DoseEra"),
@JsonSubTypes.Type(value = DrugEra.class, name = "DrugEra"),
@JsonSubTypes.Type(value = DrugExposure.class, name = "DrugExposure"),
@JsonSubTypes.Type(value = LocationRegion.class, name = "LocationRegion"),
@JsonSubTypes.Type(value = Measurement.class, name = "Measurement"),
@JsonSubTypes.Type(value = Observation.class, name = "Observation"),
@JsonSubTypes.Type(value = ObservationPeriod.class, name = "ObservationPeriod"),
@JsonSubTypes.Type(value = ProcedureOccurrence.class, name = "ProcedureOccurrence"),
@JsonSubTypes.Type(value = Specimen.class, name = "Specimen"),
@JsonSubTypes.Type(value = VisitOccurrence.class, name = "VisitOccurrence"),
@JsonSubTypes.Type(value = VisitDetail.class, name = "VisitDetail"),
@JsonSubTypes.Type(value = PayerPlanPeriod.class, name = "PayerPlanPeriod")
})
public abstract class Criteria {
public String accept(IGetCriteriaSqlDispatcher dispatcher) {
return this.accept(dispatcher, null);
}
public abstract String accept(IGetCriteriaSqlDispatcher dispatcher, BuilderOptions options);
public List<ColumnFieldData> getSelectedField(Boolean retainCohortCovariates) {
return new ArrayList<>();
}
public String embedWindowedCriteriaQuery(String query, Map<String, ColumnFieldData> mapDistinctField) {
query = StringUtils.replace(query, "@additionColumnscc", "");
return query;
}
public String embedWindowedCriteriaQueryP(String query) {
query = StringUtils.replace(query, "@p.additionColumns", "");
return query;
}
public String embedWrapCriteriaQuery(String query, List<String> selectColsPE, BuilderOptions options) {
query = StringUtils.replace(query, "@QAdditionalColumnsInclusionN", "");
return query;
}
@JsonProperty("CorrelatedCriteria")
public CriteriaGroup CorrelatedCriteria;
@JsonProperty("DateAdjustment")
public DateAdjustment dateAdjustment;
}