WebSocket
Retrieving Observations from Kligo synchronously using a WebSocket client.
Server
ws://localhost:63336/
Channel
There is only one channel you can subscribe to: v3/Observation
The Channel v3/Observation
provides Observation resources as defined in the FHIR STU3 release in real time.
Here are two examples of payload you can retrieve from this channel.
Depending on the device you are using the observation can look a bit different:
simple: When you use a simple device like a weight scale or a thermometer for instance, you will get only one simple measurement attached to the observation (e.g. weight for the scale or temperature for the thermometer). Therefore you can directly access the measurement in the
valueQuantity
property.composed: When you use a pulse oximeter or a blood pressure monitor for instance, you will get two or three different kinds of measurements (e.g. heart rate and spO2 for the pulse oximeter or systolic, diastolic blood pressure for the blood pressure monitor). Therefore the measurements are gathered in the
component
property.
For more details on how to retrieve information from the payload please refer to the schema section.
Schema
Measurements use the Observation schema as defined in the FHIR STU3 release:
Here are some of the noticeable properties:
property
description
valueQuantity
valueQuantity.system
defines the system defining the previous code
valueQuantity.unit
defines the unit in which the quantity is expressed
i.e. C for a body temperature
valueQuantity.value
defines the actual value of the quantity i.e. 37 for a body temperature
device
device.reference
defines the id of the device used to take the measurement
i.e. 5d1a2fefa37f4d0017966643
device.display
defines the type of device used to take the measurement
i.e. thermometer
effectiveDateTime
represents the time at which the measurement was taken
i.e. 2019-12-10T14:08:48.645Z
code
code.coding
describes what the measure is and how we can reference it in a specific system.
code.coding.code
describes the code used to define the measurement
i.e. 8310-5
code.coding.system
defines the system related to the code
i.e. http://loinc.org
code.coding.display
a human readable version of the code
Receiving events from Kligo
Here is an example for listening to Observation using a simple web socket javascript client:
A working version of this example can be found here.
Last updated