Difference between revisions of "Internal GCAPI"
m |
|||
(11 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
http://[como-URL]/api/[api-subsystem].php?passcode=[my-passcode]&op=[operation]&encoding=[json|xml] | http://[como-URL]/api/[api-subsystem].php?passcode=[my-passcode]&op=[operation]&encoding=[json|xml] | ||
The como URL and passcode are from the results of a [[GCManage API]] remote login call. The como URL is what GCManage determines is the path to the como system. This can either be proxied or the direct IP of the system. passcode is the authentication mechanism used by GCAPI -- it is a code generated every 24 hours by a system and reported to GCManage. subsystem names the subsystem you want to work on and operation defines the actual operation to perform. Each operation can have a number of other parameters that will be passed via other parameters in the URL. | The como URL and passcode are from the results of a [[Internal GCManage API]] remote login call. The como URL is what GCManage determines is the path to the como system. This can either be proxied or the direct IP of the system. passcode is the authentication mechanism used by GCAPI -- it is a code generated every 24 hours by a system and reported to GCManage. subsystem names the subsystem you want to work on and operation defines the actual operation to perform. Each operation can have a number of other parameters that will be passed via other parameters in the URL. | ||
= Local Application Authentication = | = Local Application Authentication = | ||
Line 52: | Line 52: | ||
= API Subsystems = | = API Subsystems = | ||
== History API == | == History API == | ||
The [[ | The [[InternalHistory API Subsystem|History subsystem]] allows you to fetch ADL and wellness data from a system. Most of the operations take the same parameters and return different data. | ||
See [[History API Subsystem|documentation]] for details or click an specific History operation below | See [[Internal History API Subsystem|documentation]] for details or click an specific History operation below | ||
=== [[History API Subsystem#bp|Blood Pressure]] === | === [[Internal History API Subsystem#bp|Blood Pressure]] === | ||
Fetches blood pressure sensor history from the system | Fetches blood pressure sensor history from the system | ||
=== [[History API Subsystem#weight|Weight Scale]] === | === [[Internal History API Subsystem#weight|Weight Scale]] === | ||
Fetches scale history from the system | Fetches scale history from the system | ||
=== [[History API Subsystem#temp|Temperature Sensor]] === | === [[Internal History API Subsystem#temp|Temperature Sensor]] === | ||
Fetches temperature sensor history from the system | Fetches temperature sensor history from the system | ||
=== [[History API Subsystem#bed|Bed Sensor]] === | === [[Internal History API Subsystem#bed|Bed Sensor]] === | ||
Fetches bed sensor history from the system | Fetches bed sensor history from the system | ||
=== [[History API Subsystem#oxi|Oximeter]] === | === [[Internal History API Subsystem#oxi|Oximeter]] === | ||
Fetches oximeter history from the system | Fetches oximeter history from the system | ||
=== [[History API Subsystem#motion|Motion]] === | === [[Internal History API Subsystem#motion|Motion]] === | ||
Fetches motion sensor history from the system | Fetches motion sensor history from the system | ||
=== [[History API Subsystem#gluc|Glucometer]] === | === [[Internal History API Subsystem#gluc|Glucometer]] === | ||
Fetches glucometer history from the system | Fetches glucometer history from the system | ||
=== [[History API Subsystem#door|Door Sensor]] === | === [[Internal History API Subsystem#door|Door Sensor]] === | ||
Fetches door sensor history from the system | Fetches door sensor history from the system | ||
=== [[History API Subsystem#cid|Caller ID]] === | === [[Internal History API Subsystem#cid|Caller ID]] === | ||
Fetches caller ID history from the system | Fetches caller ID history from the system | ||
== Assign API == | == Assign API == | ||
The [[Assign API Subsystem|Assign subsystem]] allows you to assign and delete wellness readings from a system. | The [[Internal Assign API Subsystem|Assign subsystem]] allows you to assign and delete wellness readings from a system. | ||
See [[Assign API Subsystem|documentation]] for details or click an specific Assign operation below | See [[Internal Assign API Subsystem|documentation]] for details or click an specific Assign operation below | ||
=== [[Assign API Subsystem#assign|Assign Reading]] === | === [[Internal Assign API Subsystem#assign|Assign Reading]] === | ||
Assigns a wellness reading to a resident | Assigns a wellness reading to a resident | ||
=== [[Assign API Subsystem#delete|Delete Reading]] === | === [[Internal Assign API Subsystem#delete|Delete Reading]] === | ||
Marks a wellness reading as deleted | Marks a wellness reading as deleted | ||
== Caregiver API == | == Caregiver API == | ||
The [[Caregiver API Subsystem|Caregiver subsystem]] allows you to create, read, update, and delete caregivers from a system. | The [[Internal Caregiver API Subsystem|Caregiver subsystem]] allows you to create, read, update, and delete caregivers from a system. | ||
See [[Caregiver API Subsystem|documentation]] for details or click an specific Caregiver operation below | See [[Internal Caregiver API Subsystem|documentation]] for details or click an specific Caregiver operation below | ||
=== [[Caregiver API Subsystem#create|Create]] === | === [[Internal Caregiver API Subsystem#create|Create]] === | ||
Create a caregiver | Create a caregiver | ||
=== [[Caregiver API Subsystem#read|Read]] === | === [[Internal Caregiver API Subsystem#read|Read]] === | ||
Reads a single caregiver or all caregivers | Reads a single caregiver or all caregivers | ||
=== [[Caregiver API Subsystem#update|Update]] === | === [[Internal Caregiver API Subsystem#update|Update]] === | ||
Updates an existing caregiver | Updates an existing caregiver | ||
=== [[Caregiver API Subsystem#delete|Delete]] === | === [[Internal Caregiver API Subsystem#delete|Delete]] === | ||
Deletes an existing caregiver | Deletes an existing caregiver | ||
== Medication API == | == Medication API == | ||
The [[Medication API Subsystem|Medication subsystem]] allows you to manage medication and schedules from a system. | The [[Internal Medication API Subsystem|Medication subsystem]] allows you to manage medication and schedules from a system. | ||
See [[Medication API Subsystem|documentation]] for details or click an specific Medication operation below | See [[Internal Medication API Subsystem|documentation]] for details or click an specific Medication operation below | ||
=== [[Medication API Subsystem#createPrescription|Create Prescription]] === | === [[Internal Medication API Subsystem#createPrescription|Create Prescription]] === | ||
Create a prescription | Create a prescription | ||
=== [[Medication API Subsystem#readPrescription|Read Prescription]] === | === [[Internal Medication API Subsystem#readPrescription|Read Prescription]] === | ||
Reads a single prescription or all prescriptions | Reads a single prescription or all prescriptions | ||
=== [[Medication API Subsystem#updatePrescription|Update]] === | === [[Internal Medication API Subsystem#updatePrescription|Update]] === | ||
Updates an existing prescription | Updates an existing prescription | ||
=== [[Medication API Subsystem#deletePrescription|Delete]] === | === [[Internal Medication API Subsystem#deletePrescription|Delete]] === | ||
Deletes an existing prescription | Deletes an existing prescription | ||
=== [[Medication API Subsystem#storePrescriptionPic|Store Picture]] === | === [[Internal Medication API Subsystem#storePrescriptionPic|Store Picture]] === | ||
Stores a picture for a prescription | Stores a picture for a prescription | ||
=== [[Medication API Subsystem#createSchedule|Create Prescription Schedule]] === | === [[Internal Medication API Subsystem#createSchedule|Create Prescription Schedule]] === | ||
Create a prescription schedule | Create a prescription schedule | ||
=== [[Medication API Subsystem#readSchedule|Read Prescription Schedule]] === | === [[Internal Medication API Subsystem#readSchedule|Read Prescription Schedule]] === | ||
Reads a single prescription schedule or all prescription schedules | Reads a single prescription schedule or all prescription schedules | ||
=== [[Medication API Subsystem#updateSchedule|Update Prescription Schedule]] === | === [[Internal Medication API Subsystem#updateSchedule|Update Prescription Schedule]] === | ||
Updates an existing prescription schedule | Updates an existing prescription schedule | ||
=== [[Medication API Subsystem#deleteSchedule|Delete Prescription Schedule]] === | === [[Internal Medication API Subsystem#deleteSchedule|Delete Prescription Schedule]] === | ||
Deletes an existing prescription schedule | Deletes an existing prescription schedule | ||
=== [[Medication API Subsystem#setCompliance|Set Compliance]] === | === [[Internal Medication API Subsystem#setCompliance|Set Compliance]] === | ||
Set compliance on an existing prescription schedule | Set compliance on an existing prescription schedule | ||
=== [[Medication API Subsystem#checkCompliance|Check Compliance]] === | === [[Internal Medication API Subsystem#checkCompliance|Check Compliance]] === | ||
Check compliance on an existing prescription schedule | Check compliance on an existing prescription schedule | ||
=== [[Medication API Subsystem#backfillCompliance|Backfill Compliance]] === | === [[Internal Medication API Subsystem#backfillCompliance|Backfill Compliance]] === | ||
Backfill compliance on an existing prescription schedule | Backfill compliance on an existing prescription schedule | ||
=== [[Medication API Subsystem#RxLookup|Lookup Rx]] === | === [[Internal Medication API Subsystem#RxLookup|Lookup Rx]] === | ||
Finds Rx via FDA NDC Directory | Finds Rx via FDA NDC Directory | ||
== ActivityLog API == | |||
The [[Internal ActivityLog API Subsystem|Activity Log subsystem]] allows you to view a log of touchscreen events | |||
=== [[Internal ActivityLog API Subsystem#read|Read]] === | |||
Read entries out of the log | |||
=== [[Internal ActivityLog API Subsystem#add|Add]] === | |||
Add entries to the log | |||
== TODO == | == TODO == | ||
Line 143: | Line 150: | ||
* rule api | * rule api | ||
* system api | * system api | ||
* activitylog api | |||
* notification api | |||
* calendar api | |||
* letters api | |||
= Other Resources = | = Other Resources = | ||
* [https://github.com/ngharo/gc-javascript-api Experimental JavaScript library] | * [https://github.com/ngharo/gc-javascript-api Experimental JavaScript library] |
Latest revision as of 22:00, 19 July 2017
GCAPI gives developers access to the core tools provided by a GCManage server and como systems. A variety of tasks can be performed by making simple web service calls.
Calling GCAPI
A basic call to GCAPI looks like this:
http://[como-URL]/api/[api-subsystem].php?passcode=[my-passcode]&op=[operation]&encoding=[json|xml]
The como URL and passcode are from the results of a Internal GCManage API remote login call. The como URL is what GCManage determines is the path to the como system. This can either be proxied or the direct IP of the system. passcode is the authentication mechanism used by GCAPI -- it is a code generated every 24 hours by a system and reported to GCManage. subsystem names the subsystem you want to work on and operation defines the actual operation to perform. Each operation can have a number of other parameters that will be passed via other parameters in the URL.
Local Application Authentication
Applications may also want to call the API without an associated GCManage account. GrandCare will provide each application an "application key" that allows for a simple way to fetch the required passcodes. To do this, call the API via "localhost" using the following URL:
http://[como-URL]/api/system.php?op=getpasscodes&appkey=[gc-provided-app-key]
This will return the required passcodes for making authenticated calls to the API. See the section on the System API Subsystem for more information about the getpasscodes API call.
Results From GCAPI
The response from GCAPI will either be encoded in JSON or XML, depending on the requested encoding. By default the response will be encoded in XML.
XML Results
By default, GCAPI responds to commands by returning an XML document. Here is the most basic success result:
<gcapi> <result>SUCCESS</result> </gcapi>
The root XML element for all GCAPI results is gcapi. The other always present element is result, which contains either SUCCESS or FAILURE, depending on whether the call succeeded or not. A failure response also contains the fail-message element, which gives the reasons for the failure. For example:
<gcapi> <result>FAILURE</result> <fail-message>Invalid credentials for API call</fail-message> </gcapi>
This result would occur if invalid credentials were supplied during the GCAPI call.
JSON Results
GCAPI can also respond by returning a JSON object. Here is the most basic success result:
{ "gcapi": { "result": "SUCCESS" } }
A failure encoded in JSON looks like:
{ "gcapi": { "result": "FAILURE", "fail-message": "Invalid credentials for API call" } }
API Subsystems
History API
The History subsystem allows you to fetch ADL and wellness data from a system. Most of the operations take the same parameters and return different data.
See documentation for details or click an specific History operation below
Blood Pressure
Fetches blood pressure sensor history from the system
Weight Scale
Fetches scale history from the system
Temperature Sensor
Fetches temperature sensor history from the system
Bed Sensor
Fetches bed sensor history from the system
Oximeter
Fetches oximeter history from the system
Motion
Fetches motion sensor history from the system
Glucometer
Fetches glucometer history from the system
Door Sensor
Fetches door sensor history from the system
Caller ID
Fetches caller ID history from the system
Assign API
The Assign subsystem allows you to assign and delete wellness readings from a system.
See documentation for details or click an specific Assign operation below
Assign Reading
Assigns a wellness reading to a resident
Delete Reading
Marks a wellness reading as deleted
Caregiver API
The Caregiver subsystem allows you to create, read, update, and delete caregivers from a system.
See documentation for details or click an specific Caregiver operation below
Create
Create a caregiver
Read
Reads a single caregiver or all caregivers
Update
Updates an existing caregiver
Delete
Deletes an existing caregiver
Medication API
The Medication subsystem allows you to manage medication and schedules from a system.
See documentation for details or click an specific Medication operation below
Create Prescription
Create a prescription
Read Prescription
Reads a single prescription or all prescriptions
Update
Updates an existing prescription
Delete
Deletes an existing prescription
Store Picture
Stores a picture for a prescription
Create Prescription Schedule
Create a prescription schedule
Read Prescription Schedule
Reads a single prescription schedule or all prescription schedules
Update Prescription Schedule
Updates an existing prescription schedule
Delete Prescription Schedule
Deletes an existing prescription schedule
Set Compliance
Set compliance on an existing prescription schedule
Check Compliance
Check compliance on an existing prescription schedule
Backfill Compliance
Backfill compliance on an existing prescription schedule
Lookup Rx
Finds Rx via FDA NDC Directory
ActivityLog API
The Activity Log subsystem allows you to view a log of touchscreen events
Read
Read entries out of the log
Add
Add entries to the log
TODO
assign apicaregiver api- carenote api
- configure api
- device api
history api- log api
- media api
- medication api
- message api
- pin api
- resident api
- rule api
- system api
- activitylog api
- notification api
- calendar api
- letters api