// this test will test the updating/overwriting of patient data with the data from the external system // if the patient is already deleted, it will undelete it. public void BLL_update_fhir_patient() { // should match patient in load above. FHIR_Patient fp1 = new FHIR_Patient { External_id = "1000023", External_source = "https://fhir.test.com", Address = "1818 Thomas Lane", LastName = "Fhirtest", FirstName = "April", MRN = "5678" }; var pat = ClinicalBLL.GetPatient_External_Id_Source(fp1); Assert.AreEqual("4100", pat.MRN); Assert.AreEqual("5 Main Street", pat.AddressLine1); ClinicalBLL.update_fhir_patient(fp1); var uac_l = ClinicalBLL.GetAllUserActions(); Assert.AreEqual(pat.id, uac_l.Last().Patient_id); Assert.AreEqual(ClinicalBLL.UserActionCode.External_Patient_Updated.ToString(), uac_l.Last().Action_id); Assert.AreEqual(ClinicalBLL.UserActionDesc[ClinicalBLL.UserActionCode.External_Patient_Updated], uac_l.Last().Action_desc); var pat1 = ClinicalBLL.GetPatient_MRN("4100"); Assert.AreEqual(fp1.Address, pat1.AddressLine1); }
public void BLL_add_fhir_patient() { FHIR_Patient fp1 = new FHIR_Patient { External_id = "100008", External_source = "https://fhir.test.com", LastName = "Fhirtest", FirstName = "April", MRN = "5678" }; var patient_id = ClinicalBLL.add_fhir_patient(fp1); var uac_l = ClinicalBLL.GetAllUserActions(); Assert.AreEqual(patient_id, uac_l.Last().Patient_id); Assert.AreEqual(ClinicalBLL.UserActionCode.External_Patient_Added.ToString(), uac_l.Last().Action_id); Assert.AreEqual(ClinicalBLL.UserActionDesc[ClinicalBLL.UserActionCode.External_Patient_Added], uac_l.Last().Action_desc); Assert.AreEqual("test", uac_l.Last().User); var pat = ClinicalBLL.GetPatient_MRN("5678"); Assert.AreEqual(fp1.LastName, pat.LastName); Assert.AreEqual(fp1.External_id, pat.External_id); Assert.AreEqual(fp1.External_source, pat.External_source); }