Software apps and online services
Having been a nurse for the last 8 years and having my wife as a patient when having my son, I have always found the call bell system to be antiquated and causes delays to responding to patients. I say antiquated because nurses are using cellphone for communication and secure messing within the hospital now and when a patient uses the call bell the answering console is often located at the nurses station, often where no nurses are sitting because they are in patients's rooms. This leads me into the delays, first being that often no staff are at the station to answer the call bell or so busy they often don't answer because they are busy with other tasks.
Now, let's say someone is able to answer the call bell they then have to try and assign the task, based on the patients request, to the appropriate person. That could be a nurse, nursing assistants or even anyone that works for the hospital depending on the request. Let's say the patient asks for the TV remote anyone can do that, for bathroom assistance the nursing assistant might be the best person and for pain medication the nurse would be the best person for the request.
Now I know when making projects I should truly focus on one thing and make it perfect however I am doing this more for a proof of concept. So I am having it do many things with poor coding, because I am a nurse and not a coder. Most of my code is based off of searches for what I was trying to do. I hope to be able to get my proof of concept up and running the way I want and get someone to help improve my code and setup. So here is what the set up currently can do.
I am having the skill be triggered one of two ways. Via an amazon echo by "Alexa, Ask my nurse" or by pressing the call bell button on a Raspberry Pi (I will switch this to a C.H.I.P in the future) using the Alexa Voice Service. It can handle requests such as "can I have a pillow", "I need to use the bathroom", "I am having pain", "I need a blanket" or even allow the nurse to "call a code blue". As time goes on I will improve on these and make them better for interacting with the patients. This area will always be improving with time to try and ensure all requests by patients can be accepted by the skill. The request is then sent to the appropriate person via topics setup in AWS SNS.
The part of the call bell system that runs off a Raspberry Pi, currently, is using the GPIO to trigger the AVS for the patient to make a request but I also have a GPIO as a trigger for the bed alarm. The bed alarm is built into hospital beds and works as a normally open circuit and closes when the patient attempts to get out of bed. This isn't the best practice however the GPIO for the bed alarm will trigger the code to play a per-recorded WAV file to send to Alexa Voice Service to a Alexa Voice Skill this will send a notification to the nurse via text message and play an alert on the overhead alert system. It will also play a response message for the patient to remain in the bed until the nurse arrives.
Another part of the system is the overhead alert system which will be running off a C.H.I.P. This will be connected to the floors overhead loudspeaker system. This will allow the system to overhead things like "Bathroom assistant is need in Room 124B" or emergencies such as "Code Blue Room 124B" which can be set off by saying "Alexa ask my nurse to call a code blue".
Again I know this coding isn't neat looking and I am sure I have many poor practices however I just happy to have a working proof of concept. I hope that I can fine some better ways to run parts of my code.
Right now I have everything listed as room 124B, this is because Amazon doesn't allow you to see device ID's. Once or if they do I will be able to connect a device ID to a room number. Until then the only way I could do this is to code a room number into the room based Raspberry Pi to send to IOT to get into lambda. Maybe in the future I will do this if amazon doesn't allow device ID's.
I would like to add a log in the keep a documentation on when patient requests were made for quality improvement purposes.
Right now I have the RPi set up that you have to push and hold the GPIO, I would like to have the RPi be pressed to trigger the welcome intent of skill, "How can your nurse help you?" and then listening and detect when the request is finished. I know trigger words aren't allow by Alexa Voice Service however it doesn't have anything against recording until the request is finished. This can also be used once the bed alarm goes off by saying. "Please remain in bed a nurses is coming to assist you, is there something you need" and start the listening process. This process is useful for a patient that might be elderly and unable to following commands very well.
To set up the project you will first need to set up your amazon alexa skills. You will have to make 2 skills one which is for "Ask My Nurse" This skill is for the patient to interact with. The second skill is "Ask Overhead" and this is used by the "C.H.I.Ps" that are running code based off pre-recored WAV files. The skill intent and utterances can be found in my Github file.
The My Nurse skill slots are:
The Overhead skill slots are:
Next you can make two lambda scripts one is for the callbell and one is for the overhead system. Lambda code can be found in my Github folder.
Add new lambda project and search "alexa." Select "alexa-skills-kit-color-expert" and click next.
This ensures that the alexa skill can connect to the lambda script.
Name the skill, I named mine overhead and my nurse. Select Node.js 4.3 and add the code.
After adding your code set your role as shown.
It will open up a new window and setup as show below.
Once this is all setup you will need to go into your lambda code and add in custom endpoints such as your IOT and SNS.
You need to ensure you set up your Amazon IAM policies so everything can talk to each other. I added policies to the "lambda_basic_execution" role as show below to get everything talking to each other. Just click attach policy and seach the policy below.
You will need to set up the SNS topics. I have three set up: Nurse, Nursinng Assistant, All Staff.
Set up Amazon IOT and setup your C.H.I.P and Raspberry Pi.
Create a resource:
Name your device:
View your thing:
Click your thing:
Click "connect a device".
Download all 3 files however you will only need the private key and certificate.
You will add these two certs to your Pi or Chip in the next step.
You can follow the read me in the GitHub folder to set up the CHIP and Raspberry Pi, it is based off of code and currently is his read me until I get time to update it to my code. You will need to set up Amazon Voice Service for the Raspberry Pi and CHIP which Sam writes about and will also need to install two more things on the C.H.I.P on top of what Sam uses.
sudo apt-get install mpg321 pip install paho-mqtt
I will continue to work on this project to improve it and see what it turns into. If you have any questions feel free to reach out.