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:
var socket =io('http://localhost:63336');socket.on('fhir',function (data) {console.log(data); });
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.