GetMessagesFromPatient
Used to retrieve messages from patient to provider.
Call example:
string result = SageBridgeAPI.executeAPICall(
"cf389659-588c-4fd9-ab9e-7c37b438905c", // security token
"GetMessagesFromPatient",
"bos5", // practice Path or Tax ID
"JSON", // output format (XML or JSON)
"--request parameters XML or JSON---" // request parameters
);
Request fields:
| patientId | (string) | Unique patient id. (not supported in this version) |
| providerId | (string) | Unique provider id. |
| eventStart | (string) | Filter by "from" datetime. |
| eventEnd | (string) | Filter by "to" datetime. |
| messageTypeId | (int) | Filter by message type. (not supported in this version) |
| unreadOnly | (bool) | To get only items not marked as "read" (if set to "true" then all retrieved items will be marked as "read"). |
| itemsPerCall | (int) | To limit number of items in a response (Sophrona has its own parameter. The minimal value will be used) |
Notes:
- All parameters are optional. If parameter is not provided then default value(s) will be used.
- if itemsPerCall parameter value exceeds Sophrona specified value, then Sophrona specified value will be used
- unreadOnly default value is "true"
- Any time when message is pulled, it will be marked as "read" and not included into next response if unreadOnly value is "true"
- itemsPerCall element in a reposnse is always NULL. PatientID is part of each Message item
Request example:
(All "new" messages for a given provider)
{
"providerId": "2",
"unreadOnly": true
}
(All messages for a specific provider and dates range regardless of "new" status)
{
"providerId": "2",
"messageTypeId": 0,
"eventStart": "2016-02-01 14:00",
"eventEnd": "2016-02-10 9:00 pm",
"unreadOnly": false
}
Response
The response is a list of Secure Message items.
Example:
{
"messages": [
{
"patientId": "TS01831451",
"providerId": "2",
"messageTypeId": 1,
"messageId": "529de16f-0ad4-434f-ba59-dd06b55e10db",
"referenceId": "bbaa99fa-5b52-4469-b0bb-81e3c6844832",
"subject": "Message from doctor",
"messageBody": "John, \r\n Attached please find out some documents for you. \r\n. Thanks.",
"createdTime": "4/1/2016 11:52:26 AM",
"readTime": null,
"attachments": [
{
"attachmentId": "529de16f-0ad4-434f-ba59-dd06b55e10db:329",
"documentId": "66744316-FD01-4637-918C-0B0033A81A4C",
"documentName": "Some PDF file for patient",
"originalFileName": "SBInterface.pdf",
"mimeType": "application/pdf",
"format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wAGgAcgBvAG4AYQAgAGQAZQBsAGkAdgBlAHIAcwAgAGkAbgBuAG8AdgBhAHQAaQB2AGUAIABzAG8AbAB1AHQAaQBvAG4AcwAgAHAAdQByAHAAbwBzAGUAIABiAHUAaQBsAHQAIAB0AG8AIABpAG4AYwByAGUAYQBzAGUAIABwAHIAbwBmAGkAdABzACAAYQBuAGQAIABwAGEAdABpAGUAbgB0ACAAZQBuAGcAYQBnAGUAbQBlAG4AdAAuAA==",
"createdTs": "/Date(1458057146001)/"
},
{
"attachmentId": "529de16f-0ad4-434f-ba59-dd06b55e10db:1",
"documentId": "8e72a539-12bd-4b82-a1ce-aa25bb63abba",
"documentName": "Sophrona info",
"originalFileName": "ReadMe.txt",
"mimeType": "text/plain",
"formatTypeId": 2,
"fileContent": "Online Patient Communication Uniquely Designed for Ophthalmology\r\nTen years and growing strong, Sophrona sets the standard in online patient-physician communication services and technology for ophthalmology.\r\nSophrona is the power behind the #1 choice of nearly 2,000 eye doctors and clinical staff nationwide.\r\nPartnering with leading practice management and electronic medical records providers, Sophrona delivers innovative solutions purpose built to increase profits and patient engagement.",
"createdTs": "/Date(1458057146001)/"
}
]
},
{ ".... another message ...." },
{ ".... another message ...." }
]
}
Possible return values (see APIResponse )
- 0 - Success. Description can be vary per function
- -1 - General error. Description attribute will show more details about an error
- -2 - Function is not supported
- 500 - Invalid credentials provided
- 501 - License is expired
- 502 - License is not active
- 503 - Token is not active or expired
- 550 - Unknow functionName or not subscribed
- 551 - Unknown practice
- 552 - No Subscription found
- 553 - Subscription is inactive or expired
- 600 - Invalid or empty request parameters
- 601 - No valid route found for this subscription
- 602 - Unable to parse request parameters
Known Issues:
None
See Also:
API Functions,
APIResponse structure,
SecureMessage data