Example #1
0
 public ParserParent(BackgroundWorker bWorker)
 {
     patients         = new PatientStorage();
     worker           = bWorker;
     currProgress     = 0;
     actionsCompleted = 0;
 }
Example #2
0
        public void ParseFiles(string file, PatientStorage patients, ref List <StudyHeader> parsedHeaders, ref Export export, Dictionary <string, bool> launch)
        {
            headers.fileName = Path.GetFileNameWithoutExtension(file);
            using (var stream = File.OpenRead(file))
                using (var reader = new StreamReader(stream))
                {
                    string line;
                    string mainFlag = "none";
                    while ((line = reader.ReadLine()) != null)
                    {
                        Match match = Regex.Match(line, @"\[([^)]*)\]");
                        if (match.Success)
                        {
                            mainFlag = match.Groups[1].Value;
                            continue;
                        }
                        currentStorage = _setupStorage(mainFlag, line);

                        if (currentStorage != null)
                        {
                            currentStorage.AddElement(currentStorage.AdditionalInfo + line);
                        }
                    }
                }

            StudyHeader currentExperiment = headers.ParseElements(patients);

            currentExperiment.TryParseFileNameArray();
            parsedHeaders.Add(currentExperiment);
            if (launch["Preassures"])
            {
                export.DumpValues("Preassures", preassureMeasurements.ParseElements(currentExperiment));
            }
            if (launch["Butterfly Parameters"])
            {
                export.DumpValues("ButterflyParameters", butterflyParameters.ParseElements(currentExperiment));
            }
            if (launch["Other Preassures"])
            {
                export.DumpValues("OtherPreassures", otherPressures.ParseElements(currentExperiment));
            }
            if (launch["Parameters"])
            {
                export.DumpValues("DynamicParameters", parameters.ParseElements(currentExperiment));
            }
            if (launch["Force Overlays"])
            {
                export.DumpValues("ForceOverlays", forceOverlays.ParseElements(currentExperiment));
            }
            if (launch["Max Forces"])
            {
                export.DumpValues("MaxForces", maxForces.ParseElements(currentExperiment));
            }
            if (launch["Other Parameters"])
            {
                export.DumpValues("OtherDynamicParameters", otherParameters.ParseElements(currentExperiment));
            }
        }
Example #3
0
        public SecretaryView()
        {
            InitializeComponent();
            this.DataContext = this;
            PatientStorage ps   = new PatientStorage();
            List <Patient> temp = ps.GetAll();

            Patients = new ObservableCollection <Patient>(temp);
        }
Example #4
0
 private void Delete_Button_Click(object sender, RoutedEventArgs e)
 {
     if (patientsTable.SelectedCells.Count > 0)
     {
         Patient        p  = (Patient)patientsTable.SelectedItem;
         PatientStorage ps = new PatientStorage();
         ps.Delete(p.Jmbg);
         Patients.Remove(p);
     }
     else
     {
         MessageBox.Show("Niste selektovali pacijenta!");
     }
 }
Example #5
0
        private void Save_Button_Click(object sender, RoutedEventArgs e)
        {
            Boolean isGuest = Convert.ToBoolean(IsGuest.IsChecked);

            if (isGuest == false && (((Name.Text).Trim().Equals("")) || ((Surname.Text).Trim().Equals("")) || ((Jmbg.Text).Trim().Equals("")) || ((PhoneNumber.Text).Trim().Equals("")) || ((Adress.Text).Trim().Equals("")) || ((Email.Text).Trim().Equals("")) || ((Username.Text).Trim().Equals("")) || ((Password.Text).Trim().Equals("")) || ((IdNumber.Text).Trim().Equals(""))))
            {
                MessageBox.Show("Nalog nije gostujuci! Morate popuniti sva polja!");
                return;
            }
            else if (isGuest == true && ((Jmbg.Text).Trim().Equals("")))
            {
                MessageBox.Show("JMBG pacijenta nije unet!");
                return;
            }

            string        mid       = MedicalIdNumber.Text;
            string        hin       = HealthEnsuranceNumber.Text;
            MedicalRecord medRecord = new MedicalRecord(hin, mid);

            string[] alls = Allergens.Text.Split(',');
            for (int i = 0; i < alls.Length; i++)
            {
                Allergen a = new Allergen(alls[i].Trim()); //?
                medRecord.AddAllergen(a);
            }

            string   name    = Name.Text;
            string   surname = Surname.Text;
            string   jmbg    = Jmbg.Text;
            DateTime date    = new DateTime(1900, 1, 1);

            try
            {
                date = DateTime.ParseExact(DateOfBirth.Text, "dd.MM.yyyy.", null);
            }
            catch { }

            Sex sex = Sex.male;

            if (Convert.ToBoolean(MSex.IsChecked))
            {
                sex = Sex.male;
            }
            else if (Convert.ToBoolean(FSex.IsChecked))
            {
                sex = Sex.female;
            }
            string phoneNumber = PhoneNumber.Text;
            string adress      = Adress.Text;
            string email       = Email.Text;
            string idNum       = IdNumber.Text;
            string emContact   = EmergencyContact.Text;
            string username    = Username.Text;
            string password    = Password.Text;

            Patient pat = new Patient(isGuest, name, surname, jmbg, date, sex, phoneNumber, adress, email, idNum, emContact, medRecord, username, password);

            PatientStorage ps = new PatientStorage();

            ps.Save(pat);
            SecretaryView.Patients.Add(pat);
            this.Close();

            return;
        }