ProviderService
public protocol ProviderService
Base Protocol to retrieve information about providers, and schedule provider visits
-
Fetches information about a specified health-care provider.
Declaration
Swift
func getProvider(providerNationalId: String, success: @escaping (Provider) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
providerNationalId
The national identifier of the provider to retrieve information about. This identifier should be retrieved from a source external to DexCare, specific to your health system.
success
A closure called with the
Provider
informationfailure
A closure called if any FailedReason errors are returned
-
Fetches upcoming available time slots for a given provider.
Declaration
Swift
func getProviderTimeslots(providerNationalId: String, visitTypeId: String, startDate: Date?, endDate: Date?, success: @escaping (ProviderTimeSlot) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
providerNationalId
The national identifier of the provider to retrieve information about. This identifier should be retrieved from a source external to DexCare, specific to your health system.
visitTypeId
An id of the visitType for which you are retrieving
ProviderTimeSlot
for. SeeProviderVisitType
success
A closure called with the
ProviderTimeSlot
informationfailure
A closure called if any FailedReason errors are returned
-
Fetches the maximum number of days beyond Today that
getProviderTimeslots
can return results for.Declaration
Swift
func getMaxLookaheadDays(visitTypeShortName: VisitTypeShortName, ehrSystemName: String, success: @escaping (Int) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
visitTypeShortName
The
shortName
of theProviderVisitType
to check the max lookahead days for.success
A closure called with the maximum number of days beyond Today that
getProviderTimeslots
can return results for. The SDK will not use this value internally, but is for you to use for theendDate
property ofgetProviderTimeslots
.failure
A closure called if any FailedReason errors are returned
-
scheduleProviderVisit(paymentMethod:
providerVisitInformation: timeSlot: ehrSystemName: patientDexCarePatient: actorDexCarePatient: success: failure: ) Schedules a visit with a Provider.
Declaration
Swift
func scheduleProviderVisit(paymentMethod: PaymentMethod, providerVisitInformation: ProviderVisitInformation, timeSlot: TimeSlot, ehrSystemName: String, patientDexCarePatient: DexcarePatient, actorDexCarePatient: DexcarePatient?, success: @escaping (ScheduledProviderVisit) -> Void, failure: @escaping (ScheduleProviderAppointmentFailedReason) -> Void)
Parameters
paymentMethod
A
PaymentMethod
enum containing the patient’s payment informationproviderVisitInformation
A
ProviderVisitInformation
]` object containing additional details required to schedule the appointment.timeSlot
A
TimeSlot
that the user is requesting to schedule the appointment in. TimeSlots are returned bygetProviderTimeslots
.ehrSystemName
The EHR system the appointment will be scheduled in. This can be determined based on the Provider’s
ProviderDepartment
ehrSystemName property.patientDexCarePatient
A
DexCarePatient
object containing demographics information about the patient.actorDexCarePatient
Optional, a
DexCarePatient
object containing information about a parent or app user who’s booking the visit for someone else. This is only used whenProviderVisitInformation.patientDeclaration
is.other
success
A closure called with the
ScheduledProviderVisit
structure containing information of the visitfailure
A closure called if any
ScheduleProviderAppointmentFailedReason
errors are returned