PatientService
public protocol PatientService
Base Protocol used to create patients, get patients
-
Returns the DexcarePatient that is available after setting the Authentication Token
Precondition
dexcareSDK.authentication.signIn()
must be set with a valid accessTokenDeclaration
Swift
func getPatient(success: @escaping (DexcarePatient) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
success
The closure called with the DexcarePatient in the system
failure
A closure called if any FailedReason errors are returned
-
Returns a
CatchmentArea
type that will determine a virtual department’s EHR system based on the visitState and patient’s address.Declaration
Swift
func getCatchmentArea(visitState: String, residenceState: String, residenceZipCode: String, brand: String, success: @escaping (CatchmentArea) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
visitState
The United States ISO 3166 Subdivision code (
WA
,CA
) for the state in which the visit will take placeresidenceState
The United States ISO 3166 Subdivision code (
WA
,CA
) where the resident residesresidenceZipCode
The 5 digit zip code (or PostalCode) where the resident resides
brand
Brand name used to filter down any EHR Systems
success
The closure called with the CatchmentArea in the system on success
failure
A closure called if any FailedReason errors are returned
-
Creates a Dexcare patient.
The SDK will return the patient found in the requested EHR system. If no patient with the same patientGuid is found, the system will attempt to find a matching patient by fuzzy matching with the patient demographics passed in, link that EHR patient record with the DexcarePatient and return it. If no patient record can be found in the EHR system, a new one is created, linked to the DexcarePatient and returned.
Precondition
dexcareSDK.authentication.signIn()
must be set with a valid accessTokenDeclaration
Swift
func findOrCreatePatient(inEhrSystem: String, patientDemographics: PatientDemographics, success: @escaping (DexcarePatient) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
ehrSystem
The Ehr System name that will be used in creating the patient
patientDemographics
Patient Demographic information used to create the patient. Note: PatientDemographics.ehrSystemName will use
ehrSystem
that is passed in to override any existing EHRSystem already in demographicssuccess
The closure called with the DexcarePatient in the system
failure
A closure called if any FailedReason errors are returned
-
Creates a Dexcare dependent patient.
This api will find or create a DexCare patient record for the patient, without linking it to the current authorized account.
Precondition
dexcareSDK.authentication.signIn()
must be set with a valid accessTokenDeclaration
Swift
func findOrCreateDependentPatient(inEhrSystem: String, dependentPatientDemographics: PatientDemographics, success: @escaping (DexcarePatient) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
ehrSystem
The Ehr System name that will be used in creating the patient
dependentPatientDemographics
Dependent Patient Demographic information used to create the dependent patient. Note: PatientDemographics.ehrSystemName will use
ehrSystem
that is passed in to override any existing EHRSystem already in demographicssuccess
The closure called with the DexcarePatient in the system
failure
A closure called if any FailedReason errors are returned
-
Creates a Dexcare Patient by linking the MyChart information
Creates a DexcarePatient by using MyChart information to locate the EHR patient record. If a DexcarePatient is already linked to an EHR patient record, the SDK will return that DexcarePatient.
Precondition
dexcareSDK.authentication.signIn()
must be set with a valid accessTokenDeclaration
Swift
func createPatientWithMyChart(myChartUserName: String, myChartPassword: String, ehrSystem: String, success: @escaping (DexcarePatient) -> Void, failure: @escaping (FailedReason) -> Void)
Parameters
myChartUserName
The MyChart username used to log in
myChartPassword
The MyChart password used to log in
success
The closure called with the DexcarePatient in the system
failure
A closure called if any FailedReason errors are returned
-
Loads a list of suffixes from the server
These can be used in a drop down for demographics. Changes to this list can be changed on the server only.
Declaration
Swift
func getSuffixes(success: @escaping (([String]) -> Void), failure: @escaping ((FailedReason) -> Void))
Parameters
success
The closure called with an array of Strings of suffixes. ie [“Dr”, “Jr.”, “III”]
failure
A closure called if any FailedReason errors are returned