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
successThe closure called with the DexcarePatient in the system
failureA closure called if any FailedReason errors are returned
-
Returns the DexcarePatient from EMR that is available after setting the Authentication Token
Precondition
dexcareSDK.authentication.signIn()must be set with a valid accessToken from MyChartDeclaration
Swift
func getEMRPatient(success: @escaping (DexcarePatient) -> Void, failure: @escaping (FailedReason) -> Void)Parameters
successThe closure called with the DexcarePatient in the system
failureA 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
ehrSystemThe Ehr System name that will be used in creating the patient
patientDemographicsPatient Demographic information used to create the patient. Note: PatientDemographics.ehrSystemName will use
ehrSystemthat is passed in to override any existing EHRSystem already in demographicssuccessThe closure called with the DexcarePatient in the system
failureA 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
ehrSystemThe Ehr System name that will be used in creating the patient
dependentPatientDemographicsDependent Patient Demographic information used to create the dependent patient. Note: PatientDemographics.ehrSystemName will use
ehrSystemthat is passed in to override any existing EHRSystem already in demographicssuccessThe closure called with the DexcarePatient in the system
failureA 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
successThe closure called with an array of Strings of suffixes. ie [“Dr”, “Jr.”, “III”]
failureA closure called if any FailedReason errors are returned
-
Sends a request to delete the Patient Account at DexCare This does not delete any epic or other accounts. The request may not be instant and may take some time to fully delete.
Declaration
Swift
func deletePatientAccount(success: @escaping (() -> Void), failure: @escaping ((FailedReason) -> Void))Parameters
successThe closure called when successfully returned
failureA closure called if any FailedReason errors are returned
-
getPatient()AsynchronousReturns the DexcarePatient that is available after setting the Authentication Token
Throws
Throws:FailedReasonPrecondition
dexcareSDK.authentication.signIn()must be set with a valid accessTokenDeclaration
Swift
func getPatient() async throws -> DexcarePatientReturn Value
The
DexcarePatientin the system -
getEMRPatient()AsynchronousReturns the DexcarePatient from EMR that is available after setting the Authentication Token
Throws
Throws:FailedReasonPrecondition
dexcareSDK.authentication.signIn()must be set with a valid accessToken from MyChartDeclaration
Swift
func getEMRPatient() async throws -> DexcarePatientReturn Value
The
DexcarePatientin the system -
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.
Throws
Throws:FailedReasonPrecondition
dexcareSDK.authentication.signIn()must be set with a valid accessTokenDeclaration
Swift
func findOrCreatePatient(inEhrSystem: String, patientDemographics: PatientDemographics) async throws -> DexcarePatientParameters
ehrSystemThe Ehr System name that will be used in creating the patient
patientDemographicsPatient Demographic information used to create the patient. Note: PatientDemographics.ehrSystemName will use
ehrSystemthat is passed in to override any existing EHRSystem already in demographicsReturn Value
The
DexcarePatientin the system -
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.
Throws
FailedReasonPrecondition
dexcareSDK.authentication.signIn()must be set with a valid accessTokenDeclaration
Swift
func findOrCreateDependentPatient(inEhrSystem: String, dependentPatientDemographics: PatientDemographics) async throws -> DexcarePatientParameters
ehrSystemThe Ehr System name that will be used in creating the patient
dependentPatientDemographicsDependent Patient Demographic information used to create the dependent patient. Note: PatientDemographics.ehrSystemName will use
ehrSystemthat is passed in to override any existing EHRSystem already in demographicsReturn Value
The
DexcarePatientin the system -
getSuffixes()AsynchronousLoads 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.
Throws
Throws:FailedReasonDeclaration
Swift
func getSuffixes() async throws -> [String]Return Value
An array of Strings of suffixes. ie [“Dr”, “Jr.”, “III”]
-
deletePatientAccount()AsynchronousSends a request to delete the Patient Account at DexCare This does not delete any epic or other accounts. The request may not be instant and may take some time to fully delete.
Throws
FailedReasonDeclaration
Swift
func deletePatientAccount() async throwsReturn Value
If returns, successfully started the deletion process
View on GitHub
Install in Dash