Beispiel #1
0
        public Consulta AcceeConsultationId(int Id)
        {
            List <string> radio      = new List <string>();
            List <Traite> traitement = new List <Traite>();

            Consultation cnslt = (from cns in Globals.DataClass.Consultation
                                  where cns.Id == Id
                                  select cns).First <Consultation>();
            IQueryable <Radio> rdi = (from radi in Globals.DataClass.Radio
                                      where radi.IdConsultation == cnslt.Id
                                      select radi);

            foreach (Radio p in rdi)
            {
                radio.Add(p.chemin);
            }
            IQueryable <Traitement> trait = (from traitemen in Globals.DataClass.Traitement
                                             where traitemen.IdConsultation == cnslt.Id
                                             select traitemen);

            foreach (Traitement p in trait)

            {
                Medicaments Med = (from med in Globals.DataClass.Medicaments
                                   where med.Id == p.IdMedicament
                                   select med).First <Medicaments>();
                Traite q = new Traite(p.Dose, p.Indication, Med.nom);
                traitement.Add(q);
            }

            Consulta consultation = new Consulta((DateTime)cnslt.date, cnslt.diagnostic, cnslt.description, cnslt.cheminCertificat, cnslt.cheminLettreOrientation, cnslt.cheminScanner, cnslt.cheminBilan, cnslt.cheminOrdo, traitement, radio);

            return(consultation);
        }
        public IActionResult Edit(PatientDiseaseMedicaments patientDiseaseMedicaments)
        {
            bool MedicamentExisted = _context.Medicaments.Any(x => x.Name.ToLower().Equals(patientDiseaseMedicaments.MedicamentName.ToLower()));

            if (MedicamentExisted)
            {
                patientDiseaseMedicaments.MedicamentId = _context.Medicaments.Where(x => x.Name.ToLower().Equals(patientDiseaseMedicaments.MedicamentName.ToLower())).FirstOrDefault().MedicamentId;
            }
            else
            {
                Medicaments medicaments = new Medicaments()
                {
                    Name = patientDiseaseMedicaments.MedicamentName
                };
                _context.Medicaments.Add(medicaments);
                _context.SaveChanges();
                patientDiseaseMedicaments.MedicamentId = medicaments.MedicamentId;
            }
            PatientDiseaseMedicaments oldPDM = _context.PatientDiseaseMedicaments.Where(x => x.PatientDiseaseMedicamentId == patientDiseaseMedicaments.PatientDiseaseMedicamentId).FirstOrDefault();

            oldPDM.MedicamentId     = patientDiseaseMedicaments.MedicamentId;
            oldPDM.PatientDiseaseId = patientDiseaseMedicaments.PatientDiseaseId;
            oldPDM.TimesPerDay      = patientDiseaseMedicaments.TimesPerDay;
            oldPDM.Dose             = patientDiseaseMedicaments.Dose;
            oldPDM.DateStart        = patientDiseaseMedicaments.DateStart;
            oldPDM.DateFinish       = patientDiseaseMedicaments.DateFinish;
            _context.SaveChanges();
            return(RedirectToAction("Create", new { id = oldPDM.PatientDiseaseId }));
        }
        public IActionResult Create(PatientDiseaseMedicaments patientDiseaseMedicaments)
        {
            //check if medicament existed
            //if existed get his id
            //if not add it to medicaments and add it to list
            if (patientDiseaseMedicaments.MedicamentName == null)
            {
                return(RedirectToAction("Create"));
            }
            bool MedicamentExisted = _context.Medicaments.Any(x => x.Name.ToLower().Equals(patientDiseaseMedicaments.MedicamentName.ToLower()));

            if (MedicamentExisted)
            {
                patientDiseaseMedicaments.MedicamentId = _context.Medicaments.Where(x => x.Name.ToLower().Equals(patientDiseaseMedicaments.MedicamentName.ToLower())).FirstOrDefault().MedicamentId;
            }
            else
            {
                Medicaments medicaments = new Medicaments()
                {
                    Name = patientDiseaseMedicaments.MedicamentName
                };
                _context.Medicaments.Add(medicaments);
                _context.SaveChanges();
                patientDiseaseMedicaments.MedicamentId = medicaments.MedicamentId;
            }
            _context.PatientDiseaseMedicaments.Add(patientDiseaseMedicaments);
            _context.SaveChanges();
            return(RedirectToAction("Create"));
        }
 private static MedicamentsModel MapToModel(Medicaments medicaments) => new MedicamentsModel
 {
     Id             = medicaments.Id,
     Name           = medicaments.Name,
     Amount         = medicaments.Amount,
     Description    = medicaments.Description,
     ExpirationDate = medicaments.ExpirationDate,
     UserId         = medicaments.UserId
 };
 private async void LvMedicaments_Selected(object sender, SelectedItemChangedEventArgs e)
 {
     if (lvMedicaments.SelectedItem != null)
     {
         Medicaments             leMedicamentSelectionner = (lvMedicaments.SelectedItem as Medicaments);
         Pages.PageModifierMedoc page = new Pages.PageModifierMedoc(leMedicamentSelectionner);
         await Navigation.PushModalAsync(page);
     }
 }
