-
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.
Showing
9 changed files
with
54 additions
and
60 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
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 |
---|---|---|
|
@@ -18,14 +18,12 @@ | |
*/ | ||
package org.ohdsi.circe.cohortdefinition; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* | ||
* @author Chris Knoll <[email protected]> | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class CustomEraStrategy extends EndStrategy { | ||
|
||
@JsonProperty("DrugCodesetId") | ||
|
@@ -34,19 +32,17 @@ public class CustomEraStrategy extends EndStrategy { | |
@JsonProperty("GapDays") | ||
public int gapDays = 0; | ||
@JsonProperty("GapUnit") | ||
public String gapUnit = IntervalUnit.DAY.getName();; | ||
public String gapUnit = "day"; | ||
@JsonProperty("GapUnitValue") | ||
public Integer gapUnitValue = null; | ||
public int gapUnitValue = 0; | ||
|
||
@JsonProperty("Offset") | ||
public int offset = 0; | ||
@JsonProperty("OffsetUnit") | ||
public String offsetUnit = IntervalUnit.DAY.getName();; | ||
public String offsetUnit = "day"; | ||
@JsonProperty("OffsetUnitValue") | ||
public int offsetUnitValue = 0; | ||
|
||
|
||
|
||
@JsonProperty("DaysSupplyOverride") | ||
public Integer daysSupplyOverride = null; | ||
|
||
|
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: 5 additions & 2 deletions
7
src/main/resources/resources/cohortdefinition/sql/dateOffsetStrategy.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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
-- date offset strategy | ||
|
||
select event_id, person_id, | ||
case when DATEADD(@offsetUnit,@offsetUnitValue,@dateField) > op_end_date then op_end_date else DATEADD(@offsetUnit,@offsetUnitValue,@dateField) end as end_date | ||
select event_id, | ||
person_id, | ||
case | ||
when DATEADD(@offsetUnit, @offsetUnitValue, @dateField) > op_end_date then op_end_date | ||
else DATEADD(@offsetUnit, @offsetUnitValue, @dateField) end as end_date | ||
INTO #strategy_ends | ||
from @eventTable; |
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