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
brandBrand name of clinics to request
successA closure called with the array of
ClinicobjectsfailureA closure called if the request is unsuccessful with a FailedReason describing the error
-
Returns a
ClinicTimeSlotobject that have information about a particular date range withTimeSlotDeclaration
Swift
func getTimeSlots(departmentName: String, visitTypeShortName: VisitTypeShortName?, success: @escaping (ClinicTimeSlot) -> Void, failure: @escaping (FailedReason) -> Void)Parameters
departmentNamethe
Clinic.departmentNameproperty that was retrieved withfunc getClinics(brand: String, ...)visitTypeShortNamethe optional
VisitTypeShortNameproperty that was retrieved withfunc getClinics(brand: String, ...). EachClinichas a list ofAllowedVisitType, which represents visit types the Clinic supports. This parameter will accept any visit type short name as defined on your Epic Instance. Ifnil, SDK will automatically load withVisitTypeShortName.Illness`.successThe closure called with a
ClinicTimeSlotobjectfailureA 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
actorDexCarePatientcan be nil. When scheduling for a dependent, theactorDexCarePatientmust be theDexcarePatientobject of the logged-in user, and thepatientDexCarePatientmust be the dependent. If you do not have aDexcarePatientobject for the dependent, you can call,PatientService.findOrCreateDependentPatientto 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
paymentMethodAn enum with cases for each accepted payment method and associated values for additional required information specific to each case.
visitInformationadditional 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.
timeslotThe timeslot the user has selected from the list returned from call to
timeslots(clinicURLName:success:failure)ehrSystemNameThe EHR System to where the retail visit is being booked. This is usually grabbed from
Clinic.ehrSystemNamepatientDexCarePatientThe
DexcarePatientobject for the patient that the visit is for. When booking for a dependent, this will be the dependentactorDexCarePatientThe
DexcarePatientobject of the actor for when you are booking for a dependent patient. When booking for myself, this can be set to nil.successThe closure called with the Retail Visit Id of the successful retail visit booking.
failureA closure called if any
ScheduleRetailAppointmentFailedReasonerrors are returned
View on GitHub
Install in Dash
RetailService Protocol Reference