protected override void ProcessLine(string line) { // DFN^LASTNAME,FIRSTNAME^SSN(LAST 4)^DATE OF BIRTH^VETERAN STATUS^LOCATION(WARD)^ROOM/BED^SERVICE CONNECTED^CURRENTLY TRACKING^SSN^CITY^STATE^ZIP^SENSITIVE STATUS (1,0) //; CURRENTLY TRACKING: 0:NO,1:YES,2:FLAG //; IF NOTHING IS FOUND: RET(0)="0^Patient(s) not found." string fullName = Util.Piece(line, CommandBase.Caret, 2); string lastName = Util.Piece(fullName, ",", 1); string firstName = Util.Piece(fullName, ",", 2); DsioSearchPatient tempPatient = new DsioSearchPatient() { Dfn = Util.Piece(line, CommandBase.Caret, 1), LastName = lastName, FirstName = firstName, Last4 = Util.Piece(line, CommandBase.Caret, 3), DateOfBirth = Util.Piece(line, CommandBase.Caret, 4), Veteran = Util.Piece(line, CommandBase.Caret, 5), Location = Util.Piece(line, CommandBase.Caret, 6), RoomBed = Util.Piece(line, CommandBase.Caret, 7), ServiceConnected = Util.Piece(line, CommandBase.Caret, 8), TrackingStatus = Util.Piece(line, CommandBase.Caret, 9), SSN = Util.Piece(line, Caret, 10), City = Util.Piece(line, Caret, 11), State = Util.Piece(line, Caret, 12), Zip = Util.Piece(line, Caret, 13), Sensitive = Util.Piece(line, Caret, 14) }; this.MatchingPatients.Add(tempPatient); }
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); }