PatientCare is essentially a system to improve patients care during their treatment by providing well-being monitoring using a bunch of sensors, either for immediate care or long-term care improvement using data analytics.
IDC Health Insights believes that improving patient experience will soon become a pivotal factor for reducing redundancies in health delivery, improving on patient engagement, and in advancing care compliance
- IDC Report – April 2016 – Perspective: The Future of Patient Experience in Asia/Pacific (Excluding Japan): An Overview of Key Opportunity Areas
This prototype implements enterprise-grade, real-world scenario, by - among others - the usage of LoRa-based communication between wearables (nodes) and gateway in order to remove the dependency of WiFi, and able to cover wide area inside care facility that will increase the feasibility of implementation and reduce cost.
System ArchitectureThis prototypes includes:
1. Wearables
A device wore by patients that constantly monitor their well-being and transmit the data to gateway via LoRa. The prototype uses ESP8266-based microcontroller for the sake of its capability (processing power, RAM, etc) with the built-in WiFi functionality not used. HopeRF RFM95/98 (depends on desired frequency) is used for LoRa functionality. Currently monitored parameters are:
- Heart rate
- Falling detection. Using IMU sensors, the device is able to detect urgent condition when patient is falling and instantly notify nurse/care officer.
- Temperature
2. Gateway
Raspberry Pi 3-based microcomputer with LoRa hat is used as gateway in order to "relay" the data from the nodes to Samsung Artik Cloud.
3. Cloud
This is where all data finally come together and visualized in realtime.
DeploymentAll source code necessary for the system to works are in Github and the links are on the attachment.
1. Wearable
The firmware is developed using Arduino framework for ESP8266 with the help of Platformio build system. So, make sure you already install PlatformIO. The rest is trivial by following common practice of building and uploading firmware with Platformio.
2. Gateway
There are two parts of software for gateway:
- LoRa receiver: C++ based software that receives packet from LoRa sender (node) and spit out any received payload to stdout
- LoRa processing: Process payload from standard output (stdout) and upload the processed payload to Samsung Artik Cloud. It's developed with Node.js
Those software are prepared by Raspbian OS for Raspberry Pi 2/3. To deploy it, let's follow along:
git clone
https://github.com/andriyadi/PatientCare-Gateway
You'll see "start-term.sh" file. That file will be the script to execute in order to start gateway software. Don't start it just yet.
cd
PatientCare-Gateway/LoraProcessing
You'll see "config.js" file. We need to edit this file later.
3. Samsung Artik Cloud
Essentially you can follow along any instruction related to creating a device type and a device for Samsung Artik Cloud. Here are some hints:
a. Creating Device Type
From Artik Dashboard (of course you need to sign-in or sign-up first), click New button for creating device type. Type DEVICE DISPLAY NAME with whatever you want, or simple use "PatientCareWearable" and also type the UNIQUE NAME with for example: "com.yourcompany.patientcaredevice".
On the next screen you should provide manifest for the device type or you can use attached manifest JSON file (Custom Device Type Manifest) by uploading it here:
b. Create Device
Let's create a new device with the device type we just created. You may refer my video below:
c. Test Device using Simulator
Before using a real device, let's try to simulate data publishing using Device Simulator. I made a video for trying it:
d. Get Device Token
From My Artik Cloud page, you should see the newly created device:
Click on the "gear" icon to generate or get device token. You should see this popup.
Note the Device ID and Device Token, we'll use them later.
Your device on Artik Cloud is now ready to receive some data. Let's continue to configure software on Gateway side (Raspberry Pi).
Configure Gateway
Let's revisit "config.js" we see above. Change this part in it:
config.artik = {
mqtt : {
host: "api.artik.cloud",
port: 8883,
clientId: "PatientCareGateway-01",
username: "[USE_YOUR_DEVICE_ID]",
password: "[USE_YOUR_DEVICE_TOKEN]",
protocol: 'mqtts',
//protocolId: 'MQIsdp',
secureProtocol: 'TLSv1_2_method',
},
fifoFile: "/tmp/lora_fifo_artik",
deviceId: "[USE_YOUR_DEVICE_ID]",
subscribedTopic: '/v1.1/actions',
publishTopic: '/v1.1/messages',
activated: true
}
Change "[USE_YOUR_DEVICE_ID]" and "[USE_YOUR_DEVICE_TOKEN]" with the value you retrieve on "Get Device Token" step. Now, you should be safe to start the gateway by executing "start-term.sh" script.
That's it for now. I will keep improving the project, though. So make sure to keep checking it out. Enjoy!
Comments