Skip to content

Commit 6921265

Browse files
feat: add commands to set patient on operating table in azure platform
1 parent c25e97c commit 6921265

File tree

1 file changed

+150
-30
lines changed

1 file changed

+150
-30
lines changed

data/flows.json

Lines changed: 150 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -194,25 +194,6 @@
194194
]
195195
]
196196
},
197-
{
198-
"id": "d1be411bbad65001",
199-
"type": "function",
200-
"z": "09012e75c72a4968",
201-
"name": "PatientOnOperatingTable",
202-
"func": "",
203-
"outputs": 1,
204-
"noerr": 0,
205-
"initialize": "",
206-
"finalize": "",
207-
"libs": [],
208-
"x": 1380,
209-
"y": 920,
210-
"wires": [
211-
[
212-
"c45a10208faeea88"
213-
]
214-
]
215-
},
216197
{
217198
"id": "f749ed1e2e58c229",
218199
"type": "function",
@@ -455,8 +436,8 @@
455436
"initialize": "",
456437
"finalize": "",
457438
"libs": [],
458-
"x": 2910,
459-
"y": 700,
439+
"x": 3210,
440+
"y": 740,
460441
"wires": [
461442
[
462443
"6a5968a77bdcb8ec"
@@ -493,8 +474,8 @@
493474
"targetType": "msg",
494475
"statusVal": "",
495476
"statusType": "auto",
496-
"x": 3240,
497-
"y": 700,
477+
"x": 3560,
478+
"y": 740,
498479
"wires": []
499480
},
500481
{
@@ -1144,7 +1125,7 @@
11441125
"y": 920,
11451126
"wires": [
11461127
[
1147-
"d1be411bbad65001"
1128+
"61eca1567ddb5e81"
11481129
]
11491130
]
11501131
},
@@ -1351,8 +1332,8 @@
13511332
"proxy": "",
13521333
"authType": "",
13531334
"senderr": false,
1354-
"x": 3070,
1355-
"y": 700,
1335+
"x": 3390,
1336+
"y": 740,
13561337
"wires": [
13571338
[
13581339
"3e879afc64077b51"
@@ -1472,7 +1453,7 @@
14721453
"proxy": "",
14731454
"authType": "",
14741455
"senderr": false,
1475-
"x": 2130,
1456+
"x": 2110,
14761457
"y": 980,
14771458
"wires": [
14781459
[
@@ -1491,7 +1472,7 @@
14911472
"initialize": "",
14921473
"finalize": "",
14931474
"libs": [],
1494-
"x": 2370,
1475+
"x": 2910,
14951476
"y": 980,
14961477
"wires": [
14971478
[
@@ -1609,7 +1590,7 @@
16091590
"initialize": "",
16101591
"finalize": "",
16111592
"libs": [],
1612-
"x": 2670,
1593+
"x": 2650,
16131594
"y": 860,
16141595
"wires": [
16151596
[
@@ -1622,7 +1603,7 @@
16221603
"type": "function",
16231604
"z": "09012e75c72a4968",
16241605
"name": "requestProcessRelatedToTheRoom",
1625-
"func": "msg.url = \"https://digital-twin-layer.api.neu.digitaltwins.azure.net/query?api-version=2023-02-27-preview\"\nlet query = \"SELECT TOP (1) Process.$dtId, Process FROM digitaltwins Process JOIN Room RELATED Process.process.rel_is_inside WHERE Room.$dtId = 'room1' AND Process.process_state = '1'\"\nmsg.method = \"post\"\n\nmsg.payload = {\n \"query\": query\n}\nreturn msg;",
1606+
"func": "msg.url = \"https://digital-twin-layer.api.neu.digitaltwins.azure.net/query?api-version=2023-02-27-preview\"\nlet query = \"SELECT TOP (1) SurgicalProcess.$dtId FROM DIGITALTWINS SurgicalProcess JOIN Room RELATED SurgicalProcess.rel_is_inside WHERE Room.$dtId = \" + msg.room_id\nmsg.method = \"post\"\n\nmsg.payload = {\n \"query\": query\n}\nreturn msg;",
16261607
"outputs": 1,
16271608
"noerr": 0,
16281609
"initialize": "",
@@ -1676,5 +1657,144 @@
16761657
"d743a7865378b0dc"
16771658
]
16781659
]
1660+
},
1661+
{
1662+
"id": "61eca1567ddb5e81",
1663+
"type": "function",
1664+
"z": "09012e75c72a4968",
1665+
"name": "requestProcessRelatedToTheRoom",
1666+
"func": "msg.url = \"https://digital-twin-layer.api.neu.digitaltwins.azure.net/query?api-version=2023-02-27-preview\"\nlet query = \"SELECT TOP (1) SurgicalProcess.$dtId FROM DIGITALTWINS SurgicalProcess JOIN Room RELATED SurgicalProcess.rel_is_inside WHERE Room.$dtId = \" + msg.room_id\nmsg.method = \"post\"\n\nmsg.payload = {\n \"query\": query\n}\nreturn msg;",
1667+
"outputs": 1,
1668+
"noerr": 0,
1669+
"initialize": "",
1670+
"finalize": "",
1671+
"libs": [],
1672+
"x": 1430,
1673+
"y": 920,
1674+
"wires": [
1675+
[
1676+
"780cd80ab50444c2"
1677+
]
1678+
]
1679+
},
1680+
{
1681+
"id": "780cd80ab50444c2",
1682+
"type": "function",
1683+
"z": "09012e75c72a4968",
1684+
"name": "add header ",
1685+
"func": "msg.headers = {};\nmsg.headers['Authorization'] = \"Bearer \" + msg.token\nmsg.headers['Content-Type'] = \"application/json\"\nreturn msg;",
1686+
"outputs": 1,
1687+
"noerr": 0,
1688+
"initialize": "",
1689+
"finalize": "",
1690+
"libs": [],
1691+
"x": 1690,
1692+
"y": 920,
1693+
"wires": [
1694+
[
1695+
"955129310e7a1ad4"
1696+
]
1697+
]
1698+
},
1699+
{
1700+
"id": "955129310e7a1ad4",
1701+
"type": "https-node",
1702+
"z": "09012e75c72a4968",
1703+
"name": "",
1704+
"method": "use",
1705+
"ret": "txt",
1706+
"paytoqs": "ignore",
1707+
"url": "",
1708+
"tls": "",
1709+
"persist": true,
1710+
"proxy": "",
1711+
"authType": "",
1712+
"senderr": false,
1713+
"x": 1850,
1714+
"y": 920,
1715+
"wires": [
1716+
[
1717+
"f51c81bfe7e71efa"
1718+
]
1719+
]
1720+
},
1721+
{
1722+
"id": "f51c81bfe7e71efa",
1723+
"type": "function",
1724+
"z": "09012e75c72a4968",
1725+
"name": "requestPatientRelatedToTheProcess",
1726+
"func": "let process_id = JSON.parse(msg.payload)\nprocess_id = msg.process_id[\"value\"][0][\"$dtId\"]\n\nmsg.url = \"https://digital-twin-layer.api.neu.digitaltwins.azure.net/query?api-version=2023-02-27-preview\"\nlet query = \"SELECT TOP (1) Patient.$dtId FROM DIGITALTWINS SurgicalProcess JOIN Patient RELATED SurgicalProcess.rel_involve_patient where SurgicalProcess.$dtId =\"+ process_id\nmsg.method = \"post\"\n\nmsg.payload = {\n \"query\": query\n}\nreturn msg;",
1727+
"outputs": 1,
1728+
"noerr": 0,
1729+
"initialize": "",
1730+
"finalize": "",
1731+
"libs": [],
1732+
"x": 2110,
1733+
"y": 920,
1734+
"wires": [
1735+
[
1736+
"dff86deba04d2359"
1737+
]
1738+
]
1739+
},
1740+
{
1741+
"id": "dff86deba04d2359",
1742+
"type": "function",
1743+
"z": "09012e75c72a4968",
1744+
"name": "add header ",
1745+
"func": "msg.headers = {};\nmsg.headers['Authorization'] = \"Bearer \" + msg.token\nmsg.headers['Content-Type'] = \"application/json\"\nreturn msg;",
1746+
"outputs": 1,
1747+
"noerr": 0,
1748+
"initialize": "",
1749+
"finalize": "",
1750+
"libs": [],
1751+
"x": 2370,
1752+
"y": 920,
1753+
"wires": [
1754+
[
1755+
"e1b522b4e3afd1db"
1756+
]
1757+
]
1758+
},
1759+
{
1760+
"id": "e1b522b4e3afd1db",
1761+
"type": "https-node",
1762+
"z": "09012e75c72a4968",
1763+
"name": "",
1764+
"method": "use",
1765+
"ret": "txt",
1766+
"paytoqs": "ignore",
1767+
"url": "",
1768+
"tls": "",
1769+
"persist": true,
1770+
"proxy": "",
1771+
"authType": "",
1772+
"senderr": false,
1773+
"x": 2550,
1774+
"y": 920,
1775+
"wires": [
1776+
[
1777+
"a35b075974d1b012"
1778+
]
1779+
]
1780+
},
1781+
{
1782+
"id": "a35b075974d1b012",
1783+
"type": "function",
1784+
"z": "09012e75c72a4968",
1785+
"name": "setPatientOnOperatingTable",
1786+
"func": "let patient_id = JSON.parse(msg.payload)\npatient_id = msg.process_id[\"value\"][0][\"$dtId\"]\n\nmsg.payload = [\n {\n \"op\": \"add\",\n \"path\": \"/isOnOperatingTable\",\n \"value\": true\n }\n]\n\nmsg.url = \"https://digital-twin-layer.api.neu.digitaltwins.azure.net/digitaltwins/\" + patient_id + \"?api-version=2020-10-31\"\nmsg.method = \"patch\"\nreturn msg;",
1787+
"outputs": 1,
1788+
"noerr": 0,
1789+
"initialize": "",
1790+
"finalize": "",
1791+
"libs": [],
1792+
"x": 2760,
1793+
"y": 920,
1794+
"wires": [
1795+
[
1796+
"c45a10208faeea88"
1797+
]
1798+
]
16791799
}
16801800
]

0 commit comments

Comments
 (0)