What is the best way to ask GE for a provider's availability? I am working on connecting an external specialty application to both GE and Epic, it will reside "in the middle".
I know how to query both Epic and GE for patient demographic matches and operate as an external MPI.
I also know how to use Epic's web services to ask for provider availability.
Does GE have something similar? How do I ask the system for provider availability on a given day and return that to the scheduler so I am not inserting an inefficient process (literally calling the clinic before scheduling an appointment to do manual conflict checking).
THANKS for any help you can provide!
Casey
This could get you started. I developed an application to generate the providers' schedules for users outside of Centricity. Here is the SQL query I use to pull their schedule. @doctorfacilityid would be the provider you need the schedule for; along with the start and end date. If ApptsId column is null, there isn't anything schedule in that time slot. ListOrder is the column on the schedule. Ideally you would want all columns of a row on the schedule to be NULL to consider the provider "available":
DECLARE @dtStartDate DATETIME, @dtStopDate DATETIME, @doctorfacilityid INT
SELECT @dtStartDate = DATEADD(DD, -1, GETDATE()), @dtStopDate = GETDATE(), @doctorfacilityid = 119
SELECT vApptSlot.Start AS TimeStart, vApptSlot.Stop AS TimeStop, vApptSlot.ListOrder,
vApptSlot.ScheduleId, vApptSlot.FacilityId, vApptSlot.ApptSlotId AS ScheduleTimesId,
Schd.DoctorResourceId, dr.Type AS ResourceType, df.ListName AS FacilityName,
df.Color AS FacilityColor, vApptSlot.Overbooked, vApptSlot.Status, vApptSlot.ApptId As ApptsId,
(CASE WHEN vApptSlot.ListOrder < 0 THEN 99999 ELSE vApptSlot.ListOrder END) AS SortedListOrder
FROM (Schedule AS Schd WITH (NOLOCK)
INNER JOIN DoctorFacility AS dr WITH (NOLOCK) ON Schd.DoctorResourceId = dr.DoctorFacilityId
INNER JOIN ApptSlot AS vApptSlot WITH (NOLOCK) ON Schd.ScheduleId = vApptSlot.ScheduleId AND (vApptSlot.Start < @dtStopDate AND vApptSlot.Stop > @dtStartDate AND (vApptSlot.Overbooked IS NULL OR (vApptSlot.Overbooked IS NOT NULL AND vApptSlot.ApptId IS NOT NULL)))
INNER JOIN DoctorFacility AS df WITH (NOLOCK) ON vApptSlot.FacilityId = df.DoctorFacilityId)
LEFT JOIN Appointments AS vAppts WITH (NOLOCK) ON (Schd.DoctorResourceId = vAppts.ResourceId AND vApptSlot.ApptId = vAppts.AppointmentsId) AND (vAppts.ApptStart < @dtStopDate AND vAppts.ApptStop > @dtStartDate)
WHERE Schd.DoctorResourceId = @doctorfacilityid
ORDER BY vApptSlot.Start, SortedListOrder, vApptSlot.FacilityId
Mike,
How to you handle if the Provider or Resource has a Schedule Template applied to with? For all of our providers we have a schedule template applied to them where certain time slots have a predefined appointment type and some time slots do not. How do you find the open slots in this scenario?
Amar
The query should still show all of those predefined appt types as empty if there isn't a patient in that slot. You may have to add in some extra filters to remove any blocks on the schedule where the provider is out to lunch or holiday/sick.