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 objects

    failure

    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 object

    failure

    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 with TimeSlot

    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 with func getRetailDepartments(brand: String, ...)

    visitTypeShortName

    the optionalVisitTypeShortName property that was retrieved with func 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`.

    success

    The closure called with a RetailAppointmentTimeSlot object

    failure

    A closure called if any FailedReason errors are returned

  • Schedules an appointment for a retail visit.

    When scheduling for the logged-in user, the actorDexCarePatient can be nil. When scheduling for a dependent, the actorDexCarePatient must be the DexcarePatient object of the logged-in user, and thepatientDexCarePatient must be the dependent. If you do not have a DexcarePatient 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 dependent

    actorDexCarePatient

    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

  • 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

  • Returns a ClinicTimeSlot object that have information about a particular date range with TimeSlot

    Throws

    FailedReason

    Declaration

    Swift

    func getTimeSlots(departmentName: String, visitTypeShortName: VisitTypeShortName?) async throws -> RetailAppointmentTimeSlot

    Parameters

    departmentName

    the Clinic.departmentName property that was retrieved with func getRetailDepartments(brand: String, ...)

    visitTypeShortName

    the optionalVisitTypeShortName property that was retrieved with func 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 ClinicTimeSlot object

  • Schedules an appointment for a retail visit.

    When scheduling for the logged-in user, the actorDexCarePatient can be nil. When scheduling for a dependent, the actorDexCarePatient must be the DexcarePatient object of the logged-in user, and thepatientDexCarePatient must be the dependent. If you do not have a DexcarePatient 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 dependent

    actorDexCarePatient

    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.

  • 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