Beispiel #6
0
 public void AfficherInfoMedoc(Medicaments unMedicament)
 {
     txtDepotLegal.Text    = unMedicament.Depot;
     txtNomCommercial.Text = unMedicament.NomCom;
     txtComposition.Text   = unMedicament.Compo;
     txtEffets.Text        = unMedicament.Effets;
     txtContreIndic.Text   = unMedicament.ContreIndic;
     txtPrix.Text          = unMedicament.Prix.ToString();
     txtCodeFamille.Text   = unMedicament.CodeFam.ToString();
 }
Beispiel #7
0
        public async Task <bool> Update(Medicaments medicaments)
        {
            var updateResult =
                await _context
                .Medicaments
                .ReplaceOneAsync(
                    filter : g => g.Id == medicaments.Id,
                    replacement : medicaments);

            return(updateResult.IsAcknowledged &&
                   updateResult.ModifiedCount > 0);
        }
Beispiel #8
0
        public void Validation_Test()
        {
            //Arrange
            bool        expected = false;
            Medicaments med      = new Medicaments();

            //Act

            bool actual = med.Validation();

            //Assert

            Assert.AreEqual(expected, actual, "Zwraca Prawdę");
        }
        public async Task <ActionResult <MedicamentsModel> > Create(MedicamentsModel foodModel)
        {
            var food = new Medicaments
            {
                Name           = foodModel.Name,
                Amount         = foodModel.Amount,
                Description    = foodModel.Description,
                ExpirationDate = foodModel.ExpirationDate,
                UserId         = User.GetLoggedInUserId()
            };

            await medicamentsRepository.Create(food);

            return(new ObjectResult(MapToModel(food)));
        }
Beispiel #10
0
        public void If_Med_Ex_2()
        {
            //Arrange
            bool expected = true;
            // ShareSqlCom sqlCo = new ShareSqlCom();
            SqlConnection con2 = new SqlConnection("Data Source=DESKTOP-BQITBQR\\SQLEXPRESS;Initial Catalog=MedkitDB;Integrated Security=True");
            Medicaments   med2 = new Medicaments();


            //Act


            bool actual = med2.IfMedExists(con2, "1");

            //Assert

            Assert.AreEqual(expected, actual, "Zwraca false");
        }
Beispiel #11
0
        private void AddMedicamentsEntities2(Prescription prescription)
        {
            var medicament = new Medicament()
            {
                //IdMedicament = 2,
                Name        = "Eurespal",
                Type        = "Liquid",
                Description = "Throat treatment"
            };
            var mediacamentPrescription = new MedicamentPrescription()
            {
                Medicament   = medicament,
                Prescription = prescription,
                Dose         = 10,
                Details      = "Not necessary"
            };

            Medicaments.Add(medicament);
            MedicamentPrescriptions.Add(mediacamentPrescription);
        }
Beispiel #12
0
        private void AddMedicamentsEntities1(Prescription prescription)
        {
            var medicament = new Medicament()
            {
                //IdMedicament = 1,
                Name        = "Paracetamol",
                Type        = "Pill",
                Description = "Headache"
            };
            var mediacamentPrescription = new MedicamentPrescription()
            {
                Medicament   = medicament,
                Prescription = prescription,
                Dose         = 20,
                Details      = "Obligatory"
            };

            Medicaments.Add(medicament);
            MedicamentPrescriptions.Add(mediacamentPrescription);
        }
Beispiel #13
0
 public MedicamentsController(Medicaments view)
 {
     this.view            = view;
     this.medicamentModel = new Models.Medicament();
 }
