Last active
November 3, 2023 03:15
-
-
Save cyyeh/f9815e615eb221bbde1acfe1fe957eb8 to your computer and use it in GitHub Desktop.
長庚poc
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
{% if context.params.rectype != 'PETscan' and | |
context.params.rectype != 'PETreport' and | |
context.params.rectype != 'PETprepare' and | |
context.params.rectype != 'PETinj' %} | |
{% error "rectype should be PETscan, PETreport, PETprepare or PETinj" %} | |
{% endif %} | |
{% set body = {"body": {"chtno": context.params.chtno, "deptNo": context.params.deptno, "recType": context.params.rectype}} %} | |
select | |
fillID, | |
chtno, | |
deptNo, | |
opdno, | |
sheetid, | |
recType, | |
recNo, | |
assetNo, | |
status, | |
recDate, | |
createUser, | |
createDate, | |
cast(detail AS json) | |
from | |
unnest( | |
cast( | |
json_parse( | |
{{ body | rest_api(url='https://cghasp.cgmh.org.tw/structure/Struct_IotDataQuery', method='POST') }} | |
) | |
as array( | |
row( | |
fillID varchar, | |
chtno varchar, | |
deptNo varchar, | |
opdno varchar, | |
pacsno varchar, | |
sheetid varchar, | |
recType varchar, | |
recNo varchar, | |
assetNo varchar, | |
status varchar, | |
recDate varchar, | |
createUser varchar, | |
createDate varchar, | |
detail array(map(varchar, varchar)) | |
) | |
) | |
) | |
) |
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
{% set body = {"body": {"chtno": context.params.chtno, "deptNo": context.params.deptno, "recType": "PETinj"}} %} | |
select | |
fillID, | |
chtno, | |
deptNo, | |
opdno, | |
sheetid, | |
recType, | |
recNo, | |
assetNo, | |
status, | |
recDate, | |
createUser, | |
createDate, | |
cast(detail AS json) | |
from | |
unnest( | |
cast( | |
json_parse( | |
{{ body | rest_api(url='https://cghasp.cgmh.org.tw/structure/Struct_IotDataQuery', method='POST') }} | |
) | |
as array( | |
row( | |
fillID varchar, | |
chtno varchar, | |
deptNo varchar, | |
opdno varchar, | |
pacsno varchar, | |
sheetid varchar, | |
recType varchar, | |
recNo varchar, | |
assetNo varchar, | |
status varchar, | |
recDate varchar, | |
createUser varchar, | |
createDate varchar, | |
detail array(map(varchar, varchar)) | |
) | |
) | |
) | |
) |
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
{% set body = {"body": {"chtno": context.params.chtno, "deptNo": context.params.deptno, "recType": "PETprepare"}} %} | |
select | |
fillID, | |
chtno, | |
deptNo, | |
opdno, | |
sheetid, | |
recType, | |
recNo, | |
assetNo, | |
status, | |
recDate, | |
createUser, | |
createDate, | |
cast(detail AS json) | |
from | |
unnest( | |
cast( | |
json_parse( | |
{{ body | rest_api(url='https://cghasp.cgmh.org.tw/structure/Struct_IotDataQuery', method='POST') }} | |
) | |
as array( | |
row( | |
fillID varchar, | |
chtno varchar, | |
deptNo varchar, | |
opdno varchar, | |
pacsno varchar, | |
sheetid varchar, | |
recType varchar, | |
recNo varchar, | |
assetNo varchar, | |
status varchar, | |
recDate varchar, | |
createUser varchar, | |
createDate varchar, | |
detail array(map(varchar, varchar)) | |
) | |
) | |
) | |
) |
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
{% set body = {"body": {"chtno": context.params.chtno, "deptNo": context.params.deptno, "recType": "PETreport"}} %} | |
select | |
fillID, | |
chtno, | |
deptNo, | |
opdno, | |
sheetid, | |
recType, | |
recNo, | |
assetNo, | |
status, | |
recDate, | |
createUser, | |
createDate, | |
cast(detail AS json) | |
from | |
unnest( | |
cast( | |
json_parse( | |
{{ body | rest_api(url='https://cghasp.cgmh.org.tw/structure/Struct_IotDataQuery', method='POST') }} | |
) | |
as array( | |
row( | |
fillID varchar, | |
chtno varchar, | |
deptNo varchar, | |
opdno varchar, | |
pacsno varchar, | |
sheetid varchar, | |
recType varchar, | |
recNo varchar, | |
assetNo varchar, | |
status varchar, | |
recDate varchar, | |
createUser varchar, | |
createDate varchar, | |
detail array(map(varchar, varchar)) | |
) | |
) | |
) | |
) |
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
{% set body = {"body": {"chtno": context.params.chtno, "deptNo": context.params.deptno, "recType": "PETscan"}} %} | |
select | |
fillID, | |
chtno, | |
deptNo, | |
opdno, | |
sheetid, | |
recType, | |
recNo, | |
assetNo, | |
status, | |
recDate, | |
createUser, | |
createDate, | |
cast(detail AS json) | |
from | |
unnest( | |
cast( | |
json_parse( | |
{{ body | rest_api(url='https://cghasp.cgmh.org.tw/structure/Struct_IotDataQuery', method='POST') }} | |
) | |
as array( | |
row( | |
fillID varchar, | |
chtno varchar, | |
deptNo varchar, | |
opdno varchar, | |
pacsno varchar, | |
sheetid varchar, | |
recType varchar, | |
recNo varchar, | |
assetNo varchar, | |
status varchar, | |
recDate varchar, | |
createUser varchar, | |
createDate varchar, | |
detail array(map(varchar, varchar)) | |
) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment