-
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.
Implement date offsets for Criteria queries. (#183)
- Loading branch information
1 parent
8f25631
commit 1bec254
Showing
71 changed files
with
3,582 additions
and
358 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Matches multiple files with brace expansion notation | ||
# Set default charset | ||
[*.{java,sql}] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,6 @@ | |
* | ||
* @author Chris Knoll <[email protected]> | ||
*/ | ||
|
||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = As.WRAPPER_OBJECT) | ||
@JsonSubTypes({ | ||
@JsonSubTypes.Type(value = ConditionEra.class, name = "ConditionEra"), | ||
|
@@ -49,13 +48,17 @@ | |
@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); | ||
|
||
@JsonProperty("CorrelatedCriteria") | ||
@JsonProperty("CorrelatedCriteria") | ||
public CriteriaGroup CorrelatedCriteria; | ||
|
||
|
||
@JsonProperty("DateAdjustment") | ||
public DateAdjustment dateAdjustment; | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/org/ohdsi/circe/cohortdefinition/DateAdjustment.java
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,43 @@ | ||
/* | ||
* Copyright 2022 cknoll1. | ||
* | ||
* 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. | ||
*/ | ||
package org.ohdsi.circe.cohortdefinition; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* | ||
* @author cknoll1 | ||
*/ | ||
public class DateAdjustment { | ||
|
||
public enum DateType { | ||
@JsonProperty("START_DATE") | ||
START_DATE, | ||
@JsonProperty("END_DATE") | ||
END_DATE | ||
}; | ||
|
||
@JsonProperty("StartWith") | ||
public DateType startWith = DateType.START_DATE; | ||
@JsonProperty("StartOffset") | ||
public int startOffset = 0; | ||
|
||
@JsonProperty("EndWith") | ||
public DateType endWith = DateType.END_DATE; | ||
@JsonProperty("EndOffset") | ||
public int endOffset = 0; | ||
|
||
} |
Oops, something went wrong.