Beispiel #14
0
        public void AddConsult(string nomPatient, string prenomPatient, string nomMedecin, string prenomMedecin, string diagnostic, string description, string cheminCertificat, string cheminLettreOrientation, string cheminScanner, string cheminBilan, string cheminOrdo, List <string> cheminRadio, List <Traite> traitement, string label, int age)
        {
            nomPatient    = nomPatient.ToUpper();
            prenomMedecin = prenomMedecin.ToUpper();
            Consultation table = new Consultation
            {
                date                    = DateTime.Today,
                diagnostic              = diagnostic,
                description             = description,
                cheminCertificat        = cheminCertificat,
                cheminLettreOrientation = cheminLettreOrientation,
                cheminScanner           = cheminScanner,
                cheminBilan             = cheminBilan,
                cheminOrdo              = cheminOrdo,
                age   = age,
                label = label
            };

            Globals.DataClass.Consultation.InsertOnSubmit(table);
            Globals.DataClass.SubmitChanges();

            foreach (var chemin in cheminRadio)
            {
                Radio tableRadio = new Radio();
                tableRadio.chemin         = chemin;
                tableRadio.IdConsultation = table.Id;
                Globals.DataClass.Radio.InsertOnSubmit(tableRadio);
                Globals.DataClass.SubmitChanges();
            }

            foreach (var trait in traitement)
            {
                Traitement tableTraitement = new Traitement();
                tableTraitement.Dose           = trait.Dose;
                tableTraitement.Indication     = trait.Indication;
                tableTraitement.IdConsultation = table.Id;


                Medicaments medTraitement = (from medicament in Globals.DataClass.Medicaments
                                             where trait.NomMed == medicament.nom
                                             select medicament).First <Medicaments>();

                tableTraitement.IdMedicament = medTraitement.Id;

                Globals.DataClass.Traitement.InsertOnSubmit(tableTraitement);
                Globals.DataClass.SubmitChanges();
            }

            Patient patientConsultation = (from personne in Globals.DataClass.Personne
                                           where nomPatient == personne.nom && prenomPatient == personne.prenom
                                           join patient in Globals.DataClass.Patient on personne.Id equals patient.IdPersonne
                                           select patient).First <Patient>();
            Medecin medecinConsultation = (from personne in Globals.DataClass.Personne
                                           where nomMedecin == personne.nom && prenomMedecin == personne.prenom
                                           join medecin in Globals.DataClass.Medecin on personne.Id equals medecin.IdPersonne
                                           select medecin).First <Medecin>();

            MPConsultation tableMPC = new MPConsultation
            {
                IdConsultation = table.Id,
                IdPatient      = patientConsultation.Id,
                IdMedecin      = medecinConsultation.Id
            };

            Globals.DataClass.MPConsultation.InsertOnSubmit(tableMPC);
            Globals.DataClass.SubmitChanges();
        }
