RetailService
public protocol RetailService
The main protocol used to call retail visit services
-
Returns a list of clinics that are associated with retail visits for the given brand
Declaration
Swift
func getRetailDepartments(brand: String, success: @escaping ([RetailDepartment]) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
brand
Brand name of clinics to request
success
A closure called with the array of
RetailDepartment
objectsfailure
A closure called if the request is unsuccessful with a FailedReason describing the error
-
Returns a list of clinics that are associated with retail visits for the given brand
Declaration
Swift
func getRetailDepartment(departmentName: String, success: @escaping (RetailDepartment) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
departmentName
success
A closure called with
RetailDepartment
objectfailure
A closure called if the request is unsuccessful with a FailedReason describing the error
-
Returns a
ClinicTimeSlot
object that have information about a particular date range withTimeSlot
Declaration
Swift
func getTimeSlots(departmentName: String, visitTypeShortName: VisitTypeShortName?, success: @escaping (RetailAppointmentTimeSlot) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
departmentName
the
Clinic.departmentName
property that was retrieved withfunc getRetailDepartments(brand: String, ...)
visitTypeShortName
the optional
VisitTypeShortName
property that was retrieved withfunc getRetailDepartments(brand: String, ...). Each
RetailDepartmenthas a list of
AllowedVisitType, which represents visit types the RetailDepartment supports. This parameter will accept any visit type short name as defined on your Epic Instance. If
nil, SDK will automatically load with
VisitTypeShortName.Illness`.success
The closure called with a
RetailAppointmentTimeSlot
objectfailure
A closure called if any FailedReason errors are returned
-
scheduleRetailAppointment(paymentMethod:
visitInformation: timeSlot: ehrSystemName: patientDexCarePatient: actorDexCarePatient: success: failure: ) Schedules an appointment for a retail visit.
When scheduling for the logged-in user, the
actorDexCarePatient
can be nil. When scheduling for a dependent, theactorDexCarePatient
must be theDexcarePatient
object of the logged-in user, and thepatientDexCarePatient
must be the dependent. If you do not have aDexcarePatient
object for the dependent, you can call,PatientService.findOrCreateDependentPatient
to create one in the system first.Declaration
Swift
func scheduleRetailAppointment( paymentMethod: PaymentMethod, visitInformation: RetailVisitInformation, timeSlot: TimeSlot, ehrSystemName: String, patientDexCarePatient: DexcarePatient, actorDexCarePatient: DexcarePatient?, success: @escaping (String) -> Void, failure: @escaping (ScheduleRetailAppointmentFailedReason) -> Void )
Parameters
paymentMethod
An enum with cases for each accepted payment method and associated values for additional required information specific to each case.
visitInformation
additional information needed for the visit including the reason-for-visit text entered by the user and a declaration which describes whether the visit is for the logged in user or another person.
timeSlot
The time slot the user has selected from the list returned from call to
timeSlots(clinicURLName:success:failure)
ehrSystemName
The EHR System to where the retail visit is being booked. This is usually grabbed from
Clinic.ehrSystemName
patientDexCarePatient
The
DexcarePatient
object for the patient that the visit is for. When booking for a dependent, this will be the dependentactorDexCarePatient
The
DexcarePatient
object of the actor for when you are booking for a dependent patient. When booking for myself, this can be set to nil.success
The closure called with the Retail Visit Id of the successful retail visit booking.
failure
A closure called if any
ScheduleRetailAppointmentFailedReason
errors are returned -
getRetailDepartments(brand:
Asynchronous) Returns a list of clinics that are associated with retail visits for the given brand
Throws
Throws:FailedReason
Declaration
Swift
func getRetailDepartments(brand: String) async throws -> [RetailDepartment]
Parameters
brand
Brand name of clinics to request
Return Value
An array of
Clinic
objects -
getTimeSlots(departmentName:
AsynchronousvisitTypeShortName: ) Returns a
ClinicTimeSlot
object that have information about a particular date range withTimeSlot
Throws
FailedReason
Declaration
Swift
func getTimeSlots(departmentName: String, visitTypeShortName: VisitTypeShortName?) async throws -> RetailAppointmentTimeSlot
Parameters
departmentName
the
Clinic.departmentName
property that was retrieved withfunc getRetailDepartments(brand: String, ...)
visitTypeShortName
the optional
VisitTypeShortName
property that was retrieved withfunc getRetailDepartments(brand: String, ...). Each
Clinichas a list of
AllowedVisitType, which represents visit types the RetailDepartment supports. This parameter will accept any visit type short name as defined on your Epic Instance. If
nil, SDK will automatically load with
VisitTypeShortName.Illness`.Return Value
a
ClinicTimeSlot
object -
scheduleRetailAppointment(paymentMethod:
AsynchronousvisitInformation: timeSlot: ehrSystemName: patientDexCarePatient: actorDexCarePatient: ) Schedules an appointment for a retail visit.
When scheduling for the logged-in user, the
actorDexCarePatient
can be nil. When scheduling for a dependent, theactorDexCarePatient
must be theDexcarePatient
object of the logged-in user, and thepatientDexCarePatient
must be the dependent. If you do not have aDexcarePatient
object for the dependent, you can call,PatientService.findOrCreateDependentPatient
to create one in the system first.Declaration
Swift
func scheduleRetailAppointment( paymentMethod: PaymentMethod, visitInformation: RetailVisitInformation, timeSlot: TimeSlot, ehrSystemName: String, patientDexCarePatient: DexcarePatient, actorDexCarePatient: DexcarePatient? ) async throws -> String
Parameters
paymentMethod
An enum with cases for each accepted payment method and associated values for additional required information specific to each case.
visitInformation
additional information needed for the visit including the reason-for-visit text entered by the user and a declaration which describes whether the visit is for the logged in user or another person.
timeSlot
The time slot the user has selected from the list returned from call to
timeSlots(clinicURLName:success:failure)
ehrSystemName
The EHR System to where the retail visit is being booked. This is usually grabbed from
Clinic.ehrSystemName
patientDexCarePatient
The
DexcarePatient
object for the patient that the visit is for. When booking for a dependent, this will be the dependentactorDexCarePatient
The
DexcarePatient
object of the actor for when you are booking for a dependent patient. When booking for myself, this can be set to nil.Return Value
The Retail Visit Id of the successful retail visit booking.
-
getRetailDepartment(departmentName:
Asynchronous) Returns a list of clinics that are associated with retail visits for the given brand
Throws
FailedReason
Declaration
Swift
func getRetailDepartment(departmentName: String) async throws -> RetailDepartment
Parameters
departmentName
Return Value
The
RetailDepartment
object found