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, visitTypeShortName: VisitTypeShortName, 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.
visitTypeShortName
A shortName 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 -
getProvider(providerNationalId:
Asynchronous) Fetches information about a specified health-care provider.
Throws
Throws:FailedReason
Declaration
Swift
func getProvider(providerNationalId: String) async throws -> Provider
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.
Return Value
Provider
information -
Fetches upcoming available time slots for a given provider.
Throws
Throws:FailedReason
Declaration
Swift
func getProviderTimeSlots(providerNationalId: String, visitTypeShortName: VisitTypeShortName, startDate: Date?, endDate: Date?) async throws -> ProviderTimeSlot
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.
visitTypeShortName
A shortName of the visitType for which you are retrieving
ProviderTimeSlot
for. SeeProviderVisitType
Return Value
ProviderTimeSlot
information -
Fetches the maximum number of days beyond Today that
getProviderTimeSlots
can return results for.Throws
Throws:FailedReason
Declaration
Swift
func getMaxLookaheadDays(visitTypeShortName: VisitTypeShortName, ehrSystemName: String) async throws -> Int
Parameters
visitTypeShortName
The
shortName
of theProviderVisitType
to check the max lookahead days for.Return Value
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
. -
scheduleProviderVisit(paymentMethod:
AsynchronousproviderVisitInformation: timeSlot: ehrSystemName: patientDexCarePatient: actorDexCarePatient: ) Schedules a visit with a Provider.
Throws
Throws:ScheduleProviderAppointmentFailedReason
Declaration
Swift
func scheduleProviderVisit(paymentMethod: PaymentMethod, providerVisitInformation: ProviderVisitInformation, timeSlot: TimeSlot, ehrSystemName: String, patientDexCarePatient: DexcarePatient, actorDexCarePatient: DexcarePatient?) async throws -> ScheduledProviderVisit
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
Return Value
The
ScheduledProviderVisit
structure containing information of the visit