Beispiel #15
0
 public PageModifierMedoc(Medicaments unMedicament)
 {
     InitializeComponent();
     AfficherInfoMedoc(unMedicament);
 }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
            this.SuspendLayout();
            //
            // Panels
            //
            LogInPanel logInPanel = new LogInPanel();

            ManagerMainPanel managerMainPanel        = new ManagerMainPanel();
            ManagerAnalytics managerAnalyticsPanel   = new ManagerAnalytics(managerMainPanel.Panel);
            DoctorInCharge   managerDICPanel         = new DoctorInCharge(managerMainPanel.Panel);
            Medicaments      managerMedicamentsPanel = new Medicaments(managerMainPanel.Panel);
            Services         managerServicesPanel    = new Services(managerMainPanel.Panel);
            Timetables       managerTimetablesPanel  = new Timetables(managerMainPanel.Panel);
            Users            managerUsersPanel       = new Users(managerMainPanel.Panel);

            OperatorMainPanel     operatorMainPanel          = new OperatorMainPanel();
            OperatorPatientCharts operatorPatientChartsPanel = new OperatorPatientCharts(operatorMainPanel.Panel);
            Patients           operatorPatientsPanel         = new Patients(operatorMainPanel.Panel);
            Reservations       operatorReservationsPanel     = new Reservations(operatorMainPanel.Panel);
            OperatorTimetables operatorTimeTablesPanel       = new OperatorTimetables(operatorMainPanel.Panel);

            DoctorMainPanel doctorMainPanel            = new DoctorMainPanel();
            TimeTablesDoc   doctorTimeTablesDocPanel   = new TimeTablesDoc(doctorMainPanel.Panel);
            ReservationsDoc doctorReservationsDocPanel = new ReservationsDoc(doctorMainPanel.Panel);
            Prescription    doctorPrescriptionPanel    = new Prescription(doctorMainPanel.Panel);

            NurseMainPanel    nurseMainPanel              = new NurseMainPanel();
            Schedule          nurseSchedulePanel          = new Schedule(nurseMainPanel.Panel);
            ReservationsNurse nurseReservationsNursePanel = new ReservationsNurse(nurseMainPanel.Panel);
            AnalysisNurse     nurseAnalysisPanel          = new AnalysisNurse(nurseMainPanel.Panel);

            logInPanel.initNextPanels(
                managerMainPanel,
                operatorMainPanel,
                doctorMainPanel,
                nurseMainPanel
                );

            managerMainPanel.initNextPanels(
                managerUsersPanel,
                managerTimetablesPanel,
                managerServicesPanel,
                managerMedicamentsPanel,
                managerDICPanel,
                managerAnalyticsPanel,
                logInPanel
                );

            operatorMainPanel.initNextPanels(
                operatorPatientsPanel,
                operatorPatientChartsPanel,
                operatorReservationsPanel,
                operatorTimeTablesPanel,
                logInPanel
                );

            doctorMainPanel.initNextPanels(
                doctorTimeTablesDocPanel,
                doctorReservationsDocPanel,
                doctorPrescriptionPanel,
                logInPanel
                );

            nurseMainPanel.initNextPanels(
                nurseSchedulePanel,
                logInPanel,
                nurseReservationsNursePanel,
                nurseAnalysisPanel
                );

            //
            // MainForm
            //
            this.AutoScaleMode = AutoScaleMode.Font;
            this.Icon          = ((Icon)(resources.GetObject("$this.Icon")));
            this.Left          = this.Top = 0;
            this.MaximumSize   = new Size(Dimensions.VIEW_WIDTH, Dimensions.VIEW_HEIGHT);
            this.MinimumSize   = this.MaximumSize;
            this.Name          = "MainForm";
            this.MaximizeBox   = false;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text          = "E-Pacient GG";
            this.ResumeLayout(false);
            this.PerformLayout();

            this.Controls.Add(logInPanel.Panel);

            this.Controls.Add(managerMainPanel.Panel);
            this.Controls.Add(managerAnalyticsPanel.Panel);
            this.Controls.Add(managerDICPanel.Panel);
            this.Controls.Add(managerMedicamentsPanel.Panel);
            this.Controls.Add(managerTimetablesPanel.Panel);
            this.Controls.Add(managerUsersPanel.Panel);
            this.Controls.Add(managerServicesPanel.Panel);

            this.Controls.Add(operatorMainPanel.Panel);
            this.Controls.Add(operatorPatientsPanel.Panel);
            this.Controls.Add(operatorPatientChartsPanel.Panel);
            this.Controls.Add(operatorReservationsPanel.Panel);
            this.Controls.Add(operatorTimeTablesPanel.Panel);

            this.Controls.Add(doctorMainPanel.Panel);
            this.Controls.Add(doctorTimeTablesDocPanel.Panel);
            this.Controls.Add(doctorReservationsDocPanel.Panel);
            this.Controls.Add(doctorPrescriptionPanel.Panel);

            this.Controls.Add(nurseMainPanel.Panel);
            this.Controls.Add(nurseSchedulePanel.Panel);
            this.Controls.Add(nurseAnalysisPanel.Panel);
            this.Controls.Add(nurseReservationsNursePanel.Panel);
        }
Beispiel #17
0
        public MedicamentViewModel()
        {
            DownloadMedicaments();

            EditMedicament = new DelegateCommand(() =>
            {
                editoradd = false;
                selectedMedicament?.BeginEdit();

                var w         = new MedicamentEdit();
                w.DataContext = this;
                w.ShowDialog();
            }, () => selectedMedicament != null);


            AddMedicament = new DelegateCommand(() =>
            {
                editoradd = true;

                Medicament medicament = new Medicament();
                SelectedMedicament    = medicament;

                var w         = new MedicamentEdit();
                w.DataContext = this;
                w.ShowDialog();
            });

            SaveMedicament = new DelegateCommand(() =>
            {
                if (editoradd == true)
                {
                    context.Medicament.Add(selectedMedicament);

                    context.SaveChanges();

                    Medicaments.Add(SelectedMedicament);
                }
                else
                {
                    context.Entry(SelectedMedicament).State = EntityState.Modified;
                    context.SaveChanges();
                }
            });

            RemoveMedicament = new DelegateCommand(() =>
            {
                if (MessageBox.Show("Удалить?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                {
                    context.Entry(selectedMedicament).State = EntityState.Deleted;
                    context.SaveChanges();
                    Medicaments.Remove(selectedMedicament);
                }
                else
                {
                    return;
                }
            }, () => selectedMedicament != null);

            CanselEdit = new DelegateCommand(() =>
            {
                if (editoradd == false)
                {
                    if (selectedMedicament == null)
                    {
                        return;
                    }
                    SelectedMedicament.CancelEdit();
                }
                else
                {
                    return;
                }
            });
        }
Beispiel #18
0
        public async Task <Medicaments> Create(Medicaments medicaments)
        {
            await _context.Medicaments.InsertOneAsync(medicaments);

            return(medicaments);
        }