Table of Contents
Table of Contents | ||
---|---|---|
|
...
List Messages
Current Implementation
Retrieves the messages from user's Inbox.of a particular User. Messages can be retrieved from different sources. Currently supported sources are: Email, Alert , ParameterizedAlert, or Document.
To get a better understanding on how Parameterized Alerts are retrieved, take a look at the following document: Alerts and Notifications#AlertRetrieval
Parameters
Base URL: /getMessages
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
token | String | Yes | Security Token obtained before. |
userId | String | Yes | The id of the logged in user. |
type | ENUM | No | Possible values: ['ALL', 'ALERT', 'EMAIL', 'DOCUMENT','PARAMETERIZEDALERT' ]. Default value: "ALL". The source of the messages. |
location | ENUM | No | Possible values: ['INBOX', 'SENT', 'ARCHIVE']. Default value: "INBOX". |
patientId | String | No | Not used when type = 'PARAMETERIZEDALERT' Used if we want to retrieve only those messages related to a specific patient. |
patientLocation | ENUM | No | Possible values: ['ORGANIZATION', 'FACILITY', 'WORKSPACE', 'ROOM' ]. Filter the messages by a specific location. Use patientLocationId parameter to specify which location you want to use in the filter. |
patientLocationId | String | No unless patientLocation is specified. | Indicates what is the id of the location you want to use to filter the messages. |
API Sample
curl 'http://192.168.21.102122:8080/PresentationServices/getMessages?type=Alert&location=INBOX&userId=podaQA_1&token=d2360c39a3fef5d8-637b951a-41da4a11-988d9b39-f031db5affbb7efb63695211&_type=1395133673255PARAMETERIZEDALERT' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' --compressed
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "messagesFact": { "statusFact": { "success": true } ,"messageObjects": [ { "messageId": "25ff80818147e7ee6c0147e7f14d000005", "type": "AlertParameterizedAlert", "podId": "Pod CA", "location": "INBOX", "labels": [], "messageDate": "38/0718/14", "messageTime": "1309:2607", "description": "No Skin To Skin Contact In 7 Days", "from": "[S4-ALERT] No skin to skin contact in 7 days", Alert", "title": " peggy 501##split##33wks500##split##33wks 998g999g", "payload": "This patient has not had skin to skin contact for at least 7 consecutive days.", "status": "Unread", "priority": "HIGH", "tasksCount": 10, "tasksComplete": 0, "from": "NCCC" },{ "messageId": "22", ... } ]}} |
Set Messages
Current Implementation
This operation is used to change the status of one or more messages.
Info |
---|
This is a POST operation! |
Parameters
Base URL: /setMessages
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
token | String | Yes | Security Token obtained before. |
userId | String | Yes | The id of the logged in user. |
action | ENUM | Yes | Possible values: ['Read', 'Unread', 'Archive', 'Delete'] This is the action we want to execute agains the message |
messageIds | String | Yes | The id of the message you want to execute the action against. You could include this parameter multiple times to work on multiple messages at once. |
location | ENUM | Yes | Possible values: ['INBOX', 'SENT', 'ARCHIVE']. Default value: "INBOX". |
types | ENUM | Yes | Possible values: ['ALL', 'ALERT', 'EMAIL', 'DOCUMENT',"PARAMETERIZEDALERT' ]. Default value: "ALL". |
API Sample
curl 'http://192.168.2.109:8080/PresentationServices/setMessages' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Origin: file://' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.4; Nexus 5 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'action=Read&messageIds=ff80818147fd49740147fd55b2e40002&location=INBOX&types=ParameterizedAlert&userId=sigal&token=481fe6f1-c7a5-4d94-8b5b-7c0bec3d2aed' --compressed
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "messagesFact": { "statusFact": { "success": true, "failMessage": "Set }Messages successful" } ]} } |