-
Notifications
You must be signed in to change notification settings - Fork 7
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 #62 from pennsignals/epic
Epic API tests
- Loading branch information
Showing
55 changed files
with
1,899 additions
and
1,185 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
File renamed without changes.
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 @@ | ||
listen example.epic_notifications |
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 @@ | ||
insert into epic_notification_errors ( | ||
prediction_id, | ||
name, | ||
description | ||
) | ||
select | ||
%(prediction_id)s, | ||
%(name)s, | ||
%(description)s | ||
returning * |
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 @@ | ||
insert into epic_notifications ( | ||
prediction_id | ||
) | ||
select | ||
%(prediction_id)s | ||
returning * |
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,31 @@ | ||
with args as ( | ||
select | ||
cast(%(notification_id)s as int) as notification_id | ||
) | ||
select | ||
n.id | ||
p.id as prediction_id, | ||
p.run_id, | ||
p.csn, | ||
p.empi, | ||
p.score, | ||
r.as_of | ||
from | ||
args | ||
join runs as r | ||
upper(r.interval) != 'infinity' | ||
join predictions as p on | ||
p.run_id = r.id | ||
join epic_notifications as n on | ||
n.prediction_id = p.id | ||
and n.id <= args.notification_id | ||
left join epic_verifcations as v on | ||
v.notification_id = n.id | ||
left join epic_verification_errors as e on | ||
e.notification_id = n.id | ||
and e.acknowledged_on is null | ||
where | ||
v.id is null | ||
and e.id is null | ||
order by | ||
r.id, p.id |
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,24 @@ | ||
select | ||
n.id, | ||
p.id as prediction_id, | ||
p.csn, | ||
p.empi, | ||
p.score, | ||
r.as_of | ||
from | ||
runs as r | ||
join predictions as p on | ||
p.run_id = r.id | ||
and upper(r.interval) != 'infinity' | ||
join epic_notifications as n on | ||
n.prediction_id = p.id | ||
left join epic_verifications as v on | ||
v.notification_id = n.id | ||
left join epic_verification_errors as e on | ||
e.notification_id = n.id | ||
and e.acknowledged_on is null | ||
where | ||
v.id is null | ||
and e.id is null | ||
order by | ||
p.id, n.id |
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 @@ | ||
insert into epic_verification_errors ( | ||
notification_id, | ||
name, | ||
description, | ||
) | ||
select | ||
%(notification_id)s, | ||
%(name)s, | ||
%(description)s | ||
returning * |
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 @@ | ||
insert into epic_verifications ( | ||
notification_id | ||
) | ||
select | ||
%(notification_id)s | ||
returning * |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
listen example.predictions |
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,28 @@ | ||
with args as ( | ||
select | ||
cast(%(prediction_id)s as int) as prediction_id | ||
) | ||
select | ||
p.id, | ||
p.run_id, | ||
p.csn, | ||
p.empi, | ||
p.score, | ||
r.as_of | ||
from | ||
args | ||
join runs as r | ||
upper(r.interval) != 'infinity' | ||
join predictions as p on | ||
p.id <= args.prediction_id | ||
and p.run_id = r.id | ||
left join epic_notifications as n on | ||
n.prediction_id = p.id | ||
left join epic_notification_errors as e on | ||
e.prediction_id = p.id | ||
and e.acknowledged_on is null | ||
where | ||
n.id is null | ||
and e.id is null | ||
order by | ||
r.id, p.id |
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 @@ | ||
select | ||
p.id, | ||
p.run_id, | ||
p.csn, | ||
p.empi, | ||
p.score, | ||
r.as_of | ||
from | ||
runs as r | ||
join predictions as p on | ||
p.run_id = r.id | ||
and upper(r.interval) != 'infinity' | ||
left join epic_notifications as n on | ||
n.prediction_id = p.prediction_id | ||
left join epic_notification_errors as e on | ||
e.prediction_id = p.prediction_id | ||
and e.acknowledged_on is null | ||
where | ||
n.id is null | ||
and e.id is null | ||
order by | ||
r.id, p.id |
File renamed without changes.
File renamed without changes.
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 @@ | ||
set search_path = example; |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
* | ||
!.gitignore | ||
!configuration.yaml | ||
!notifier.yaml | ||
!verifier.yaml | ||
!epic.yaml |
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 @@ | ||
postgres: !postgres | ||
database: ${POSTGRES_DATABASE} | ||
host: ${POSTRES_HOST} | ||
password: ${POSTGRES_PASSWORD} | ||
port: 5432 | ||
username: ${POSTGRES_USERNAME} |
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,4 @@ | ||
!epic | ||
address: 0.0.0.0:80 | ||
add_flowsheet_value_path: ${EPIC_ROOT}${EPIC_ADD_FLOWSHEET_VALUE_PATH} | ||
get_flowsheet_rows_path: ${EPIC_ROOT}${EPIC_GET_FLOWSHEET_ROWS_PATH} |
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 @@ | ||
!epicnotifier | ||
client_id: ${EPIC_CLIENT_ID} | ||
cookie: ${EPIC_COOKIE} | ||
flowsheet_id: ${EPIC_FLOWSHEET_ID} | ||
flowsheet_template_id: ${EPIC_FLOWSHEET_TEMPLATE_ID} | ||
password: ${EPIC_PASSWORD} | ||
postgres: !postgres | ||
database: ${POSTGRES_DATABASE} | ||
host: ${POSTGRES_HOST} | ||
password: ${POSTGRES_PASSWORD} | ||
port: 5432 | ||
sql: !asset | ||
ext: .sql | ||
path: ./assets/postgres | ||
tables: [] | ||
username: ${POSTGRES_USERNAME} | ||
username: ${EPIC_USERNAME} | ||
user_id: ${EPIC_USER_ID} | ||
url: ${EPIC_URL}${EPIC_ROOT}${EPIC_ADD_FLOWSHEET_VALUE_PATH} |
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 @@ | ||
!epicverifier | ||
client_id: ${EPIC_CLIENT_ID} | ||
cookie: ${EPIC_COOKIE} | ||
flowsheet_id: ${EPIC_FLOWSHEET_ID} | ||
flowsheet_template_id: ${EPIC_FLOWSHEET_TEMPLATE_ID} | ||
password: ${EPIC_PASSWORD} | ||
postgres: !postgres | ||
database: ${POSTGRES_DATABASE} | ||
host: ${POSTGRES_HOST} | ||
password: ${POSTGRES_PASSWORD} | ||
port: 5432 | ||
sql: !asset | ||
ext: .sql | ||
path: ./assets/postgres | ||
tables: [] | ||
username: ${POSTGRES_USERNAME} | ||
username: ${EPIC_USERNAME} | ||
user_id: ${EPIC_USER_ID} | ||
url: ${EPIC_URL}${EPIC_ROOT}${EPIC_GET_FLOWSHEET_ROWS_PATH} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
create extension if not exists btree_gist; | ||
|
||
create schema if not exists dsdk; | ||
grant usage on schema dsdk to public; | ||
grant create on schema dsdk to public; | ||
create schema if not exists example; | ||
grant usage on schema example to public; | ||
grant create on schema example to public; |
Oops, something went wrong.