private SearchPatient GetSearchPatient(DsioSearchPatient commandPatient) { // *** Gets a SearchPatient based on string only commandPatient *** // *** Get the tracking status *** CurrentTrackingStatus trackStat = GetTrackingStatus(commandPatient.TrackingStatus); // *** Create the new patient *** SearchPatient uiPatient = new SearchPatient() { Dfn = commandPatient.Dfn, LastName = commandPatient.LastName, FirstName = commandPatient.FirstName, Veteran = commandPatient.Veteran, Location = commandPatient.Location, RoomBed = commandPatient.RoomBed, CurrentlyTracking = trackStat }; uiPatient.Sensitive = (commandPatient.Sensitive == "1") ? true : false; //// *** Determine if sensitive *** //if (commandPatient.Last4.Contains("SENSITIVE")) // uiPatient.Sensitive = true; //else if (!uiPatient.Sensitive) { // *** Prepare SSN *** uiPatient.Last4 = commandPatient.Last4; uiPatient.FullSSN = string.Format("XXX-XX-{0}", uiPatient.Last4); // *** Handle DOB *** //DateTime dob = DateTime.MinValue ; //if (DateTime.TryParse(commandPatient.DateOfBirth, out dob)) // uiPatient.DateOfBirth = dob; //else //{ // uiPatient.DateOfBirth = DateTime.MinValue; // ErrorLogger.Log(string.Format("PatientRepository.GetSearchPatient: Could not parse date [{0}]", commandPatient.DateOfBirth )); //} // *** Process/Parse dob *** DateTime dob; if (DateTime.TryParse(commandPatient.DateOfBirth, out dob)) { uiPatient.DateOfBirth = dob; } else { uiPatient.DateOfBirthInexact = Util.GetInexactDate(commandPatient.DateOfBirth); } } return(uiPatient); }
private CurrentTrackingStatus GetTrackingStatus(string trackingStatus) { CurrentTrackingStatus returnVal = CurrentTrackingStatus.No; switch (trackingStatus) { case "1": returnVal = CurrentTrackingStatus.Yes; break; case "2": returnVal = CurrentTrackingStatus.Flagged; break; case "0": default: returnVal = CurrentTrackingStatus.No; break; } return(returnVal); }