public static void modInjectionNetWork(string accessionNumber, Modality modality, string patientID, string patientSurname, string patientLastname, string UniqueExamIdentifier, string ExamCode, string DateOfBirth, bool Gender, bool Inpatient, string WardNumber, ObservableCollection <RP> RPs, Doctor Doctor, float UptakeTime, DateTime InjectionTime, Room SelectedRoom, bool isContrast, bool isDelay, string patientStatus) { Injection injection = modInjection(accessionNumber, modality, patientID, patientSurname, patientLastname, UniqueExamIdentifier, ExamCode, DateOfBirth, Gender, Inpatient, WardNumber, RPs, Doctor, UptakeTime, InjectionTime, SelectedRoom, isContrast, isDelay, patientStatus); if (!NetworkManager.isServer) { NetworkManager.client.TCPSendMessageToServer("modInjection", injection.toXML().ToString()); } else { NetworkManager.server.TCPBroadcastMessage("modInjection", injection.toXML().ToString()); } }
/// <summary> /// /// </summary> /// <param name="accessionNumber">leave accessionNumber as empty to generate new injection</param> /// <param name="patientID"></param> /// <param name="patientSurname"></param> /// <param name="patientLastname"></param> /// <param name="RPs"></param> /// <param name="Doctor"></param> /// <param name="UptakeTime"></param> /// <param name="InjectionTime"></param> /// <param name="SelectedRoom"></param> /// <param name="isContrast"></param> /// <param name="isDelay"></param> /// <param name="isDischarge"></param> /// <returns></returns> private static Injection modInjection(string accessionNumber, Modality modality, string patientID, string patientSurname, string patientLastname, string UniqueExamIdentifier, string ExamCode, string DateOfBirth, bool Gender, bool Inpatient, string WardNumber, ObservableCollection <RP> RPs, Doctor Doctor, float UptakeTime, DateTime InjectionTime, Room SelectedRoom, bool isContrast, bool isDelay, string patientStatus) { // find wether the patient is already registered and exist in the database Patient patient; if (PatientManager.HasPatient(patientID)) { patient = PatientManager.GetPatient(patientID); } else { patient = new Patient(); patient.PatientID = patientID; } // find whether the injection is already registered and exist in the database Injection injection; if (hasInjection(accessionNumber)) { injection = getInjection(accessionNumber); } // loading previous injection from elsewhere else if (accessionNumber != "") { injection = new Injection(); injection.AccessionNumber = accessionNumber; injections.Add(injection); } // adding completely new injection else { injection = new Injection(); injection.AccessionNumber = Guid.NewGuid().ToString(); injections.Add(injection); } // modify the patient information injection.Patient = patient; patient.PatientSurname = patientSurname; patient.PatientLastname = patientLastname; // modify the optional patient information // only a couple of patient information is modifiable patient.ExamCode = ExamCode; patient.UniqueExamIdentifier = UniqueExamIdentifier; patient.DateOfBirth = DateOfBirth; patient.IsMale = Gender; patient.IsInpatient = Inpatient; patient.WardNumber = WardNumber; // modify the injection information injection.Modality = modality; injection.RPs = RPs; injection.Doctor = Doctor; injection.UptakeTime = UptakeTime; injection.InjectionTime = InjectionTime; injection.SelectedRoom = SelectedRoom; injection.isContrast = isContrast; injection.isDelay = isDelay; injection.patientStatus = patientStatus; // add the patient to the patient manager, and save the patient information as an xml PatientManager.ModPatient(patient); // update the search string used for searching injection in InjectionPage // search string contained all information of the injection compressed in string format injection.updateSearchString(); // recalculate the case number, // it is useful when the injection time is changed, since some injection may swap recreateObservableList(); // save the injection in xml format saveInjection(injection.AccessionNumber); return(injection); }