💫Socket.IO
Retrieve observation from Kligo synchronously using Socket.IO client.
Kligo embeds a Socket.IO server. It can accessed on port 63336 on the user's computer. You can register a client to this server in order to receive the observations when they are created.
Here is an example for listening to data points using a javascript Socket.IO client:
A working version of this example can be found here.
Socket.IO clients have been implemented in most languages and can be easily integrated to any project.
Emitting events
There are one type of event emitted from this socket:
'fhir'
: this event is emitted every time an observation is created in Kligo. There are two types of Observation that can be received : simple and multiple. This dpends on the the measurement that gets the device.
Simple FHIR Observation
The type of observation you can get when you use a simple device like weight scale or thermometer.
For more details on the observation format, please refer to the Observation of FHIR model.
Multiple FHIR Observation
When you are using a pulse oximeter or a blood pressure monitor, you get two or three measurement. We decide to gather the observations and put them in the component section.
Receiving events
The socket is able to receive events from a client.
There are two types of events that the socket can receive :
'ekuoreStartRecording'
: this event triggers the recording. Kligo expects you to pass the SSID of the device when firing this event.'ekuoreStopRecording'
: this event stopping the recording
here is an example for starting the recording from the client.
See an example code here.
Last updated