Difference between revisions of "Internal History API Subsystem"

From GrandCare Systems
Jump to navigation Jump to search
Line 1: Line 1:
== History ==
The History subsystem allows you to fetch ADL and wellness data from a system via [[GCAPI]]. All of the operations take the same parameters and return different data.
The History subsystem allows you to fetch ADL and wellness data from a system via [[GCAPI]]. All of the operations take the same parameters and return different data.
 
= Operations =
=== bp ===
== bp ==
Fetches blood pressure sensor history from the system
Fetches blood pressure sensor history from the system
==== Parameters ====
=== Parameters ===
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
Line 11: Line 10:
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''resident'' - [optional] - ID of resident to limit data to
* ''resident'' - [optional] - ID of resident to limit data to
==== Results ====
=== Results ===
SUCCESS, the total number of readings, and a list readings.
SUCCESS, the total number of readings, and a list readings.
===== xml =====
==== xml ====
  <gcapi>
  <gcapi>
  <result>SUCCESS</result>
  <result>SUCCESS</result>
Line 37: Line 36:
  </gcapi>
  </gcapi>


===== json =====
==== json ====
  {
  {
     "gcapi": {
     "gcapi": {
Line 65: Line 64:
  }
  }


=== weight ===
== weight ==
Fetches scale history from the system
Fetches scale history from the system
==== Parameters ====
=== Parameters ===
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
Line 74: Line 73:
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''resident'' - [optional] - ID of resident to limit data to
* ''resident'' - [optional] - ID of resident to limit data to
==== Results ====
=== Results ===
SUCCESS, the total number of readings, and a list readings.
SUCCESS, the total number of readings, and a list readings.
===== xml =====
==== xml ====
  <gcapi>
  <gcapi>
  <result>SUCCESS</result>
  <result>SUCCESS</result>
Line 94: Line 93:
  </gcapi>
  </gcapi>


===== json =====
==== json ====
  {
  {
     "gcapi": {
     "gcapi": {
Line 116: Line 115:
  }
  }


=== temp ===
== temp ==
Fetches temperature sensor history from the system
Fetches temperature sensor history from the system
==== Parameters ====
=== Parameters ===
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
Line 124: Line 123:
* ''days'' - [optional] - Returns entries for the last number of days
* ''days'' - [optional] - Returns entries for the last number of days
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
==== Results ====
=== Results ===
SUCCESS, the total number of readings, and a list readings.
SUCCESS, the total number of readings, and a list readings.
===== xml =====
==== xml ====
  <gcapi>
  <gcapi>
  <result>SUCCESS</result>
  <result>SUCCESS</result>
Line 142: Line 141:
  </gcapi>
  </gcapi>


===== json =====
==== json ====
  {
  {
     "gcapi": {
     "gcapi": {
Line 162: Line 161:
  }
  }


=== bed ===
== bed ==
Fetches bed sensor history from the system
Fetches bed sensor history from the system


==== Parameters ====
=== Parameters ===
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
Line 171: Line 170:
* ''days'' - [optional] - Returns entries for the last number of days
* ''days'' - [optional] - Returns entries for the last number of days
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
==== Results ====
=== Results ===
SUCCESS, the total number of readings, and a list readings.
SUCCESS, the total number of readings, and a list readings.
===== xml =====
==== xml ====
  <gcapi>
  <gcapi>
  <result>SUCCESS</result>
  <result>SUCCESS</result>
Line 184: Line 183:
  </gcapi>
  </gcapi>


===== json =====
==== json ====
  {
  {
     "gcapi": {
     "gcapi": {
Line 197: Line 196:
  }
  }


=== oxi ===
== oxi ==
Fetches oximeter history from the system
Fetches oximeter history from the system
==== Parameters ====
=== Parameters ===
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
Line 206: Line 205:
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''resident'' - [optional] - ID of resident to limit data to
* ''resident'' - [optional] - ID of resident to limit data to
==== Results ====
=== Results ===
SUCCESS, the total number of readings, and a list readings.
SUCCESS, the total number of readings, and a list readings.
===== xml =====
==== xml ====
  <gcapi>
  <gcapi>
  <result>SUCCESS</result>
  <result>SUCCESS</result>
Line 228: Line 227:
  </gcapi>
  </gcapi>


===== json =====
==== json ====
  {
  {
     "gcapi": {
     "gcapi": {
Line 252: Line 251:
  }
  }


=== motion ===
== motion ==
Fetches motion sensor history from the system
Fetches motion sensor history from the system
==== Parameters ====
=== Parameters ===
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
Line 260: Line 259:
* ''days'' - [optional] - Returns entries for the last number of days
* ''days'' - [optional] - Returns entries for the last number of days
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
==== Results ====
=== Results ===
SUCCESS, the total number of readings, and a list readings.
SUCCESS, the total number of readings, and a list readings.
===== xml =====
==== xml ====
  <gcapi>
  <gcapi>
  <result>SUCCESS</result>
  <result>SUCCESS</result>
Line 278: Line 277:
  </gcapi>
  </gcapi>


===== json =====
==== json ====
  {
  {
     "gcapi": {
     "gcapi": {
Line 298: Line 297:
  }
  }


=== gluc ===
== gluc ==
Fetches glucometer history from the system
Fetches glucometer history from the system
==== Parameters ====
=== Parameters ===
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
Line 307: Line 306:
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''resident'' - [optional] - ID of resident to limit data to
* ''resident'' - [optional] - ID of resident to limit data to
==== Results ====
=== Results ===
SUCCESS, the total number of readings, and a list readings.
SUCCESS, the total number of readings, and a list readings.
===== xml =====
==== xml ====
  <gcapi>
  <gcapi>
  <result>SUCCESS</result>
  <result>SUCCESS</result>
Line 329: Line 328:
  </gcapi>
  </gcapi>


===== json =====
==== json ====
  {
  {
     "gcapi": {
     "gcapi": {
Line 353: Line 352:
  }
  }


=== door ===
== door ==
Fetches door sensor history from the system
Fetches door sensor history from the system
==== Parameters ====
=== Parameters ===
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
Line 361: Line 360:
* ''days'' - [optional] - Returns entries for the last number of days
* ''days'' - [optional] - Returns entries for the last number of days
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
==== Results ====
=== Results ===
SUCCESS, the total number of readings, and a list readings.
SUCCESS, the total number of readings, and a list readings.
===== xml =====
==== xml ====
  <gcapi>
  <gcapi>
  <result>SUCCESS</result>
  <result>SUCCESS</result>
Line 379: Line 378:
  </gcapi>
  </gcapi>


===== json =====
==== json ====
  {
  {
     "gcapi": {
     "gcapi": {
Line 399: Line 398:
  }
  }


=== cid ===
== cid ==
Fetches caller ID history from the system
Fetches caller ID history from the system
==== Parameters ====
=== Parameters ===
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''limit'' - [optional] - Limits the number of entries returned. Defaults to 50
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
* ''offset'' - [optional] - Skip this number of entries. Useful for paging
Line 407: Line 406:
* ''days'' - [optional] - Returns entries for the last number of days
* ''days'' - [optional] - Returns entries for the last number of days
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
* ''devices'' - [optional] - Comma separated list of devices to get data. Can be a single device
==== Results ====
=== Results ===
SUCCESS, the total number of readings, and a list readings.
SUCCESS, the total number of readings, and a list readings.
===== xml =====
==== xml ====
  <gcapi>
  <gcapi>
  <result>SUCCESS</result>
  <result>SUCCESS</result>
Line 425: Line 424:
  </gcapi>
  </gcapi>


===== json =====
==== json ====
  {
  {
     "gcapi": {
     "gcapi": {

Revision as of 20:07, 2 August 2012

The History subsystem allows you to fetch ADL and wellness data from a system via GCAPI. All of the operations take the same parameters and return different data.

Operations

bp

Fetches blood pressure sensor history from the system

Parameters

  • limit - [optional] - Limits the number of entries returned. Defaults to 50
  • offset - [optional] - Skip this number of entries. Useful for paging
  • date - [optional] - Returns only entries for this date
  • days - [optional] - Returns entries for the last number of days
  • devices - [optional] - Comma separated list of devices to get data. Can be a single device
  • resident - [optional] - ID of resident to limit data to

Results

SUCCESS, the total number of readings, and a list readings.

xml

<gcapi>
	<result>SUCCESS</result>
	<bp>
		<timestamp>05/12/12 09:35:44</timestamp>
		<deviceId>1001</deviceId>
		<residentId>cf6ff892-3124-41ef-8c77-e729f0f66fc5</residentId>
		<systolic>138</systolic>
		<diastolic>88</diastolic>
		<pulse>49</pulse>
		<mean-ap>108</mean-ap>
	</bp>
	<bp>
		<timestamp>05/11/12 07:11:08</timestamp>
		<deviceId>1001</deviceId>
		<residentId>cf6ff892-3124-41ef-8c77-e729f0f66fc5</residentId>
		<systolic>128</systolic>
		<diastolic>84</diastolic>
		<pulse>58</pulse>
		<mean-ap>98</mean-ap>
	</bp>
	<totalEntries>2</totalEntries>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "bp": [
           {
               "timestamp": "07/31/12 08:15:57",
               "deviceId": "1001",
               "residentId": "cf6ff892-3124-41ef-8c77-e729f0f66fc5",
               "systolic": "134",
               "diastolic": "95",
               "pulse": "54",
               "mean-ap": "117"
           },
           {
               "timestamp": "07/28/12 07:51:16",
               "deviceId": "1001",
               "residentId": "cf6ff892-3124-41ef-8c77-e729f0f66fc5",
               "systolic": "134",
               "diastolic": "89",
               "pulse": "51",
               "mean-ap": "104"
           }
       ],
       "totalEntries": "2"
   }
}

weight

Fetches scale history from the system

Parameters

  • limit - [optional] - Limits the number of entries returned. Defaults to 50
  • offset - [optional] - Skip this number of entries. Useful for paging
  • date - [optional] - Returns only entries for this date
  • days - [optional] - Returns entries for the last number of days
  • devices - [optional] - Comma separated list of devices to get data. Can be a single device
  • resident - [optional] - ID of resident to limit data to

Results

SUCCESS, the total number of readings, and a list readings.

xml

<gcapi>
	<result>SUCCESS</result>
	<weight>
		<timestamp>05/16/12 07:30:26</timestamp>
		<deviceId>1000</deviceId>
		<residentId>cf6ff892-3124-41ef-8c77-e729f0f66fc5</residentId>
		<value>179.6</value>
	</weight>
	<weight>
		<timestamp>05/15/12 08:00:52</timestamp>
		<deviceId>1000</deviceId>
		<residentId>cf6ff892-3124-41ef-8c77-e729f0f66fc5</residentId>
		<value>179.8</value>
	</weight>
	<totalEntries>1354</totalEntries>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "weight": [
           {
               "timestamp": "07/31/12 08:14:45",
               "deviceId": "1000",
               "residentId": "cf6ff892-3124-41ef-8c77-e729f0f66fc5",
               "value": "176.6"
           },
           {
               "timestamp": "07/28/12 07:49:32",
               "deviceId": "1000",
               "residentId": "cf6ff892-3124-41ef-8c77-e729f0f66fc5",
               "value": "176.2"
           }
       ],
       "totalEntries": "2"
   }
}

temp

Fetches temperature sensor history from the system

Parameters

  • limit - [optional] - Limits the number of entries returned. Defaults to 50
  • offset - [optional] - Skip this number of entries. Useful for paging
  • date - [optional] - Returns only entries for this date
  • days - [optional] - Returns entries for the last number of days
  • devices - [optional] - Comma separated list of devices to get data. Can be a single device

Results

SUCCESS, the total number of readings, and a list readings.

xml

<gcapi>
	<result>SUCCESS</result>
	<temp>
		<timestamp>09/14/10 02:50:29</timestamp>
		<deviceId>1070</deviceId>
		<value>70</value>
	</temp>
	<temp>
		<timestamp>09/14/10 01:37:27</timestamp>
		<deviceId>1070</deviceId>
		<value>71</value>
	</temp>
	<totalEntries>2</totalEntries>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "temp": [
           {
               "timestamp": "07/20/12 12:06:18",
               "deviceId": "103",
               "value": "73"
           },
           {
               "timestamp": "07/20/12 11:53:14",
               "deviceId": "103",
               "value": "74"
           }
       ],
       "totalEntries": "2"
   }
}

bed

Fetches bed sensor history from the system

Parameters

  • limit - [optional] - Limits the number of entries returned. Defaults to 50
  • offset - [optional] - Skip this number of entries. Useful for paging
  • date - [optional] - Returns only entries for this date
  • days - [optional] - Returns entries for the last number of days
  • devices - [optional] - Comma separated list of devices to get data. Can be a single device

Results

SUCCESS, the total number of readings, and a list readings.

xml

<gcapi>
	<result>SUCCESS</result>
	<totalEntries>1</totalEntries>
	<bed>
		<timestamp>...</timestamp>
		<device-id>...</device-id>
		<value>[Occupied|Unoccupied]</value>
	</bed>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "bed": [{
               "timestamp": "...",
               "device-id": "...",
               "value": "[Occupied|Unoccupied]"
       }],
       "totalEntries": "1"
   }
}

oxi

Fetches oximeter history from the system

Parameters

  • limit - [optional] - Limits the number of entries returned. Defaults to 50
  • offset - [optional] - Skip this number of entries. Useful for paging
  • date - [optional] - Returns only entries for this date
  • days - [optional] - Returns entries for the last number of days
  • devices - [optional] - Comma separated list of devices to get data. Can be a single device
  • resident - [optional] - ID of resident to limit data to

Results

SUCCESS, the total number of readings, and a list readings.

xml

<gcapi>
	<result>SUCCESS</result>
	<oxi>
		<timestamp>05/06/12 16:55:57</timestamp>
		<deviceId>1003</deviceId>
		<residentId>b61790c5-0f61-40a7-864b-87b8c62cc750</residentId>
		<spo2>97</spo2>
		<pulse>72</pulse>
	</oxi>
	<oxi>
		<timestamp>05/05/12 22:34:57</timestamp>
		<deviceId>1003</deviceId>
		<residentId>b61790c5-0f61-40a7-864b-87b8c62cc750</residentId>
		<spo2>99</spo2>
		<pulse>83</pulse>
	</oxi>
	<totalEntries>2</totalEntries>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "oxi": [
           {
               "timestamp": "08/01/12 08:11:59",
               "deviceId": "1003",
               "residentId": "b61790c5-0f61-40a7-864b-87b8c62cc750",
               "spo2": "96",
               "pulse": "63"
           },
           {
               "timestamp": "07/31/12 10:19:25",
               "deviceId": "1003",
               "residentId": "b61790c5-0f61-40a7-864b-87b8c62cc750",
               "spo2": "95",
               "pulse": "63"
           }
       ],
       "totalEntries": "2"
   }
}

motion

Fetches motion sensor history from the system

Parameters

  • limit - [optional] - Limits the number of entries returned. Defaults to 50
  • offset - [optional] - Skip this number of entries. Useful for paging
  • date - [optional] - Returns only entries for this date
  • days - [optional] - Returns entries for the last number of days
  • devices - [optional] - Comma separated list of devices to get data. Can be a single device

Results

SUCCESS, the total number of readings, and a list readings.

xml

<gcapi>
	<result>SUCCESS</result>
	<motion>
		<timestamp>07/20/12 14:07:36</timestamp>
		<deviceId>105</deviceId>
		<value>Off</value>
	</motion>
	<motion>
		<timestamp>07/20/12 14:05:48</timestamp>
		<deviceId>102</deviceId>
		<value>Off</value>
	</motion>
	<totalEntries>55</totalEntries>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "motion": [
           {
               "timestamp": "07/20/12 14:07:36",
               "deviceId": "105",
               "value": "Off"
           },
           {
               "timestamp": "07/20/12 14:05:48",
               "deviceId": "102",
               "value": "Off"
           }
       ],
       "totalEntries": "2"
   }
}

gluc

Fetches glucometer history from the system

Parameters

  • limit - [optional] - Limits the number of entries returned. Defaults to 50
  • offset - [optional] - Skip this number of entries. Useful for paging
  • date - [optional] - Returns only entries for this date
  • days - [optional] - Returns entries for the last number of days
  • devices - [optional] - Comma separated list of devices to get data. Can be a single device
  • resident - [optional] - ID of resident to limit data to

Results

SUCCESS, the total number of readings, and a list readings.

xml

<gcapi>
	<result>SUCCESS</result>
	<gluc>
		<timestamp>08/01/12 07:24:00</timestamp>
		<deviceId>1002</deviceId>
		<residentId>b61790c5-0f61-40a7-864b-87b8c62cc750</residentId>
		<value>113</value>
		<notes></notes>
	</gluc>
	<gluc>
		<timestamp>07/31/12 08:17:00</timestamp>
		<deviceId>1002</deviceId>
		<residentId>b61790c5-0f61-40a7-864b-87b8c62cc750</residentId>
		<value>105</value>
		<notes></notes>
	</gluc>
	<totalEntries>2</totalEntries>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "gluc": [
           {
               "timestamp": "08/01/12 07:24:00",
               "deviceId": "1002",
               "residentId": "b61790c5-0f61-40a7-864b-87b8c62cc750",
               "value": "113",
               "notes": ""
           },
           {
               "timestamp": "07/31/12 08:17:00",
               "deviceId": "1002",
               "residentId": "b61790c5-0f61-40a7-864b-87b8c62cc750",
               "value": "105",
               "notes": ""
           }
       ],
       "totalEntries": "2"
   }
}

door

Fetches door sensor history from the system

Parameters

  • limit - [optional] - Limits the number of entries returned. Defaults to 50
  • offset - [optional] - Skip this number of entries. Useful for paging
  • date - [optional] - Returns only entries for this date
  • days - [optional] - Returns entries for the last number of days
  • devices - [optional] - Comma separated list of devices to get data. Can be a single device

Results

SUCCESS, the total number of readings, and a list readings.

xml

<gcapi>
	<result>SUCCESS</result>
	<door>
		<timestamp>08/01/12 07:24:00</timestamp>
		<deviceId>1002</deviceId>
		<value>Open</value>
	</door>
	<door>
		<timestamp>07/31/12 08:17:00</timestamp>
		<deviceId>1002</deviceId>
		<value>Closed</value>
	</door>
	<totalEntries>2</totalEntries>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "door": [
           {
               "timestamp": "08/01/12 07:24:00",
               "deviceId": "1002",
               "value": "Open"
           },
           {
               "timestamp": "07/31/12 08:17:00",
               "deviceId": "1002",
               "value": "Closed"
           }
       ],
       "totalEntries": "2"
   }
}

cid

Fetches caller ID history from the system

Parameters

  • limit - [optional] - Limits the number of entries returned. Defaults to 50
  • offset - [optional] - Skip this number of entries. Useful for paging
  • date - [optional] - Returns only entries for this date
  • days - [optional] - Returns entries for the last number of days
  • devices - [optional] - Comma separated list of devices to get data. Can be a single device

Results

SUCCESS, the total number of readings, and a list readings.

xml

<gcapi>
	<result>SUCCESS</result>
	<call>
		<timestamp>07/28/09 16:40:48</timestamp>
		<name>U.S. CELLULAR</name>
		<number>2625551001</number>
	</call>
	<call>
		<timestamp>07/28/09 15:30:00</timestamp>
		<name>P</name>
		<number>P</number>
	</call>
	<totalEntries>6</totalEntries>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "call": [
           {
               "timestamp": "07/28/09 16:40:48",
               "name": "U.S. CELLULAR",
               "number": "2625551001"
           },
           {
               "timestamp": "07/28/09 15:30:00",
               "name": "Unknown Caller",
               "number": ""
           }
       ],
       "totalEntries": "2"
   }
}