Esempio n. 1
0
        private void setListBoxes()
        {
            AllergiesList.ItemsSource = new List <ModelHCI.AllergensHCI>();
            TherapyList.ItemsSource   = new List <ModelHCI.TherapyHCI>();
            ModelHCI.MedicalRecordHCI currentRecord = new ModelHCI.MedicalRecordHCI()
            {
                MedicalRecord = medicalRecordController.GetMedicalRecord(Informations.currentRecord.MedicalRecord.IdRecord)
            };


            List <ModelHCI.AllergensHCI> source = new List <ModelHCI.AllergensHCI>();

            foreach (Allergens allergens in currentRecord.MedicalRecord.Allergies)
            {
                source.Add(new ModelHCI.AllergensHCI()
                {
                    allergen = allergens.Allergen, allergens = allergens
                });
            }

            AllergiesList.ItemsSource = source;

            List <ModelHCI.TherapyHCI> therapies = new List <ModelHCI.TherapyHCI>();

            foreach (Therapy therapy in currentRecord.MedicalRecord.Therapies)
            {
                therapies.Add(new ModelHCI.TherapyHCI()
                {
                    medication = new ModelHCI.MedicationHCI()
                    {
                        name       = therapy.Medication.Med,
                        medication = therapy.Medication
                    },
                    therapy = therapy
                });
            }

            TherapyList.ItemsSource = therapies;
        }
Esempio n. 2
0
        private void DeleteAllergies_Click(object sender, RoutedEventArgs e)
        {
            if (selectedAllergy == null)
            {
                ErrorMessage.Visibility = Visibility.Visible;
                Error.Text = ERROR_DELETE;
                return;
            }


            ModelHCI.MedicalRecordHCI record = Informations.currentRecord;
            var       recordToUpdate         = record.MedicalRecord;
            Allergens allergyToDelete        = null;

            foreach (Allergens allergens in recordToUpdate.Allergies)
            {
                if (allergens.Allergen.Equals(selectedAllergy.allergens.Allergen))
                {
                    allergyToDelete = allergens;
                }
            }
            if (allergyToDelete != null)
            {
                recordToUpdate.Allergies.Remove(allergyToDelete);
            }

            var recordUpdate = medicalRecordController.GetMedicalRecord(recordToUpdate.IdRecord);

            if (allergyToDelete != null)
            {
                recordUpdate.Allergies.Remove(allergyToDelete);
            }
            medicalRecordController.UpdateRecord(recordToUpdate);
            Informations.currentRecord.MedicalRecord = medicalRecordController.GetMedicalRecord(recordToUpdate.IdRecord);

            setListBoxes();
        }
        private void ButtonList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int index;

            if (demoOn)
            {
                index = 1;
            }
            else
            {
                index = ButtonList.SelectedIndex;
            }

            if (index != -1)
            {
                if (buttoni[index].appointment.patient.record.MedicalRecord.Patient.ProfileImage != null)
                {
                    Profile.Source = new BitmapImage(new Uri(buttoni[0].appointment.patient.record.MedicalRecord.Patient.ProfileImage, UriKind.Relative));
                }
                FullName.Text        = buttoni[index].appointment.FullName;
                DateAppointment.Text = buttoni[index].appointment.Date.ToString("dd.MM.yyyy.");
                StringTime.Text      = buttoni[index].appointment.timeString;
                Record_Number.Text   = buttoni[index].appointment.patient.record.MedicalRecord.IdRecord.ToString();
                Gender.Text          = buttoni[index].appointment.Gender;
                ID_Number.Text       = buttoni[index].appointment.patient.record.MedicalRecord.Patient.IdentificationNumber;
                DateOfBirth.Text     = buttoni[index].appointment.patient.record.MedicalRecord.Patient.DateOfBirth.ToString("dd.MM.yyyy.");
                Curr_Residence.Text  = buttoni[index].appointment.patient.record.MedicalRecord.Patient.CurrResidence.City.Name;
                State.Text           = buttoni[index].appointment.patient.record.MedicalRecord.Patient.CurrResidence.City.State.Name;

                MedicalRecord.Informations.currentRecord = buttoni[index].appointment.patient.record;
                MyEvents.ChangeInformation.RaiseMyCustomEvent(this, new MyEvents.PatientSelectionChanged());
                currentExamination        = buttoni[index];
                currentExamination.record = buttoni[index].appointment.patient.record;
                recordDemo = buttoni[index].appointment.patient.record;
                Frejm.Navigate(new Uri("/Pages/MedicalRecord/Informations.xaml", UriKind.Relative));
            }
        }
Esempio n. 4
0
        private void DeleteTherapy_Click(object sender, RoutedEventArgs e)
        {
            if (selectedTherapy == null)
            {
                ErrorMessage.Visibility = Visibility.Visible;
                Error.Text = ERROR_DELETE;
                return;
            }

            ModelHCI.MedicalRecordHCI record = Informations.currentRecord;
            var     recordToUpdate           = record.MedicalRecord;
            Therapy therapyToDelete          = null;

            foreach (Therapy therapy in recordToUpdate.Therapies)
            {
                Medication med = medicationController.GetMedication(therapy.Medication.MedId);
                if (med.Med.Equals(selectedTherapy.medication.medication.Med))
                {
                    therapyToDelete = therapy;
                }
            }
            if (therapyToDelete != null)
            {
                recordToUpdate.Therapies.Remove(therapyToDelete);
            }

            var recordUpdate = medicalRecordController.GetMedicalRecord(recordToUpdate.IdRecord);

            if (therapyToDelete != null)
            {
                recordUpdate.Therapies.Remove(therapyToDelete);
            }
            Informations.currentRecord.MedicalRecord = medicalRecordController.UpdateRecord(recordToUpdate);

            setListBoxes();
        }
Esempio n. 5
0
        public Informations()
        {
            MyEvents.DemoEvents.ContinueDemoInformations.CustomEvent += continueDemo;
            MyEvents.DemoEvents.PropagateCancellation.CustomEvent    += cancelDemo;
            var app = Application.Current as App;

            medicalRecordController = app.medicalRecordController;
            medicationController    = app.medicationController;
            diagnosisController     = app.diagnosisController;

            if (Patients.SelectedRow != null)
            {
                currentRecord = new ModelHCI.MedicalRecordHCI()
                {
                    MedicalRecord = medicalRecordController.GetMedicalRecord(Patients.SelectedRow.record.MedicalRecord.IdRecord)
                };
            }
            else if (Appointments.currentExamination != null)
            {
                currentRecord = new ModelHCI.MedicalRecordHCI()
                {
                    MedicalRecord = medicalRecordController.GetMedicalRecord(Appointments.currentExamination.record.MedicalRecord.IdRecord)
                };
            }


            InitializeComponent();

            MyEvents.ChangeInformation.CustomEvent += ChangeInfo;
            TherapyList.ItemsSource          = new List <ModelHCI.TherapyHCI>();
            AllergiesList.ItemsSource        = new List <ModelHCI.AllergensHCI>();
            IllnessHistory.ItemsSource       = new List <ModelHCI.DiagnosisHCI>();
            FamilyIllnessHistory.ItemsSource = new List <ModelHCI.DiagnosisHCI>();

            SetValues();
        }