DexCare SDK 8.0.0

This page contains information on how to upgrade from SDK 7.X to SDK 8.0. For a full list of changes, see the Release Notes.

Swift Concurrency Support

8.0 has been updated to support Swift Concurrency. Internally, all code uses Swift Concurrency instead of PromiseKit. With that change we have removed PromiseKit as a required dependency. If you use PromiseKit inside your app, you may have to add it manually (instead of depending on DexCareSDK to import it)

All public functions now have an equivalent async/await call.

// example function using closures
func getPatient(success: @escaping (DexcarePatient) -> Void, failure: @escaping (FailedReason) -> Void)

// same function using concurrency 
func getPatient() async throws -> DexcarePatient

// example of using Swift Concurrency
do {
    let patient = await sdk.patientService.getPatient()
} catch { 
    // error is of type `FailedReason`
}

EHRPatient & DexCarePatient

One of the major upgrades of 8.0 is the ability to start a virtual visit, by passing up a patients EPI/MRN and homeMarket instead of going through DexCare. This can be used by clients that take care of their own demographics. DexCare will take that identifier and load the Epic information.

DexCarePatient are patients that are handled by DexCare - ones with PatientGuid’s that can be loaded via the PatientService.getPatient call.

EHRPatient are patients that are handled by the client, and are used with an EPI/MRN along with a homeMarket (the EHR System).

VirtualService.createVirtualVisit

After upgrade you’ll receive:

Value of type 'VirtualService' has no member 'startVirtualVisit'

8.0 has a new method (but similar) method createVirtualVisit. There are 2 overriden methods. One that takes in a DexcarePatient and one that takes in an EHRPatient. Both call the same endpoint and return the same values.

Instead of using VirtualVisitDetails you’ll se the new VirtualVisitInformation object. Below are some of the differences between the 2

VirtualVisitInformation

VirtualVisitInformation has been removed and replaced with VirtualVisitDetails

VirtualVisitInformation - 7.X VirtualVisitDetails - 8.0 Comment
visitReason visitReason -
patientDeclaration patientDeclaration -
acceptedTerms acceptedTerms -
userEmail userEmail -
contactPhoneNumber contactPhoneNumber -
preTriageTags preTriageTags -
actorRelationshipToPatient actorRelationshipToPatient -
practiceRegionId - removed in favour of using stateLicensure
- stateLicensure two character state code
- visitTypeName virtual or phone if supported
- practiceId optional - default practice used if not passed in
- brand optional - default brand used if not passed in
- assessmentToolUsed optional - what preassessment tool used
- interpreterLanguage optional - language to request if interpreter services are available
- assignmentQualifiers optional - array - adult, pediatric
- urgency optional - 0 default, otherwise “high priority”
- homeMarket optional - string used to further filter area if needed
- initialStatus optional - VisitStatus type used to set a virtual visit with a default state
- traveling optional - Boolean type used in some environments to indicate patient is out of state

WaitTimes

Value of type 'PracticeService' has no member 'getVirtualPracticeRegionAvailability'
Value of type 'PracticeService' has no member 'getEstimatedWaitTime'

WaitTimes have been upgraded and can be called via VirtualService.getWaitTimeAvailability, passing in filters to receive an array of WaitTimeAvailability structures containing information about estimated waittimes.

OLD

let dexcareSDK = DexcareSDK(configuration: ...)
dexcareSDK.practiceService.getEstimatedWaitTime(practiceRegionId: practiceInfo.practiceRegion.practiceRegionId)

NEW

let dexcareSDK = DexcareSDK(configuration: ...)
dexcareSDK.virtualService.getWaitTimeAvailability(regionCodes: ["WA"], assignmentQualifiers: nil, visitTypeNames: nil, practiceId: practiceId, homeMarket: nil)
// or
dexcareSDK.virtualService.getWaitTimeAvailability(regionCodes: ["WA"], assignmentQualifiers: nil, visitTypeNames: [.illness], practiceId: nil, homeMarket: nil)