public static bool HOHCheck(HealthCard newHCN, String newLastName, String newFirstName, String newDateBirth, char newSex, HealthCard newHeadOfHouse, char newMInitial) { bool allValid = false; if (newHCN.validateNumber(newHCN.ToString())) { if (ValidatePatient.validateLastName(newLastName)) { if (ValidatePatient.validateFirstName(newFirstName)) { if (ValidatePatient.validateDateBirth(newDateBirth)) { if (ValidatePatient.validateSex(newSex)) { if (ValidatePatient.validateHeadOfHouse(newHeadOfHouse)) { if ((newMInitial == '\0') || (ValidatePatient.validateMInitial(newMInitial))) { allValid = true; } } } } } } } return(allValid); }
/// \method validateHeadOfHouse /// ///Confirms that headOfHouse is a valid value to be entered into the Demographics database public static bool validateHeadOfHouse(HealthCard newHOH)////////////////////////////////////////////////////////////////////////////////// { bool retCode = false; string newHOHStr = newHOH.ToString(); retCode = false; return(retCode); }
/// \breif /// This Ctor handles the headOfHouse field option /// public PatientInfo(HealthCard newHCN, String newLastName, String newFirstName, String newDateBirth, char newSex, HealthCard newHeadOfHouse, char newMInitial) { hcn = newHCN; lastName = newLastName; firstName = newFirstName; dateBirth = newDateBirth; sex = newSex; newHeadOfHouse = headOfHouse; mInitial = newMInitial; }
public static PatientInfo spawnPatient(HealthCard newHCN, String newLastName, String newFirstName, String newDateBirth, char newSex, HealthCard newHeadOfHouse, char newMInitial) { PatientInfo patient; if (HOHCheck(newHCN, newLastName, newFirstName, newDateBirth, newSex, newHeadOfHouse, newMInitial)) { return(patient = new PatientInfo(newHCN, newLastName, newFirstName, newDateBirth, newSex, newHeadOfHouse, newMInitial)); } return(null); }
//Validate Address???? //Instantiate person info public static PatientInfo spawnPatient(HealthCard newHCN, String newLastName, String newFirstName, String newDateBirth, char newSex, String newAddressLine1, String newAddressLine2, String newCity, String newProvince, String newNumPhone, char newMInitial) { PatientInfo patient; if (noHOHCheck(newHCN, newLastName, newFirstName, newDateBirth, newSex, newAddressLine1, newAddressLine2, newCity, newProvince, newNumPhone, newMInitial)) { return(patient = new PatientInfo(newHCN, newLastName, newFirstName, newDateBirth, newSex, newAddressLine1, newAddressLine2, newCity, newProvince, newNumPhone, newMInitial)); } return(null); }
//instantiate HCN public static HealthCard instantiateHCN(String HCNNumber) { try { HealthCard HCN = new HealthCard(HCNNumber); return(HCN); } catch (Exception e) { throw new Exception("Health card number format is wrong. Error: {0}", e); } }
/// \method search /// /// \param HealthCard searchPatient /// /// \return foundPatient - All patients information /// ///This method takes a object of PatientInfo and searches for it in the patient database public List <PatientInfo> search(HealthCard searchPatient) { //bool found = false; List <PatientRecord> foundPatients = DAL.GetRecords(PatientRecordsAccessor.GETREQUEST.HEALTH_CARD_NUMBER, searchPatient.ToString()); List <PatientInfo> patientInfoList = new List <PatientInfo>(); foreach (PatientRecord record in foundPatients) { patientInfoList.Add(record.GetPatientInfo()); } return(patientInfoList); }
public static bool noHOHCheck(HealthCard newHCN, String newLastName, String newFirstName, String newDateBirth, char newSex, String newAddressLine1, String newAddressLine2, String newCity, String newProvince, String newNumPhone, char newMInitial) { bool allValid = false; if (newHCN.validateNumber(newHCN.ToString())) { if (ValidatePatient.validateLastName(newLastName)) { if (ValidatePatient.validateFirstName(newFirstName)) { if (ValidatePatient.validateDateBirth(newDateBirth)) { if (ValidatePatient.validateSex(newSex)) { if (ValidatePatient.validateAddressLine1(newAddressLine1)) { if ((newAddressLine2 == "") || (ValidatePatient.validateAddressLine2(newAddressLine2))) { if (ValidatePatient.validateCity(newCity)) { if ((newProvince == null) || (newProvince == "")) { newProvince = "ON"; } if (ValidatePatient.validateProvince(newProvince)) { if (ValidatePatient.validateNumPhone(newNumPhone)) { if ((newMInitial == '\0') || (ValidatePatient.validateMInitial(newMInitial))) { allValid = true; } } } } } } } } } } } return(allValid); }
public static bool buildPatientInfo(String HCNNumber, String newLastName, String newFirstName, String newDateBirth, char newSex, HealthCard newHeadOfHouse, char newMInitial) { bool successfulBuild = false; //Call all of the methods try { HealthCard HCN = instantiateHCN(HCNNumber); PatientInfo patient = spawnPatient(HCN, newLastName, newFirstName, newDateBirth, newSex, newHeadOfHouse, newMInitial); } catch (Exception e) { throw new Exception("There was an issue instantiating PersonInfo. Error: {0}", e); } return(successfulBuild); }
/// \breif /// This Ctor handles the non headOfHouse field option /// public PatientInfo(HealthCard newHCN, String newLastName, String newFirstName, String newDateBirth, char newSex, String newAddressLine1, String newAddressLine2, String newCity, String newProvince, String newNumPhone, char newMInitial) { hcn = newHCN; lastName = newLastName; firstName = newFirstName; dateBirth = newDateBirth; sex = newSex; patientAdress.AddressLine1 = newAddressLine1; patientAdress.AddressLine2 = newAddressLine2; patientAdress.City = newCity; if (newProvince.Length <= Globals.empty) { patientAdress.StateProvince = "ON"; } else { patientAdress.StateProvince = newProvince; } numPhone = newNumPhone; mInitial = newMInitial; }