-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from clanghout/examples
Examples
- Loading branch information
Showing
21 changed files
with
282 additions
and
0 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,6 @@ | ||
def groupByDay : GroupByColumn = NAME timesMeasured | ||
ON admire2txt.date | ||
FROM | ||
COUNT(admire2txt.date) AS number_of_measures; | ||
|
||
from(admire2txt)|groupBy(groupByDay) |
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,18 @@ | ||
def joinMult : Join = JOIN timesMeasured WITH | ||
filtered AS multipleMeasures | ||
ON timesMeasured.Chunk = filtered.Date | ||
AND timesMeasured.number > 1; | ||
|
||
def joinMultAdmire : Join = JOIN multipleMeasures WITH | ||
admire2txt AS multipleMeasuresSensor | ||
ON multipleMeasures.Chunk = admire2txt.date ; | ||
|
||
def comp : Computation = NAME multipleShort | ||
NEW SET COLUMNS | ||
multipleMeasuresSensor.multipleMeasures_Value AS ValueWeb, | ||
multipleMeasuresSensor.admire2txt_Value AS ValueAdmire, | ||
multipleMeasuresSensor.Chunk AS Date, | ||
multipleMeasuresSensor.number AS Number; | ||
|
||
join(joinMult) | join(joinMultAdmire) | | ||
from(multipleMeasuresSensor) | computation(comp) |
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,17 @@ | ||
def measured : Constraint = filteredweb.CustomMeasurementId = 415; | ||
def remeasure : Constraint = | ||
filtered.KreatinineAlgorithmActionId = "1"; | ||
def done : Constraint = remeasure.Date = second.Date; | ||
def group : GroupByConstraint = NAME remeasureAmount ON | ||
HAS_CODE("Done") AS Done, | ||
HAS_CODE("NotDone") AS NotDone | ||
FROM COUNT(remeasure.Moment) AS Count; | ||
|
||
|
||
from(filteredweb) | constraint(measured)|is(second) | | ||
from(filtered) | constraint(remeasure) | is(remeasure) | | ||
from(remeasure, second) | constraint(done) | | ||
|
||
is(remeasure, temp) | setCode("Done", remeasure) | | ||
difference(remeasure, temp) | setCode("NotDone", remeasure) | | ||
groupBy(group) |
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,2 @@ | ||
def con : Constraint = filteredweb.CreatedDate BEFORE filteredweb.ModifiedDate; | ||
from(filteredweb)|constraint(con)|is(updated) |
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,19 @@ | ||
def filterUser : Constraint = "admire56" = websitexlsx.Login; | ||
|
||
def con : Constraint = | ||
filteredweb56.KreatinineAlgorithmDayRatingId = "5"; | ||
|
||
def filter : Constraint = | ||
filteredweb56.KreatinineAlgorithmDayRatingId = "4" OR | ||
filteredweb56.KreatinineAlgorithmDayRatingId = "3"; | ||
|
||
def hosp : Constraint = | ||
filteredweb56.KreatinineAlgorithmDayRatingId = "4" AND | ||
RELATIVE(temp.Date, filteredweb56.Date, DAYS) = 1; | ||
|
||
from(websitexlsx) | constraint(filterUser) | | ||
is(filteredweb56) | | ||
from(filteredweb56) | constraint(con) | is(hosp1) | | ||
from(filteredweb56) | constraint(filter) | is(temp) | | ||
from(filteredweb56, temp) | constraint(hosp) | ||
| is(filteredweb56, hosp2) | union(hosp1, hosp2) | is(hospital) |
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,18 @@ | ||
def comp : Computation = NAME temp INCLUDE EXISTING SET COLUMNS | ||
MIN(filtered.Date) AS min; | ||
|
||
def filter : Constraint = | ||
RELATIVE(temp.min, temp.Date, DAYS) > 21 AND | ||
RELATIVE(temp.min, temp.Date, DAYS) < 64; | ||
|
||
def normal : Constraint = | ||
RELATIVE(temp.Date, temp2.Date, DAYS) = 2; | ||
def toOften : Constraint = | ||
RELATIVE(temp.Date, temp2.Date, DAYS) = 1; | ||
|
||
from(filtered) | computation(comp) | | ||
from(temp) | constraint(filter) | is(temp) | is(temp2) | | ||
from(temp, temp2) | constraint(normal) | is(temp, normal) | | ||
from(temp, temp2) | constraint(toOften) | is(temp, temp3) | | ||
difference(normal, temp3) | is(normal) | | ||
from(temp) | sort(temp.Date, "ASC") | from(normal) | setCode("normal", temp) |
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,22 @@ | ||
def comp : Computation = NAME temp INCLUDE EXISTING SET COLUMNS | ||
MIN(filtered.Date) AS min; | ||
|
||
def filter : Constraint = temp2.week > 9 AND temp2.week < 19; | ||
|
||
def normalCount : Constraint = measures3.Count = 2; | ||
|
||
def normal : Constraint = temp3.Chunk = temp2.week; | ||
|
||
def week : Computation = NAME temp2 INCLUDE EXISTING SET COLUMNS | ||
((RELATIVE(temp.min, temp.Date, DAYS)) - | ||
((RELATIVE(temp.min, temp.Date, DAYS)) % 7)) / 7 AS week; | ||
|
||
def groupBy : GroupByColumn = NAME measures3 ON temp2.week | ||
FROM COUNT(measures3.week) AS Count; | ||
|
||
from(filtered) | computation(comp) | | ||
from(temp) | computation(week) | computation(filter) | is(temp2) | | ||
groupBy(groupBy) | constraint(normalCount) | is(temp3) | | ||
from(temp2, temp3) | constraint(normal) | is(temp2, normal3) | | ||
difference(temp2, normal3) | is(notNormal3) | ||
|
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,10 @@ | ||
def filterUser : Constraint = "admire2" = websitexlsx.Login; | ||
|
||
def con : Constraint = filteredweb.CustomMeasurementId = 346; | ||
|
||
|
||
from(websitexlsx) | constraint(filterUser) | | ||
is(filteredweb) | | ||
|
||
from(filteredweb)| | ||
constraint(con)|is(filtered) |
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,5 @@ | ||
def comp : Computation = NAME sensor | ||
INCLUDE EXISTING SET COLUMNS | ||
COMBINE(admire2txt.date, admire2txt.time) AS datetime; | ||
|
||
from(admire2txt)|computation(comp) |
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,8 @@ | ||
def comp : Computation = NAME sensorred | ||
NEW SET COLUMNS | ||
sensor.Value AS Value, | ||
sensor.date AS Date, | ||
sensor.time AS Time, | ||
sensor.datetime AS DateTime; | ||
|
||
from(sensor)|computation(comp) |
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,6 @@ | ||
def groupByDay : GroupByColumn = NAME measureMoment | ||
ON filteredweb.Moment | ||
FROM | ||
COUNT(filteredweb.Moment) AS number_of_measures; | ||
|
||
from(filteredweb)|groupBy(groupByDay) |
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,12 @@ | ||
def group : GroupByConstraint = NAME measureMoment2 ON | ||
admire2txt.time BEFORE #06:00# AS early, | ||
admire2txt.time AFTER #06:00# AND admire2txt.time BEFORE #07:00# AS six, | ||
admire2txt.time AFTER #07:00# AND admire2txt.time BEFORE #08:00# AS seven, | ||
admire2txt.time AFTER #08:00# AND admire2txt.time BEFORE #09:00# AS eight, | ||
admire2txt.time AFTER #09:00# AND admire2txt.time BEFORE #10:00# AS nine, | ||
admire2txt.time AFTER #10:00# AND admire2txt.time BEFORE #11:00# AS ten, | ||
admire2txt.time AFTER #11:00# AND admire2txt.time BEFORE #12:00# AS eleven, | ||
admire2txt.time AFTER #12:00# AS late | ||
FROM COUNT(admire2txt.time) AS count; | ||
|
||
from(admire2txt)|groupBy(group) |
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,5 @@ | ||
def groupBy : GroupByColumn = NAME everyDay ON | ||
((RELATIVE(admire2txt.date,#2015-06-21#, DAYS)) % 7) | ||
FROM COUNT(admire2txt.date) AS count; | ||
|
||
from(admire2txt)|groupBy(groupBy) |
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,18 @@ | ||
def group : GroupByConstraint = NAME enterMoment ON | ||
TO_TIME(filteredweb.CreatedDate) BEFORE #06:00# AS early, | ||
TO_TIME(filteredweb.CreatedDate) AFTER #06:00# | ||
AND TO_TIME(filteredweb.CreatedDate) BEFORE #07:00# AS six, | ||
TO_TIME(filteredweb.CreatedDate) AFTER #07:00# | ||
AND TO_TIME(filteredweb.CreatedDate) BEFORE #08:00# AS seven, | ||
TO_TIME(filteredweb.CreatedDate) AFTER #08:00# | ||
AND TO_TIME(filteredweb.CreatedDate) BEFORE #09:00# AS eight, | ||
TO_TIME(filteredweb.CreatedDate) AFTER #09:00# | ||
AND TO_TIME(filteredweb.CreatedDate) BEFORE #10:00# AS nine, | ||
TO_TIME(filteredweb.CreatedDate) AFTER #10:00# | ||
AND TO_TIME(filteredweb.CreatedDate) BEFORE #11:00# AS ten, | ||
TO_TIME(filteredweb.CreatedDate) AFTER #11:00# | ||
AND TO_TIME(filteredweb.CreatedDate) BEFORE #12:00# AS eleven, | ||
TO_TIME(filteredweb.CreatedDate) AFTER #12:00# AS late | ||
FROM COUNT(filteredweb.Moment) AS count; | ||
|
||
from(filteredweb)|groupBy(group) |
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,5 @@ | ||
def groupBy : GroupByColumn = NAME enterDay ON | ||
((RELATIVE(TO_DATE(filteredweb.CreatedDate),#2015-06-21#, DAYS)) % 7) | ||
FROM COUNT(filteredweb.Moment) AS count; | ||
|
||
from(filteredweb)|groupBy(groupBy) |
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,15 @@ | ||
def joinDif : Join = JOIN admire2txt WITH filtered AS difference | ||
ON admire2txt.date = filtered.Date | ||
AND NOT(admire2txt.Value = filtered.Value); | ||
|
||
def comp : Computation = NAME joinDifReduced | ||
NEW SET COLUMNS | ||
difference.date AS Date, | ||
difference.admire2txt_Value AS SensorValue, | ||
difference.filtered_Value AS WebValue, | ||
(difference.filtered_Value - difference.admire2txt_Value) | ||
AS dif; | ||
|
||
|
||
join(joinDif)|from(difference)|computation(comp) | ||
|
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,6 @@ | ||
def join : Join = JOIN sensorred WITH filtered AS joined | ||
ON sensorred.Date = filtered.Date, | ||
FROM sensorred.Date AND filtered.Date; | ||
|
||
join(join) | ||
|
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,10 @@ | ||
def measured : Constraint = filteredweb.CustomMeasurementId = 415; | ||
def remeasure : Constraint = | ||
filtered.KreatinineAlgorithmActionId = "1"; | ||
def done : Constraint = remeasure.Date = second.Date; | ||
|
||
from(filteredweb) | constraint(measured)|is(second) | | ||
from(filtered) | constraint(remeasure) | is(remeasure) | | ||
from(remeasure, second) | constraint(done) | | ||
is(remeasure, temp) | setCode("Done", remeasure) | | ||
difference(remeasure, temp) | setCode("NotDone", remeasure) |
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,10 @@ | ||
def comp : Computation = NAME temp INCLUDE EXISTING SET COLUMNS | ||
MIN(filtered.Date) AS min; | ||
|
||
|
||
def week : Computation = NAME temp2 INCLUDE EXISTING SET COLUMNS | ||
RELATIVE(temp.min, temp.Date, DAYS) AS week; | ||
|
||
from(filtered) | computation(comp) | | ||
from(temp) | computation(week) | ||
|
Binary file not shown.
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,70 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<input> | ||
<file name="website.xlsx"> | ||
<path>/home/jens/session/input</path> | ||
<type>xlsx</type> | ||
<data> | ||
<start>1</start> | ||
<end>0</end> | ||
</data> | ||
<columns firstrowheader="true"> | ||
<column format="" type="int"/> | ||
<column format="" type="int"/> | ||
<column format="" type="string"/> | ||
<column format="exceldate" type="date"/> | ||
<column format="" type="int"/> | ||
<column format="" type="int"/> | ||
<column format="" type="string"/> | ||
<column format="" type="string"/> | ||
<column format="" type="string"/> | ||
<column format="" type="string"/> | ||
<column format="" type="string"/> | ||
<column format="" type="string"/> | ||
<column format="" type="string"/> | ||
<column format="" type="string"/> | ||
<column format="exceldate" type="datetime"/> | ||
<column format="" type="string"/> | ||
<column format="exceldate" type="datetime"/> | ||
<column format="" type="int"/> | ||
<column format="" type="int"/> | ||
<column format="" type="string"/> | ||
<column format="" type="int"/> | ||
<column format="" type="string"/> | ||
<column format="" type="string"/> | ||
</columns> | ||
</file> | ||
<file delimiter="," name="admire2.txt"> | ||
<path>/home/jens/session/input/measured creatinine</path> | ||
<metadata format="" name="name" type="string" value="admire2"/> | ||
<type>plaintext</type> | ||
<data> | ||
<start>7</start> | ||
<end>2</end> | ||
</data> | ||
<columns firstrowheader="false"> | ||
<column format="" type="string">Type</column> | ||
<column format="" type="int">Value</column> | ||
<column format="" type="string">unit</column> | ||
<column format="" type="string">ignore</column> | ||
<column format="yyMMdd" type="date">date</column> | ||
<column format="HHmm" type="time">time</column> | ||
</columns> | ||
</file> | ||
<file delimiter="," name="ADMIRE_13.txt"> | ||
<path>/home/jens/session/input/measured creatinine</path> | ||
<metadata name="name" type="string"/> | ||
<type>plaintext</type> | ||
<data> | ||
<start>7</start> | ||
<end>2</end> | ||
</data> | ||
<columns firstrowheader="false"> | ||
<column format="" type="string">Type</column> | ||
<column format="" type="int">Value</column> | ||
<column format="" type="string">unit</column> | ||
<column format="" type="string">ignore</column> | ||
<column format="yyMMdd" type="date">date</column> | ||
<column format="HHmm" type="time">time</column> | ||
</columns> | ||
</file> | ||
</input> |