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 accessToken

    Declaration

    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 the DexcarePatient from EMR that is available after setting the Authentication Token

    Precondition

    dexcareSDK.authentication.signIn() must be set with a valid accessToken from MyChart

    Declaration

    Swift

    func getEMRPatient(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

  • 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 accessToken

    Declaration

    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 demographics

    success

    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 accessToken

    Declaration

    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 demographics

    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

  • 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

    success

    The closure called when successfully returned

    failure

    A closure called if any FailedReason errors are returned

  • getPatient() Asynchronous

    Returns the DexcarePatient that is available after setting the Authentication Token

    Throws

    Throws:FailedReason

    Precondition

    dexcareSDK.authentication.signIn() must be set with a valid accessToken

    Declaration

    Swift

    func getPatient() async throws -> DexcarePatient

    Return Value

    The DexcarePatient in the system

  • getEMRPatient() Asynchronous

    Returns the DexcarePatient from EMR that is available after setting the Authentication Token

    Throws

    Throws:FailedReason

    Precondition

    dexcareSDK.authentication.signIn() must be set with a valid accessToken from MyChart

    Declaration

    Swift

    func getEMRPatient() async throws -> DexcarePatient

    Return Value

    The DexcarePatient in 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:FailedReason

    Precondition

    dexcareSDK.authentication.signIn() must be set with a valid accessToken

    Declaration

    Swift

    func findOrCreatePatient(inEhrSystem: String, patientDemographics: PatientDemographics) async throws -> DexcarePatient

    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 demographics

    Return Value

    The DexcarePatient in 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

    FailedReason

    Precondition

    dexcareSDK.authentication.signIn() must be set with a valid accessToken

    Declaration

    Swift

    func findOrCreateDependentPatient(inEhrSystem: String, dependentPatientDemographics: PatientDemographics) async throws -> DexcarePatient

    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 demographics

    Return Value

    The DexcarePatient in the system

  • getSuffixes() Asynchronous

    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.

    Throws

    Throws:FailedReason

    Declaration

    Swift

    func getSuffixes() async throws -> [String]

    Return Value

    An array of Strings of suffixes. ie [“Dr”, “Jr.”, “III”]

  • deletePatientAccount() Asynchronous

    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.

    Throws

    FailedReason

    Declaration

    Swift

    func deletePatientAccount() async throws

    Return Value

    If returns, successfully started the deletion process