PostMessagesToPatient

Used to post Secure Messages to a Patient.

Call example:


string result = SageBridgeAPI.executeAPICall(
"cf389659-588c-4fd9-ab9e-7c37b438905c", // security token
"PostMessagesToPatient",                    
"bos5",                                 // practice Path or Tax ID
"JSON",                                 // output format (XML or JSON)
"--request parameters XML or JSON---"   // request parameters
);

Request:JSON or XML serialized PostMessagesToPatientRequest data.
Response: APIResponse with payload representing PostSecureMessagesResponse data.


Request example:

    
{
  "patientInfo": {
    "patientID": "TS01831451",
    "last": "Galt",
    "first": "John",
    "middle": "",
    "birthdate": "01/01/1965",
    "sex": "M",
    "maritalStatus": "S",
    "preferredLanguage": "en",
    "address": {
      "addr1": "1 Park Ave",
      "addr2": "Unit 203",
      "city": "Sunny Town",
      "state": "IL",
      "zip": "09111",
      "country": "us"
    },
    "contactInfo": {
      "phone": "8005551212",
      "cell": "8005551313",
      "home": null,
      "work": "8005551414",
      "workExt": "9003",
      "altPhone": null,
      "email": "some@dadada.net"
    }
  },

  "messages": [
    {
      "patientId": "TS01831451",
      "providerId": "2",
      "messageTypeId": 1,
      "messageId": "8821e2bb-7b42-4ee6-838c-2d3f732a73c7",
      "referenceId": "e5f90693-fcf8-4d5b-a31d-2460b803ab74",
      "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": "8821e2bb-7b42-4ee6-838c-2d3f732a73c7:376",
          "documentId": "66744316-FD01-4637-918C-0B0033A81A4C",
          "documentName": "Some PDF file for patient",
          "originalFileName": "SBInterface.pdf",
          "mimeType": "application/pdf",
          "formatTypeId": 1,
          "fileContent": "TwBuAGwAaQBuAGUAIABQAGEAdABpAGUAbgB0ACAAQwBvAG0AbQB1AG4AaQBjAGEAdABpAG8AbgAgAFUAbgBpAHEAdQBlAGwAeQAgAEQAZQBzAGkAZwBuAGUAZAAgAGYAbwByACAATwBwAGgAdABoAGEAbABtAG8AbABvAG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kAdABzACAAYQBuAGQAIABwAGEAdABpAGUAbgB0ACAAZQBuAGcAYQBnAGUAbQBlAG4AdAAuAA==",
          "createdTs": "\/Date(1458057146048)\/"
        },
        {
          "attachmentId": "8821e2bb-7b42-4ee6-838c-2d3f732a73c7:48",
          "documentId": "2ca61188-d27d-4f17-a91a-51dd8425656b",
          "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(1458057146048)\/"
        },

        {"..... ANOTHER MESSAGE ...." }
      ]
    }
  ]
}
    

Response xample:

    
{
  "code": 0,
  "message": "All Done",
  "level": 0,
  "logs": [
    {"itemTypeId": 5, "itemId": "TS01831451", "code": 0, "message": "Patient located", "level": 0},
    {"itemTypeId": 4, "itemId": "66744316-FD01-4637-918C-0B0033A81A4C", "code": 0, "message": "Message created", "level": 0}
  ]
}
    

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

Notes:

All examples of source code and compiled version of SageBridge API client can be found here.

Known Issues:

None

See Also:

API Functions, APIResponse structure, SecureMessage data , Attachment data , PostSecureMessagesResponse data