BookAppointment

function is used to schedule an appointment for a specific date, time, location, doctor, visit type, and patient.

Call example:


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

Request parameters:

Request parameter is XML or JSON string representing set of fields:
patientId(string)Patient Id
patientdob(string)Patient Birth Date
facilityId(string)Location to schedule
appstartdate(string)Appointment start time
appenddate(string)Appointment end time
providerId(string)Doctor to schedule
refProviderId(string)Referring doctor, if any (not used yet)
visittypeid(string)Appointment type to schedule
notes(string)Free text with cancellation notes
createby(string)Practice assigned value. TBD.
customKeys(array)Some extra parameters to pass into practice in form of key/value.
customKeys.key(array)Custom Parameter Key.
customKeys.value(string)Custom Parameter Value.
customKeys.remote(string)Send to remote practice flag (0/1 or N/Y or false/true).

Notes:
  • Both extpatientId and patientdob parameters must be provided for validation purpose.
  • If customgKeys.remote value is false then such key will not be passed to a remote practice.


JSON string request example:

{
 "patientid":"2743",
 "patientdob":"01/01/1970", 
 "facilityid":"1",
 "appstartdate":"01/25/2015 08:00:00",
 "appenddate":"01/25/2015 08:15:00",
 "providerId":"11", 
 "refproviderId":"", 
 "visittypeid":"17",
 "notes":"Seen Practitioner Before ||Want Vision Checked ||Have Diabetes, Glaucoma, or High Blood Pressure",
 "createdby":"patient-sop-id-2743",
 "customkeys" [
    {"key": "QAWidget_Send_Info", "value": "true", "remote" : "true"},
    {"key": "QAWidget_Preferred_Contact_Method", "value": "email", "remote" : "true"},
    {"key": "QAWidget_Number_Attending", "value": "4", "remote" : "true"},
    {"key": "QAWidget_CL_Wearer", "value": "true", "remote" : "true"},
    {"key": "userIp", "value": "127.0.0.1", "remote" : "false"},
    {"key": "referrerUrl", "value": "some hyperlink", "remote" : "false"},
 ]
}

Response:

XML or JSON string representing APIResponse structure.

APIResponse payload element may be encrypted and delivered as Base64 string.
Payload element of APIResponse is a string value with new Appointment Id. See source code examples in SageBridge.API.Tester project for more details

Examples of full API responses:

Call example (C#):

For the source code of working example see testBookAppointment() method in SageBridgeApiCallExecutor class of SageBrige.API.Tester project can be downloaded here.

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
This function may return other codes not listed above; they may vary by practice.

Notes:

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

Known Issues:

None

See Also:

API Functions, APIResponse structure