Contenu connexe
Similaire à Rad Server Industry Template - Connected Nurses Station - Setup Document (20)
Plus de Embarcadero Technologies (20)
Rad Server Industry Template - Connected Nurses Station - Setup Document
- 6.
To add users, use EMSManagementConsole.exe included with RAD Studio 10.2 Tokyo to add User =
nurseuser, with Password = nursepass
From the emsserver.ini, we are running in Single Tenant mode, so we un-comment the
DefaultTenantId=00000000-0000-0000-0000-000000000001
[Server.Tenants]
;# This section defines settings for Single or Multi-Tenant modes.
;#
;# The MultiTenantMode option is used to turn on the Multi-Tenant mode.
;# If the Multi-Tenant mode is turned on, then TenantId and TenantSecret is required to access EMS
Server.
;MultiTenantMode=1
;#
;# Default Tenant is used only in the Single Tenant mode.
DefaultTenantId=00000000-0000-0000-0000-000000000001;
# Define custom cookie name to store TenantId in EMS Console.
;TenantIDCookieName=TenantID
First, use the Tenant tab, and enter your Default Tenant ID and Tenant Secret password: secret
Next, use the Connection tab and Enter your local Host IP address of your running EMS Server. Port =
8080
Click Test Connection, to verify you can connect to EMS.
Copyright © 2017 Embarcadero Technologies, Inc.
- 8.
Note that the Field Name Description is uppercase as it's needed.
You now have two (2) Users created:
Note: You do NOT need to create any Groups, Installations or Push.
Note: For the Installations tab, you do NOT need to add anything. The running apps that connect to
the EMS Server will create the Installations for you.
Check if you can Authenticate with Users “nurseuser” and “test1”.
Select Authenticate tab. Enter User name = nurseuser and Password = nursepass.
Click Login. Verify you can Login. Click OK. Click Log out.
Do the same for Username (Test1, test1).
You can now CLOSE the EMSManagementConsole.
4. Install SSL libraries.
With RAD Studio 10.2 Tokyo, EMS, BaaS and REST clients on iOS, Android, Windows and Mac no longer
need to use the OpenSSL libraries. In 10.2 Tokyo, they will use the native library on each OS.
But the RAD (EMS) Server requires the OpenSSL libraries to support HTTPS requests and sending push
notifications to iOS devices. This will require the Windows OpenSSL libraries.
Copyright © 2017 Embarcadero Technologies, Inc.
- 9. For Windows, I installed the Windows OpenSSL from here:
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/EMS_Push_Notifications
Which tells you to download the latest OpenSSL binaries from: https://www.openssl.org/
For Win32, I used https://www.openssl.org/related/binaries.html
And selected “Choose OpenSSL for Windows.”
http://slproweb.com/products/Win32OpenSSL.html
Using the latest Win32 OpenSSL v1.0.2k Light and letting the installer add the libs to my Windows path
worked OK for me.
Note: To send EMS Push notification messages to the registered devices in your EMS Server, you need
to install the OpenSLL libraries in the system where the EMS Server runs.
Note: You need to install the 32-bit or 64-bit OpenSSL binary, depending on the target platform of the
EMS Server.
If you do not install the OpenSSL libraries and use the EMS Server to send push notification messages
to your registered device, the EMS Server shows the following error exception in the EMS Server
Window log:
{"Error":{"Type":"Other","Exception":"EIdOSSLCouldNotLoadSSLLibrary","Message":"Could
not load SSL library.","Thread":5576}}
3. Setup Push Notification Messaging Service for Android and iOS for EMS Backend Service
The Remote Notifications for EMS we are using with these applications requires:
To allow your applications to receive Remote Notifications, you need:
● For Android apps, a new project on Google Developer Console.
● For iOS apps, a new App-ID on Apple Developer Program.
The complete steps are here to set up the messaging service for both Android and iOS apps:
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Setting_Up_the_Messaging_Service
For ANDROID,
Follow these steps:
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Setting_Up_the_Messaging_Service
Create a new Android project and Server Key in the Google Developer Console according to the
instructions at http://developer.android.com/google/gcm/gs.html
Note: Firebase Cloud Messaging (FCM) is the new version of Google Cloud Messaging (GCM). It inherits
the reliable and scalable GCM infrastructure, plus new features!
Copyright © 2017 Embarcadero Technologies, Inc.
- 17. Running the Nurses Station Applications
1. Start the EMS Server.
Open NurseProjectGroup (from C:NurseStation)
Highlight NurseStationResourcePackage.bpl | right-click | Run without Debugging
The EMS Server Starts:
Note: As a check, verify both your Android and iOS app can connect to the Windows EMS Server IP
and port. I use a “Ping” program from AppStore and Google Play Store, or open a browser on Android
or iOS and enter http://192.168.1.20:8080/version and verify the EMS version JSON gets returned, like
this:
2. From the Nurses Room (beacon), on an iOS Device (iPad) run the Nurse application
(NurseApp_PatientVitals):
When the Nurse App connects to EMS, then you will see the Record Patient Vitals screen.
EMS displays:
{"Request":{"Resource":"Users","Endpoint":"LoginUser","Method":"POST","User":"(blank)","Time":"
4/10/2015 6:29:46 PM","Thread":6024}}
{"Request":{"Resource":"Installations","Endpoint":"AddInstallation","Method":"POST","User":"8B9
8E8C3-B8BF-4A93-95A0-53A064CAD6B2","Time":"4/10/2015 6:29:46 PM","Thread":2996}}
Note: If the Nurse app cannot connect to EMS, it will shut down and exit.
Copyright © 2017 Embarcadero Technologies, Inc.
- 20.
{"Request":{"Resource":"NurseStation","Endpoint":"PostSendMessageNurse","Method":"POST","Use
r":"611F0317-23D2-48C7-9D54-F4ED71665A52","Time":"4/10/2015 7:00:43 PM","Thread":4724}}
{"Push":{"action":"Queued","type":"TApnsNotification","Thread":5592}}
{"Push":{"action":"Sent","type":"TApnsNotification","Thread":5360}}
{"Request":{"Resource":"Users","Endpoint":"GetUser","Method":"GET","User":"8B98E8C3-B8BF-4A93
-95A0-53A064CAD6B2","Time":"4/10/2015 7:00:47 PM","Thread":5488}}
8. Next, leaving your Patient app by the Hospital Hall, walk back to the Nurses Application. The Nurses
Application shows that you have arrived to the Hospital (with the Push Notification).
Important Note: Click in the ComboBox above the “Current Patient Heartrate” box to activate the
Push Notification pop-up list, like this:
Select your Patient Name, click Done.
You Patient Name (lDescription) gets added to the ComboBox, like this:
9. Walk back to the Hospital Hall and get your Patient App. The Patient App now says: “You are now
checked in. The nurse is ready to see you.”
Copyright © 2017 Embarcadero Technologies, Inc.
- 21.
10. With your Patient App from the Hospital Hall, walk back to the Nurse's Room.
11. When your Patient App gets NEAR to the Nurse's Room beacon, the Nurses App will get the
message “Al Mannarino has entered the room”.
12. If you do NOT have a BT LE Weight Scale, you will click on editbox “Current Patient Weight”, and
manually enter the Patient’s weight. If you have the Weight Scale, then you can click the “Connect to
Device” for the Pateint Weight.
Then click “SaveData” for the weight. Click OK.
13. Next, using your BT LE HeartRate Sensor, (I used a Zephyr, but most BT LE HRM Sensors should
work). For demo purposes, it’s OK to use two fingers over the HRM contacts so the HRM sends Beats
Per Minute (BPM) Data. For example:
Copyright © 2017 Embarcadero Technologies, Inc.
- 23.
15. On the EMS SERVER, you can see all the REST API calls.
{"Request":{"Resource":"Users","Endpoint":"GetUser","Method":"GET","User":"8B98E8C3-B8BF-4A93
-95A0-53A064CAD6B2","Time":"4/10/2015 8:24:11 PM","Thread":7716}}
{"Request":{"Resource":"NurseStation","Endpoint":"PostAddPatientData","Method":"POST","User":"
8B98E8C3-B8BF-4A93-95A0-53A064CAD6B2","Time":"4/10/2015 8:34:39 PM","Thread":6316}}
16. Lastly, using the InterBase database IBConsole, looking into the InterBase database
NURSESDB.IB, you will see your Patient ID, Heart_Rate and your Weight, all saved securely to disk in
the InterBase database!
This ends the Nurses Station Setup and Demonstration! Congratulations!
Copyright © 2017 Embarcadero Technologies, Inc.