Anyone can access and use the Vitalserver platform by application programming interface (API). All APIâs can be called using the http standard protocol.
| Endpoint | Method | Description |
|---|---|---|
| http://SERVER_IP:PORT/api/login | POST | Issue an access token which is required to access Vitalserver APIs. |
| http://SERVER_IP:PORT/api/bedlist | GET | Retrieve a bed list registered on Vitalserver. |
| http://SERVER_IP:PORT/api/receive | GET | Returns web monitoring data by bedname and dt |
| http://SERVER_IP:PORT/adt/yyyy/mm/dd | GET | Returns hid-filename list in csv file. |
| http://SERVER_IP:PORT/api/filelist | GET | Read file list of uploaded user files. |
| http://SERVER_IP:PORT/api/tracklist | GET | Get a tracklist of files. |
| http://SERVER_IP:PORT/api/download | GET | Download a vital file from the cloud. |
Issue an access token which is required to access Vitalserver APIs.
http://SERVER_IP:PORT/api/login
POST
Please url-encode (RFC1738) the parameters if it has any special characters.
| Field | Type |
|---|---|
| id | String |
| pw | String |
Content-type: application/json
| Field | Type | Description |
|---|---|---|
| access_token | String | An access token which is required to access Vitalserver APIs. |
| token_type | String | Always âbearerâ, which is used for OAuth2. |
| expires_in | Number | Always 3600. The access token expires in an hour. |
curl -v -d âid=userid&pw=passwordâ http://SERVER_IP:PORT/api/login
Retrieve a bed list registered on Vitalserver.
http://SERVER_IP:PORT/api/bedlist
GET
Please url-encode (RFC1738) the parameters if it has any special characters.
| Field | Type |
|---|---|
| access_token | String |
Content-Type: application/json; charset=utf-8
Array of bed list
curl -v -d âaccess_token=xxxxxxxxxâ http://SERVER_IP:PORT/api/bedlist
Returns vital sign data of input bed name, start time, and end time as long as the account has permission.
http://SERVER_IP:PORT/api/receive
GET
| Field | Type | Required | Description |
|---|---|---|---|
| access_token | String | Required | An Access token which is required to access Vitalserver APIs. |
| bedname | String | Required | Bedname
|
| dtstart | Unix Timestamp | Optional | Start time in Unix Timestamp format
|
| dtend | Unix Timestamp | Optional | End time in Unix Timestamp format.
|
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Gzipped JSON encoded data
Sample code below downloads real-time data from the bed whose vrcode is âsampleâ.
Please use âpip install vitaldbâ before running our sample code.
import vitaldb
import json
if vitaldb.login('ID', 'PASSWORD', 'SERVERIP', 'SERVERPORT'):
res = vitaldb.receive(bedname='TEST1, TEST2')
for key in res:
res[key] = res[key]
print(res[key].keys())
with open('result.json', 'w', encoding='utf-8') as f:
json.dump(res, f, ensure_ascii=False, indent=4)
returns .csv file of adt list (filename - hid matching list)
* might not be applicable to some hospitals for the security issue
http://SERVER_IP:PORT/adt/yyyy/mm/dd
GET
| Field | Type | Required |
|---|---|---|
| yyyy | string | Required |
| mm | string | Optional |
| dd | string | Optional |
| Field | Type | Description |
|---|---|---|
| hid1 | String | Patient ID |
| hid2 | String | Patient ID |
| filename | String | Vital Filename (bednameyymmddhhmmss.vital) |
Read file list of uploaded user files.
http://SERVER_IP:PORT/api/filelist
GET
Please url-encode (RFC1738) the parameters if it has any special characters.
| Field | Type | Required |
|---|---|---|
| access_token | String | Required |
| bedname | String | Optional |
| dtstart | Unix timestamp | Optional |
| dtend | Unix timestamp | Optional |
| dtuploadstart | Unix timestamp |
Optional |
| dtuploadend | Unix timestamp |
Optional |
| hid | String | Optional |
| Field | Type | Description |
|---|---|---|
| json.gz | File | A gzip compressed file that contains a list of file information in JSON format |
| filename | String | File name (ex) DEMO210415091812.vital |
| filesize | Number | File size in bytes |
| dtstart | Datetime | Recording start time |
| dtend | Datetime | Recording end time |
| dtupload | Datetime | Uploaded or lastly modified datetime |
curl -i http://SERVER_IP:PORT/api/filelist?access_token=xxxxxxxx --output json.gz
Please use âpip install vitaldbâ before running our sample code.
import vitaldb
import os
import datetime
DOWNLOAD_DIR = "path/to/folder"
if not os.path.exists(DOWNLOAD_DIR):
os.mkdir(DOWNLOAD_DIR)
if vitaldb.login('ID', 'PASSWORD', 'SERVERIP', 'SERVERPORT'):
for f in vitaldb.filelist(bedname="D1", dtstart="2010-10-01", dtend="2010-10-02")
opath = DOWNLOAD_DIR + "/" + f['filename']
if os.path.exists(opath):
continue
vitaldb.download(f['filename'], opath)
Get a tracklist of files
http://SERVER_IP:PORT/api/tracklist
GET
Please url-encode (RFC1738) the parameters if it has any special characters.
| Field | Type | Required |
|---|---|---|
| access_token | String | Required |
| bedname | String | Optional |
| dtstart | Unix timestamp | Optional |
| dtend | Unix timestamp | Optional |
| dtuploadstart | Unix timestamp |
Optional |
| dtuploadend | Unix timestamp |
Optional |
| Field | Type | Description |
|---|---|---|
| json.gz | File | A gzip compressed file that contains a list of file information in JSON format |
| filename | String | File name (ex) DEMO210415091812.vital |
| trks | Array/List | Track list (ex) [âSNUH/SNUADCâ,...] |
Please use âpip install vitaldbâ before running our sample code.
import vitaldb
if vitaldb.login('ID', 'PASSWORD', 'SERVERIP', 'SERVERPORT'):
res = vitaldb.tracklist(bedname='SICU2_12', dtstart="2023-07-10", dtend="2023-07-10")
print(res)
\# Result Example: [{'filename': 'SICU212230710000010.vital', 'trks': ['Intellivue/FLOWWAV', 'Intellivue/AWPWAV', 'Intellivue/ECGII_WAV']}, ...]
Download a vital file from the cloud.
http://SERVER_IP:PORT/api/download
GET
Please url-encode (RFC1738) the parameters if it has any special characters.
| Field | Type |
|---|---|
| access_token | String |
| filename | String |
| asurl | Boolean |
| Field | Type | Description |
|---|---|---|
| Vital File | File | A vital file (if asurl is not 1) |
| URL for downloading vital file | String | If asurl is 1, the url for downloading the vital file will be sent. |
curl -i http://SERVER_IP:PORT/api/download?access_token=xxxxxxxx&filename=xxx.vital
Sample code below downloads a specific vital file from Vitalserver to a local PC and prints the track names.
Please use âpip install vitaldbâ before running our sample code.
import vitaldb
if vitaldb.login('ID', 'PASSWORD', 'SERVERIP', 'SERVERPORT'):
vf = vitaldb.VitalFile(vitaldb.download('TEST1211020142621.vital'))
print(vf.gettracknames())
Sample code below reads filenames from an Excel file and downloads them to a local PC.
Please use âpip install vitaldbâ before running our sample code.
import vitaldb
import os
import pandas as pd
DOWNLOAD_DIR = 'path/to/folder'
if not os.path.exists(DOWNLOAD_DIR):
os.mkdir(DOWNLOAD_DIR)
df = pd.read_excel('list.xlsx')
if vitaldb.login('ID', 'PASSWORD', 'SERVERIP', 'SERVERPORT'):
for idx, row in df.iterrows():
filename = row['filename']
opath = DOWNLOAD_DIR + '/' + filename
if os.path.exists(opath):
continue
vitaldb.download(filename, DOWNLOAD_DIR)