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
brandBrand name of clinics to request
successA closure called with the array of
RetailDepartmentobjectsfailureA 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, includeProvider: Bool, success: @escaping (RetailDepartment) -> Void, failure: @escaping (FailedReason) -> Void)Parameters
departmentNameincludeProviderFlag to get providers associated with a department
successA closure called with
RetailDepartmentobjectfailureA 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 (RetailAppointmentTimeSlot) -> Void, failure: @escaping (FailedReason) -> Void)Parameters
departmentNamethe
Clinic.departmentNameproperty that was retrieved withfunc getRetailDepartments(brand: String, ...)visitTypeShortNamethe optional
VisitTypeShortNameproperty that was retrieved withfunc getRetailDepartments(brand: String, ...). EachRetailDepartmenthas a list ofAllowedVisitType, which represents visit types the RetailDepartment 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
RetailAppointmentTimeSlotobjectfailureA 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 time slot 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 -
getRetailDepartments(brand:Asynchronous) Returns a list of clinics that are associated with retail visits for the given brand
Throws
Throws:FailedReasonDeclaration
Swift
func getRetailDepartments(brand: String) async throws -> [RetailDepartment]Parameters
brandBrand name of clinics to request
Return Value
An array of
Clinicobjects -
getTimeSlots(departmentName:AsynchronousvisitTypeShortName: ) Returns a
ClinicTimeSlotobject that have information about a particular date range withTimeSlotThrows
FailedReasonDeclaration
Swift
func getTimeSlots(departmentName: String, visitTypeShortName: VisitTypeShortName?) async throws -> RetailAppointmentTimeSlotParameters
departmentNamethe
Clinic.departmentNameproperty that was retrieved withfunc getRetailDepartments(brand: String, ...)visitTypeShortNamethe optional
VisitTypeShortNameproperty that was retrieved withfunc getRetailDepartments(brand: String, ...). EachClinichas a list ofAllowedVisitType, which represents visit types the RetailDepartment supports. This parameter will accept any visit type short name as defined on your Epic Instance. Ifnil, SDK will automatically load withVisitTypeShortName.Illness`.Return Value
a
ClinicTimeSlotobject -
scheduleRetailAppointment(paymentMethod:AsynchronousvisitInformation: timeSlot: ehrSystemName: patientDexCarePatient: actorDexCarePatient: ) 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? ) async throws -> StringParameters
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 time slot 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.Return Value
The Retail Visit Id of the successful retail visit booking.
-
getRetailDepartment(departmentName:AsynchronousincludeProvider: ) Returns a list of clinics that are associated with retail visits for the given brand
Throws
FailedReasonDeclaration
Swift
func getRetailDepartment(departmentName: String, includeProvider: Bool) async throws -> RetailDepartmentParameters
departmentNameincludeProviderFlag to get providers associated with a department
Return Value
The
RetailDepartmentobject found
View on GitHub
Install in Dash