API section
Medical equipment
The Medical equipment module: HL7 v2 (MLLP) and ASTM E1381/E1394 analyzers. Results kept for 30 days, long polling and acknowledgement (event lab.result), analyzer orders (worklist) and their status, an analyzer emulator. Needs the lab module in the key (except the emulator).
| POST | /api/v1/lab/results/ack | Acknowledge results |
| GET | /api/v1/lab/orders | Orders |
| POST | /api/v1/lab/orders | Analyzer order |
| POST | /api/v1/lab/analyzers/{number}/resend | Resend waiting orders |
| POST | /api/v1/lab/analyzers/{number}/emulate | Result from the emulator |
| GET | /api/v1/lab/results | Results |
| GET | /api/v1/lab/results/{id} | Result |
| GET | /api/v1/lab/analyzers | Analyzers |
| DELETE | /api/v1/lab/orders/{analyzer}/{sampleId} | Delete an order |
Acknowledge results#
/api/v1/lab/results/ackYour software saved the results; they no longer appear in undelivered
Request body application/json required
Fields · Ack
idsarray of string uuid
{
"ids": [
"3f6c1d9e-1b2a-4c55-9e0d-6a1f0c2b7d11"
]
}Response 200 application/json
Fields · Acked
acknowledgedinteger int32
Errors — problem+json with a code field, see error codes.
Request example
curl -X POST 'http://localhost:7790/api/v1/lab/results/ack' \
-H 'Content-Type: application/json' \
--data '{"ids":["3f6c1d9e-1b2a-4c55-9e0d-6a1f0c2b7d11"]}'curl -X POST 'https://cloud.hw-connector.ru/agent/api/v1/lab/results/ack' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42' \
-H 'Content-Type: application/json' \
--data '{"ids":["3f6c1d9e-1b2a-4c55-9e0d-6a1f0c2b7d11"]}'Orders#
/api/v1/lab/ordersNewest first; status is QUEUED, SENT or DONE
Parameters
| Name | In | Type | Description |
|---|---|---|---|
analyzer | query | integer int32 | |
status | query | string | |
limit | query | integer int32 |
Response 200 application/json
Fields · OrderList
Errors — problem+json with a code field, see error codes.
Request example
curl 'http://localhost:7790/api/v1/lab/orders'curl 'https://cloud.hw-connector.ru/agent/api/v1/lab/orders' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'Analyzer order#
/api/v1/lab/ordersWorklist: какие тесты сделать по образцу. HL7 — агент сразу передаёт ORM^O01; ASTM — передаёт заданием или отвечает им на запрос анализатора по штрихкоду. status: SENT, QUEUED (ждёт связи или запроса), DONE (пришёл результат)
Request body application/json required
Fields · OrderRequest
analyzerinteger int32sampleIdstringpatientPatient4 fields · Patient
idstringnamestringbirthDatestringsexstring
testsarray of stringprioritystring
{
"analyzer": 1,
"sampleId": "string",
"patient": {
"id": "string",
"name": "string",
"birthDate": "string",
"sex": "string"
},
"tests": [
"string"
],
"priority": "string"
}Response 200 application/json
Fields · Order
analyzerinteger int32sampleIdstringpatientPatient4 fields · Patient
idstringnamestringbirthDatestringsexstring
testsarray of stringprioritystringstatusstringcreatedAtstring date-timesentAtstring date-time
Errors — problem+json with a code field, see error codes.
Request example
curl -X POST 'http://localhost:7790/api/v1/lab/orders' \
-H 'Content-Type: application/json' \
--data '{"analyzer":1,"sampleId":"string","patient":{"id":"string","name":"string","birthDate":"string","sex":"string"},"tests":["string"],"priority":"string"}'curl -X POST 'https://cloud.hw-connector.ru/agent/api/v1/lab/orders' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42' \
-H 'Content-Type: application/json' \
--data '{"analyzer":1,"sampleId":"string","patient":{"id":"string","name":"string","birthDate":"string","sex":"string"},"tests":["string"],"priority":"string"}'Resend waiting orders#
/api/v1/lab/analyzers/{number}/resendAll analyzer orders with status QUEUED
Parameters
| Name | In | Type | Description |
|---|---|---|---|
numberrequired | path | integer int32 |
Response 200 application/json
Fields · Resent
queuedinteger int32
Errors — problem+json with a code field, see error codes.
Request example
curl -X POST 'http://localhost:7790/api/v1/lab/analyzers/1/resend'curl -X POST 'https://cloud.hw-connector.ru/agent/api/v1/lab/analyzers/1/resend' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'Result from the emulator#
/api/v1/lab/analyzers/{number}/emulateТолько эмулятор анализатора: результат по образцу без задания, приходит событием lab.result как от настоящего
Parameters
| Name | In | Type | Description |
|---|---|---|---|
numberrequired | path | integer int32 |
Request body application/json
Fields · Emulate
sampleIdstringpatientPatient4 fields · Patient
idstringnamestringbirthDatestringsexstring
testsarray of string
{
"sampleId": "string",
"patient": {
"id": "string",
"name": "string",
"birthDate": "string",
"sex": "string"
},
"tests": [
"string"
]
}Response 200 application/json
Fields · Result
validbooleanerrorsarray of Issue8 fields · Issue
codestringseveritystringvalues:ERRORWARNINGatstring date-timeregisterinteger int32terminalinteger int32fdinteger int64amountinteger int64messagestring
warningsarray of Issue8 fields · Issue
codestringseveritystringvalues:ERRORWARNINGatstring date-timeregisterinteger int32terminalinteger int32fdinteger int64amountinteger int64messagestring
Errors — problem+json with a code field, see error codes.
Request example
curl -X POST 'http://localhost:7790/api/v1/lab/analyzers/1/emulate' \
-H 'Content-Type: application/json' \
--data '{"sampleId":"string","patient":{"id":"string","name":"string","birthDate":"string","sex":"string"},"tests":["string"]}'curl -X POST 'https://cloud.hw-connector.ru/agent/api/v1/lab/analyzers/1/emulate' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42' \
-H 'Content-Type: application/json' \
--data '{"sampleId":"string","patient":{"id":"string","name":"string","birthDate":"string","sex":"string"},"tests":["string"]}'Results#
/api/v1/lab/resultsСтарые первыми. undelivered=true — ещё не подтверждённые МИС (забрать и подтвердить POST /api/v1/lab/results/ack); since — полученные позже (ISO 8601); wait — ждать новый результат до стольких секунд (длинный опрос, до 60); raw=true — с исходным сообщением анализатора
Parameters
| Name | In | Type | Description |
|---|---|---|---|
analyzer | query | integer int32 | |
sampleId | query | string | |
since | query | string date-time | |
undelivered | query | boolean | |
raw | query | boolean | |
limit | query | integer int32 | |
wait | query | integer int32 |
Response 200 application/json
Fields · ResultList
resultsarray of Result3 fields · Result
validbooleanerrorsarray of Issue8 fields · Issue
codestringseveritystringvalues:ERRORWARNINGatstring date-timeregisterinteger int32terminalinteger int32fdinteger int64amountinteger int64messagestring
warningsarray of Issue8 fields · Issue
codestringseveritystringvalues:ERRORWARNINGatstring date-timeregisterinteger int32terminalinteger int32fdinteger int64amountinteger int64messagestring
Errors — problem+json with a code field, see error codes.
Request example
curl 'http://localhost:7790/api/v1/lab/results'curl 'https://cloud.hw-connector.ru/agent/api/v1/lab/results' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'Result#
/api/v1/lab/results/{id}With the analyzer's original message
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string uuid |
Response 200 application/json
Fields · Result
validbooleanerrorsarray of Issue8 fields · Issue
codestringseveritystringvalues:ERRORWARNINGatstring date-timeregisterinteger int32terminalinteger int32fdinteger int64amountinteger int64messagestring
warningsarray of Issue8 fields · Issue
codestringseveritystringvalues:ERRORWARNINGatstring date-timeregisterinteger int32terminalinteger int32fdinteger int64amountinteger int64messagestring
Errors — problem+json with a code field, see error codes.
Request example
curl 'http://localhost:7790/api/v1/lab/results/3f6c1d9e-1b2a-4c55-9e0d-6a1f0c2b7d11'curl 'https://cloud.hw-connector.ru/agent/api/v1/lab/results/3f6c1d9e-1b2a-4c55-9e0d-6a1f0c2b7d11' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'Analyzers#
/api/v1/lab/analyzersProtocol, connection, messages received and orders waiting to be sent
Response 200 application/json
Fields · AnalyzerList
licensedbooleananalyzersarray of AnalyzerInfo7 fields · AnalyzerInfo
numberinteger int32namestringtypestringprotocolstringactivebooleanconnectedbooleaninfomap → any value
Errors — problem+json with a code field, see error codes.
Request example
curl 'http://localhost:7790/api/v1/lab/analyzers'curl 'https://cloud.hw-connector.ru/agent/api/v1/lab/analyzers' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'Delete an order#
/api/v1/lab/orders/{analyzer}/{sampleId}Cancel a test: the analyzer will no longer get it in reply to a query
Parameters
| Name | In | Type | Description |
|---|---|---|---|
analyzerrequired | path | integer int32 | |
sampleIdrequired | path | string |
Response 200
No body.
Errors — problem+json with a code field, see error codes.
Request example
curl -X DELETE 'http://localhost:7790/api/v1/lab/orders/1/3f6c1d9e-1b2a-4c55-9e0d-6a1f0c2b7d11'curl -X DELETE 'https://cloud.hw-connector.ru/agent/api/v1/lab/orders/1/3f6c1d9e-1b2a-4c55-9e0d-6a1f0c2b7d11' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'