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 getClinics(brand: String, success: @escaping ([Clinic]) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
brand
Brand name of clinics to request
success
A closure called with the array of
Clinic
objectsfailure
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 (ClinicTimeSlot) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
departmentName
the
Clinic.departmentName
property that was retrieved withfunc getClinics(brand: String, ...)
visitTypeShortName
the optional
VisitTypeShortName
property that was retrieved withfunc getClinics(brand: String, ...). Each
Clinichas a list of
AllowedVisitType, which represents visit types the Clinic 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
ClinicTimeSlot
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 timeslot 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