GetAppointments
Used to retrieve a list of appointments for certain criterias
Call example:
string result = SageBridgeAPI.executeAPICall(
"cf389659-588c-4fd9-ab9e-7c37b438905c", // security token
"GetAppointments",
"bos5", // practice Path or Tax ID
"JSON", // output format (XML or JSON)
"--request parameters XML or JSON---" // request parameters
);
Request parameters:
Request parameter JSON string representing set of fields:
| appstartdate | (string) | Appointment dates range begin |
| appenddate | (string) | Appointment dates range end |
| status | (string) | get appointments with given status only. Leave blank to get all appointments |
| retrievecancelled | (string) | "N"-do not include cancelled appointments. Possible values - 0,1, Y, N, YES, NO, NOT, TRUE, FALSE
This parameter is ignored when status parameter has a value.
Note: currently SageBridge enforces this parameter to "N" which, in turn, will always exclude cancelled appointments from output.
|
| oneperpatient | (string) | If set to "true" then only the 1st appointment for each patient retrieved will be returned. Otherwise SageBridge API will return all appointments. Possible values are same as for retrievecancelled parameter |
| facilityid | (string) | Only return appointments scheduled for this location. Empty value will return all locations (no filtering by location).
|
| providerId | (string) | Only return appointments scheduled for this doctor. Empty value will return all doctors (no filtering by doctor). |
| patientId | (string) | Only return appointments for this patient. Note: If specified then patientdob parameter must be provided for verification purposes. |
| patientdob | (string) | Patient Birth Date. Needed only if patientid is specified. |
JSON string request example:
{
"appstartdate":"01/03/2015",
"appenddate":"03/03/2016",
"status":"S",
"retrievecancelled":"",
"facilityid":"",
"providerId":"",
"patientid":"CL01831451",
"patientdob":"01/01/1965",
"oneperpatient":"N"
}
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 list of Appointment elements.
XML Response Example:
JSON Response Example:
{[
{
"AppointmentId":"265795",
"EncounterId":"12345",
"ApptTypeId":"0002",
"Status":"N",
"FacilityId":"SUITE113",
"ProviderId":"",
"ApptStart":"5/1/2015 10:00:00 AM",
"ApptStop":"5/1/2015 11:00:00 AM",
"Notes":"",
"LastModified":"2/20/2015 12:00:00 AM",
"LastModifiedBy":"ELENTZ",
"first":"PISTOL",
"middle":"",
"last":"PETE",
"EMailAddress":"joejoe@sophrona.com",
"Birthdate":"1/1/1965",
"PrimaryPhone":"1111111111",
"sex":"M",
"OwnerId":"CL01831451",
"PatientId":"CL01831451",
"MarketingPlanId":"",
"MarketingComments":"",
"MarketingDetails":"",
"ReferringProviderId":"",
"ModifyTimestamp":"11/5/2015 7:49:04 AM",
"vipFlag":"0",
"referralComanage":"C"
},
{ ... another appointment ...}
]}
Call example (C#):
For the source code of working example see testGetAppointments() method in SageBridgeApiCallExecutor class of SageBrige.API.Tester project can be downloaded here.
Possible appointment status (for both requests and responses):
- A = Acknowledge - NEW/PENDING/SCHEDULED - Most likely wont be used
- B = Bumped - SORT OF "DELETED"
- C = Confirmed
- X = Cancelled
- N = No Show
- W = Wait Listed
- S = Scheduled
- M = Med Rec Request - NOT USED
- ----
- D = completed (new status)
NOTE: Some practices may return status in form of full words such as "PENDING","SCHEDULED" etc.
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:
- #1. AllScripts API and ADS API support calls for a specific patient only. Cannot call for "all" patients.
- #2. Appointment status codes are not unified.
- #3. Appointment status may come in form of "Status 123" from some practices.
- #4. Appointment status codes are different per practice and can't always be mapped or unified. We are working on it.
See Also:
API Functions,
APIResponse structure,
Appointment structure,