GetPracticeReferrals
Retrieves referral data from Sophrona Referral Portal. Can be filtered by date range, patient, doctor, location and visit type.
Call example:
string result = SageBridgeAPI.executeAPICall(
"cf389659-588c-4fd9-ab9e-7c37b438905c", // security token
"GetPracticeReferrals",
"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:
| startDate | (string) | Referral creation date range begin (required). |
| endDate | (string) | Referral creation date range end (required). |
| updateStartDate | (string) | Referral modification date range begin (required). |
| updateEndDate | (string) | Referral modification date range end (required). |
| patientId | (string) | Patient ID (optional). |
| providerId | (string) | Provider ID (optional). |
| facilityId | (string) | Location/Facility ID (optional).
|
| visitTypeId | (string) | Visit Type ID (optional). |
| referralStatus | (string) | Referral Status (optional). (see list of possible values below) |
Notes:
- startDate and endDate parameters used to select practice referral records by referral creation timestamp.
- updateStartDate and updateEndDate parameters used to select practice referral records by referral last modification timestamp.
- Either of Creation or Modification ranges or both are required.
- (important) Creation and modification date ranges cannot exceed 30 days.
- (important) startDate and endDate parameters respect time portion. If endDate value has no time portion, then that particular date will not be included. To include it, please specify "11:59 PM" time or use next date.
- (important) All timestamps are in EST time zone.
Referral Status values
| 1 | New | Initial status of eReferral when created. |
| 2 | Processing | Status once viewed and before last scheduling attempt has been completed. |
| 3 | Scheduled | Status after eReferral appointment successfully scheduled. |
| 4 | Patient Declined | Status after patient has been contacted but patient does not want to schedule. |
| 5 | Abandoned | Status after final scheduling attempt has been completed unsuccessfully for eReferral. |
| 6 | Impeded | Status when staff was not able to make call (e.g. invalid phone number).. |
JSON string request example:
{
"startDate": "04/01/2020",
"endDate": "04/02/2020 11:59 PM",
"patientId": "",
"providerId": "",
"facilityId": "",
"visittypeId": "",
"referralStatus": "3"
}
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 referrals
JSON Response payload example:
{
"practiceReferrals": [
{
"referralId": "7a48cafa-b265-46c0-b19c-d60bf7acfa18",
"createdTs": "04/01/2020 01:19 PM",
"modifiedTs": "04/03/2020 10:05 AM",
"scheduleType": "e-Referral",
"intakeType": "Fax",
"referralType": "Fax",
"assigned": "SmartScheduler",
"apptStatus": "UnScheduled",
"referralStatus": "Processing",
"practiceReferralId": "",
"apptId": "",
"apptReason": "Reason for Consultation: cat eval\r\n Relevant exam findings: test",
"apptStartTime": "",
"apptEndTime": "",
"referringPracticeName": "Walter II Sophrona Clinic",
"referringDoctorName": "Walter Alt",
"providerId": "BEB44BF5-81FC-45CF-AC5D-43C8EFA83017",
"facilityId": "B493CC23-BB53-4AF6-8D77-F1ED6D0BB6D2",
"visittypeId": "10B85F7C-A88F-4E86-8559-DB1B39C80793",
"patient": {
"patientID": "161494",
"patientNbr": null,
"last": "Test",
"first": "Sophrona",
"middle": "",
"birthdate": "01/01/1990",
"sex": "M",
"patientMedRecordId": "",
"contactInfo": {
"phone": "7635551212",
"cell": null,
"email": ""
},
"address": {
"addr1": "1 Maing Str",
"addr2": "",
"city": "SunnyCity",
"state": "NY",
"zip": "10101",
"zip4": null,
"country": null
}
},
"insurances": [
{
"carrierName": "BC/BS Of Massachusetts,PO Box 986020,Boston,MA-229",
"policyNumber": "1234556",
"groupNumber": "",
"insuranceType": null,
"policyHolder": {
"last": "Test",
"first": "Sophrona",
"middle": "",
"birthdate": "01/01/1990",
"contactInfo": {
"phone": "7635551212",
"cell": null,
"email": null
},
"address": null
}
}
]
},
{
"referralId": "f4da2aab-a323-4642-b132-fabb59a9468e",
"createdTs": "04/01/2020 10:24 PM",
"modifiedTs": "04/05/2020 11:03 AM",
"apptStatus": "Scheduled",
"referralStatus": "Scheduled",
"scheduleType": "ATS Scheduled",
"intakeType": "",
"referralType": "ATS Scheduled",
"assigned": "",
"practiceReferralId": "",
"apptId": "1734228",
"apptReason": "Referred by: Dr. Walter Alt",
"apptStartTime": "04/12/2020 01:00 PM",
"apptEndTime": "04/12/2020 01:20 PM",
"referringPracticeName": "Walter II Sophrona Clinic",
"referringDoctorName": "Walter Alt",
"providerId": "BEB44BF5-81FC-45CF-AC5D-43C8EFA83017",
"facilityId": "13C69063-DD37-45E0-B1D5-2FFF6D9F300F",
"visittypeId": "10B85F7C-A88F-4E86-8559-DB1B39C80793",
"patient": {
"patientID": "180466",
"patientNbr": null,
"last": "Sophrona",
"first": "Ins",
"middle": "",
"birthdate": "01/01/1980"
"sex": "M",
"patientMedRecordId": "",
"contactInfo": {
"phone": "8006086017",
"cell": null,
"email": null
},
"address": {
"addr1": "44 Wilders St.",
"addr2": "",
"city": "Wilder",
"state": "WI",
"zip": "55555",
"zip4": null,
"country": null
}
},
"insurances": [
{
"carrierName": "Acadia Care Ins,MDIH HNA Medical Network Inc,PO Bo",
"policyNumber": "inspol1",
"groupNumber": "insgrp1",
"insuranceType": null,
"policyHolder": {
"last": "Sophrona",
"first": "Francine",
"middle": "",
"birthdate": "01/01/1960",
"contactInfo": {
"phone": "2222222222",
"cell": null,
"email": null
},
"address": null
}
}
]
}
]
}
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.
Known Issues:
None
See Also:
API Functions,
APIResponse structure