Ejemplo n.º 1
0
        /// <summary>
        /// Metoden bliver benyttet til at hente en patient fra DB der passer til det pågældende PCPR
        /// og det nyeste technical- og generalspec for hvert øre fra databasen tilhørende patienten
        /// og returnere et patient objekt.
        /// </summary>
        /// <param name="CPR"></param>
        /// <returns></returns>
        public Patient GetPatientWithGeneralSpecAndTechnicalSpec(int PatientId)
        {
            Patient patient = _dbContext.Patient.Single(x => x.PatientId == PatientId);

            TecnicalSpec TechspecL = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate)
                                     .Last(x => x.PatientFK == PatientId && x.EarSide == Ear.Left);
            TecnicalSpec TechspecR = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate)
                                     .Last(x => x.PatientFK == PatientId && x.EarSide == Ear.Right);

            patient.TecnicalSpecs = new List <TecnicalSpec>()
            {
                TechspecR, TechspecL
            };

            GeneralSpec GenSpecL = _dbContext.GeneralSpecs.OrderBy(x => x.CreateDate).Last(x =>
                                                                                           x.PatientFK == PatientId && x.EarSide == Ear.Left && x.HAGeneralSpecID == TechspecL.GeneralSpecFK);
            GeneralSpec GenSpecR = _dbContext.GeneralSpecs.OrderBy(x => x.CreateDate).Last(x =>
                                                                                           x.PatientFK == PatientId && x.EarSide == Ear.Right && x.HAGeneralSpecID == TechspecR.GeneralSpecFK);

            patient.GeneralSpecs = new List <GeneralSpec>()
            {
                GenSpecR, GenSpecL
            };

            return(patient);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Der gemmes et specifikt rawEarScan i DB og efterfølgende returneres en bool som fortæller om det er gjort.
        /// </summary>
        /// <param name="rawEarPrint"></param>
        /// <param name="CPR"></param>
        /// <returns></returns>
        public bool SavePrint(RawEarPrint rawEarPrint, string CPR)
        {
            try
            {
                //Henter specifik techspec tilhørende det givne RawEarPrint og CPR.
                TecnicalSpec Techspec = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate).Last(x => x.CPR == CPR && x.EarSide == rawEarPrint.EarSide);

                //Sætter id i RawEarPrint
                rawEarPrint.HATechnicalSpecID = Techspec.HATechinalSpecID;

                //Gemmer RawEarPrint
                _dbContext.RawEarPrints.Add(rawEarPrint);
                _dbContext.SaveChanges();

                // Sætter printed parameteren til true
                Techspec.Printed = true;

                _dbContext.TecnicalSpecs.Update(Techspec);
                _dbContext.SaveChanges();

                return(_dbContext.RawEarPrints.Contains(rawEarPrint));
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Metoden bliver benyttet til at hente en patient fra DB der passer til det pågældende PCPR
        /// og det nyeste technical- og generalspec for hvert øre fra databasen tilhørende patienten
        /// og returnere et patient objekt.
        /// </summary>
        /// <param name="Patientid"></param>
        /// <returns></returns>
        public Patient GetPatientWithGeneralSpecAndTechnicalSpec(string CPR)
        {
            Patient patient = new Patient();

            try
            {
                patient = _dbContext.Patient.Single(x => x.CPR == CPR);

                TecnicalSpec TechspecL = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate).LastOrDefault(x => x.PatientFK == patient.PatientId && x.EarSide == Ear.Left);
                TecnicalSpec TechspecR = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate).LastOrDefault(x => x.PatientFK == patient.PatientId && x.EarSide == Ear.Right);

                patient.TecnicalSpecs = new List <TecnicalSpec>()
                {
                    TechspecL, TechspecR
                };

                GeneralSpec GenSpecL = _dbContext.GeneralSpecs.OrderBy(x => x.CreateDate).LastOrDefault(x => x.PatientFK == patient.PatientId && x.EarSide == Ear.Left /* && x.HAGeneralSpecID == TechspecL.GeneralSpecFK*/);
                GeneralSpec GenSpecR = _dbContext.GeneralSpecs.OrderBy(x => x.CreateDate).LastOrDefault(x => x.PatientFK == patient.PatientId && x.EarSide == Ear.Right /*&& x.HAGeneralSpecID == TechspecR.GeneralSpecFK*/);

                patient.GeneralSpecs = new List <GeneralSpec>()
                {
                    GenSpecL, GenSpecR
                };
                return(patient);
            }
            catch
            {
                return(patient);
            }
        }
Ejemplo n.º 4
0
        public bool SavePrint(RawEarPrint rawEarPrint, int PatientId)
        {
            try
            {
                //Henter specifik techspec tilhørende det givne RawEarPrint og PCPR.
                TecnicalSpec Techspec =
                    _dbContext.TecnicalSpecs.Single((x => x.PatientFK == PatientId && x.EarSide == rawEarPrint.EarSide));

                //Sætter id i RawEarPrint
                rawEarPrint.TecnicalSpecFK = Techspec.HATechinalSpecID;

                //Gemmer RawEarPrint
                _dbContext.RawEarPrints.Add(rawEarPrint);
                _dbContext.SaveChanges();

                // Sætter printed parameteren til true
                Techspec.Printed = true;

                _dbContext.TecnicalSpecs.Update(Techspec);
                _dbContext.SaveChanges();

                return(true);
            }
            catch
            {
                return(false);
            }

            #endregion
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Der gemmes et specikt earscan i DB og efterfølgende returneres en bool som fortæller om det er gjort.
        /// </summary>
        /// <param name="scan"></param>
        /// <param name="CPR"></param>
        /// <returns></returns>
        public bool SaveScan(RawEarScan scan, int PatientId)
        {
            try
            {
                //Find det specifikke scans techspec
                TecnicalSpec Techspec = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate).Last((x => x.PatientFK == PatientId && x.EarSide == scan.EarSide));

                scan.TecnicalSpecFK = Techspec.HATechinalSpecID;

                _dbContext.RawEarScans.Add(scan);
                _dbContext.SaveChanges();

                //RawEarScan rawEarScan = _dbContext.RawEarScans.OrderBy(x => x.ScanDate).Last(x => x.TecnicalSpecFK == Techspec.HATechinalSpecID && x.EarSide == Techspec.EarSide);

                //Techspec.ScanID = rawEarScan.ScanID;

                //_dbContext.TecnicalSpecs.Add(Techspec);
                //_dbContext.SaveChanges();

                return(_dbContext.RawEarScans.Contains(scan));
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 6
0
        public List <TecnicalSpec> GetEarScans()
        {
            List <TecnicalSpec> tecnicalSpecs = new List <TecnicalSpec>();

            Thread.Sleep(3000);

            TecnicalSpec testTecnicalSpec1 = new TecnicalSpec();

            testTecnicalSpec1.CPR = "123456-7891";
            //testTecnicalSpec1.Patient.Name = "Børge";
            //testTecnicalSpec1.Patient.Lastname = "Andersen";
            testTecnicalSpec1.EarSide = Ear.Right;
            //testTecnicalSpec1.Patient.Age = 69;
            testTecnicalSpec1.RawEarScan = new RawEarScan();
            tecnicalSpecs.Add(testTecnicalSpec1);

            TecnicalSpec testTecnicalSpec2 = new TecnicalSpec();

            testTecnicalSpec2.CPR = "123456-7891";
            //testTecnicalSpec2.Patient.Name = "Børge";
            //testTecnicalSpec2.Patient.Lastname = "Andersen";
            testTecnicalSpec2.EarSide = Ear.Left;
            //testTecnicalSpec2.Patient.Age = 69;
            testTecnicalSpec2.RawEarScan = new RawEarScan();
            tecnicalSpecs.Add(testTecnicalSpec2);

            return(tecnicalSpecs);
        }
Ejemplo n.º 7
0
        private void HAList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!rediger)
            {
                GeneralSpec  selectedGeneralSpec  = (GeneralSpec)patientAndHA.GeneralSpecs[HAList.SelectedIndex];
                TecnicalSpec selectedTecnicalSpec = (TecnicalSpec)patientAndHA.TecnicalSpecs[HAList.SelectedIndex];

                TypeTB.Text    = selectedGeneralSpec.Type.ToString();
                ColorTB.Text   = selectedGeneralSpec.Color.ToString();
                GenDateTB.Text = selectedGeneralSpec.CreateDate.ToShortDateString();

                TechDateTB.Text = selectedTecnicalSpec.CreateDate.ToShortDateString();


                if (selectedTecnicalSpec.Printed == false)
                {
                    PrintStatusTB.Text = "Ikke printet endnu";
                }

                if (selectedTecnicalSpec.Printed == true)
                {
                    PrintStatusTB.Text = "Printet";
                }

                RedigerB.IsEnabled = true;
            }
            else
            {
                MessageBox.Show("Afslut redigering inden du vælger nyt høreapparat");
            }
        }
Ejemplo n.º 8
0
        public void CreateTechnicalSpec(TecnicalSpec techSpec)
        {
            GeneralSpec generalSpec = _dbContext.GeneralSpecs.OrderBy(x => x.CreateDate)
                                      .Last(x => x.PatientFK == techSpec.PatientFK && x.EarSide == techSpec.EarSide);

            techSpec.GeneralSpecFK = generalSpec.HAGeneralSpecID;

            _dbContext.TecnicalSpecs.Add(techSpec);
            _dbContext.SaveChanges();
        }
Ejemplo n.º 9
0
        public bool SaveTechnicalSpec(TecnicalSpec techSpec)
        {
            Thread.Sleep(1000);
            int trigger = random.Next(1, 10);

            if (trigger > 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 10
0
        public bool CreateTechnicalSpec(Patient patient, StaffLogin ScanTechID, Ear earSide)
        {
            TecnicalSpec techSpec = new TecnicalSpec();

            techSpec.PatientFK = patient.PatientId;
            //techSpec.Patient = patient;
            techSpec.StaffLoginFK = ScanTechID.StaffID;
            //techSpec.StaffLogin = ScanTechID;
            techSpec.Printed    = false;
            techSpec.EarSide    = earSide;
            techSpec.CreateDate = DateTime.Now;

            return(clinicDB.SaveTechnicalSpec(techSpec));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Der hentes et earscan fra DB ud fra et specifikt PCPR.
        /// Metoden returnerer en liste der indeholder scanning for både venstre og højre øre.
        /// </summary>
        /// <param name="CPR"></param>
        /// <returns></returns>
        public List <TecnicalSpec> GetTechnicalSpecs(string CPR)
        {
            try
            {
                Patient      patient   = GetPatient(CPR);
                TecnicalSpec TechspecL = new TecnicalSpec();
                try
                {
                    //Henter TechSpec for V og H øre
                    TechspecL = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate).Last(x => x.PatientFK == patient.PatientId && x.EarSide == Ear.Left);
                    //Henter Earscan for V og H øre
                    TechspecL.RawEarScan = _dbContext.RawEarScans.Single(x => x.TecnicalSpecFK == TechspecL.HATechinalSpecID);
                    //Henter generelsepc for Techspec
                    TechspecL.GeneralSpec = _dbContext.GeneralSpecs.Single(x => x.HAGeneralSpecID == TechspecL.GeneralSpecFK);
                }
                catch
                {
                }

                TecnicalSpec TechspecR = new TecnicalSpec();
                try
                {
                    TechspecR = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate).Last(x => x.PatientFK == patient.PatientId && x.EarSide == Ear.Right);

                    TechspecR.RawEarScan = _dbContext.RawEarScans.Single(x => x.TecnicalSpecFK == TechspecR.HATechinalSpecID);

                    TechspecR.GeneralSpec = _dbContext.GeneralSpecs.Single(x => x.HAGeneralSpecID == TechspecR.GeneralSpecFK);
                }
                catch
                {
                }

                //Oprettelse af listen
                List <TecnicalSpec> Techspec = new List <TecnicalSpec>(2);

                //Tilføjelse af techspec objekterne til listen
                Techspec.Add(TechspecL); Techspec.Add(TechspecR);

                //Return the list;
                return(Techspec);
            }
            catch
            {
                return(null);
            }
        }
Ejemplo n.º 12
0
        public Patient GetPatientWithGeneralSpecAndTechnicalSpec(string CPR)
        {
            Thread.Sleep(3000);

            if (CPR == "123456-7891")
            {
                Patient testPatient = new Patient();
                testPatient.CPR      = "123456-7891";
                testPatient.Name     = "Børge";
                testPatient.Lastname = "Andersen";
                testPatient.Age      = 69;

                testPatient.TecnicalSpecs = new List <TecnicalSpec>();

                TecnicalSpec testTecnicalSpecLeft = new TecnicalSpec();
                testTecnicalSpecLeft.EarSide = Ear.Left;

                TecnicalSpec testTecnicalSpecRight = new TecnicalSpec();
                testTecnicalSpecRight.EarSide = Ear.Right;
                testTecnicalSpecRight.Printed = true;

                testPatient.TecnicalSpecs.Add(testTecnicalSpecLeft);
                testPatient.TecnicalSpecs.Add(testTecnicalSpecRight);

                testPatient.GeneralSpecs = new List <GeneralSpec>();

                GeneralSpec testGeneralSpecLeft = new GeneralSpec();
                testGeneralSpecLeft.Color = PlugColor.Almond;
                testGeneralSpecLeft.Type  = Material.Silhuet;

                GeneralSpec testGeneralSpecRight = new GeneralSpec();
                testGeneralSpecRight.Color = PlugColor.Honey;
                testGeneralSpecRight.Type  = Material.Blød;

                testPatient.GeneralSpecs.Add(testGeneralSpecLeft);
                testPatient.GeneralSpecs.Add(testGeneralSpecRight);

                return(testPatient);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 13
0
        public bool CreateTechnicalSpec(Patient patient, StaffLogin ScanTechID, Ear earSide)
        {
            TecnicalSpec techSpec = new TecnicalSpec();

            techSpec.CPR        = patient.CPR;
            techSpec.Patient    = patient;
            techSpec.StaffID    = ScanTechID.StaffID;
            techSpec.StaffLogin = ScanTechID;
            techSpec.Printed    = false;
            techSpec.EarSide    = earSide;
            techSpec.CreateDate = DateTime.Now;

            //null values
            techSpec.EarPrints  = new List <RawEarPrint>();
            techSpec.RawEarScan = new RawEarScan();
            techSpec.ScanID     = 0;

            return(clinicDB.SaveTechnicalSpec(techSpec));
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Metoden benyttes til at gemme en TechinalSpec, og returnere efterfølgende en bool
        /// hvorvidt den er gemt i DB eller ej
        /// </summary>
        /// <param name="techSpec"></param>
        /// <returns></returns>
        public bool SaveTechnicalSpec(TecnicalSpec techSpec)
        {
            //try
            //{
            TecnicalSpec tecnicalSpec = techSpec;
            GeneralSpec  generalSpec  = _dbContext.GeneralSpecs.OrderBy(x => x.CreateDate).Last(x => x.PatientFK == techSpec.PatientFK && x.EarSide == techSpec.EarSide);

            tecnicalSpec.GeneralSpecFK = generalSpec.HAGeneralSpecID;
            //tecnicalSpec.GeneralSpec = generalSpec;

            _dbContext.TecnicalSpecs.Add(tecnicalSpec);
            _dbContext.SaveChanges();

            return(_dbContext.TecnicalSpecs.Contains(techSpec));
            //}
            //   catch
            //   {
            //      return false;
            //   }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Der gemmes et specifikt rawEarScan i DB og efterfølgende returneres en bool som fortæller om det er gjort.
        /// </summary>
        /// <param name="rawEarPrint"></param>
        /// <returns></returns>
        public bool SavePrint(RawEarPrint rawEarPrint)
        {
            try
            {
                _dbContext.RawEarPrints.Add(rawEarPrint);
                _dbContext.SaveChanges();

                TecnicalSpec tecnical = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate).Last(x => x.HATechinalSpecID == rawEarPrint.TecnicalSpecFK && x.EarSide == rawEarPrint.EarSide);

                tecnical.Printed = true;

                _dbContext.TecnicalSpecs.Update(tecnical);
                _dbContext.SaveChanges();


                return(_dbContext.RawEarPrints.Contains(rawEarPrint));
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 16
0
        public Patient GetPatientInformations(string EarCastID)
        {
            Thread.Sleep(1000);

            if (EarCastID == "1")
            {
                Patient testPatient = new Patient();
                testPatient.CPR      = "123456-7891";
                testPatient.Name     = "Børge";
                testPatient.Lastname = "Andersen";
                testPatient.Age      = 69;

                testPatient.TecnicalSpecs = new List <TecnicalSpec>();

                TecnicalSpec testTecnicalSpecLeft = new TecnicalSpec();
                testTecnicalSpecLeft.EarSide    = Ear.Left;
                testTecnicalSpecLeft.RawEarScan = new RawEarScan();

                TecnicalSpec testTecnicalSpecRight = new TecnicalSpec();
                testTecnicalSpecRight.EarSide = Ear.Right;
                testTecnicalSpecRight.Printed = true;

                testTecnicalSpecRight.RawEarScan = new RawEarScan();

                testPatient.TecnicalSpecs.Add(testTecnicalSpecLeft);
                testPatient.TecnicalSpecs.Add(testTecnicalSpecRight);


                testPatient.GeneralSpecs = new List <GeneralSpec>();

                GeneralSpec testGeneralSpecLeft = new GeneralSpec();
                testGeneralSpecLeft.Color = PlugColor.Almond;
                testGeneralSpecLeft.Type  = Material.Silhuet;

                GeneralSpec testGeneralSpecRight = new GeneralSpec();
                testGeneralSpecRight.Color = PlugColor.Honey;
                testGeneralSpecRight.Type  = Material.Blød;

                EarCast earCastRight = new EarCast();
                EarCast earCastLeft  = new EarCast();

                earCastRight.EarCastID = 1;
                earCastRight.EarSide   = Ear.Right;


                earCastLeft.EarCastID = 2;
                earCastLeft.EarSide   = Ear.Left;

                testPatient.EarCasts = new List <EarCast>();
                testPatient.EarCasts.Add(earCastRight);

                testPatient.EarCasts.Add(earCastLeft);

                testPatient.GeneralSpecs.Add(testGeneralSpecLeft);
                testPatient.GeneralSpecs.Add(testGeneralSpecRight);

                return(testPatient);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Henter Process informationerne til det give PCPR. Metoden vil altid hente de nyeste informationer.
        /// </summary>
        /// <param name="CPR"></param>
        /// <returns></returns>
        public List <ProcesSpec> GetProcesInfo(string CPR)
        {
            Patient           patient     = GetPatient(CPR);
            List <ProcesSpec> procesSpecs = new List <ProcesSpec>();
            ProcesSpec        procesSpecL = new ProcesSpec();
            ProcesSpec        procesSpecR = new ProcesSpec();

            try
            {
                try
                {
                    //Venstre
                    //Henter generalspec
                    GeneralSpec generalSpecL = _dbContext.GeneralSpecs.OrderBy(x => x.CreateDate).LastOrDefault(x => x.PatientFK == patient.PatientId && x.EarSide == Ear.Left);
                    if (generalSpecL.CreateDate != null)
                    {
                        procesSpecL.GeneralSpecCreateDateTime = generalSpecL.CreateDate;
                        procesSpecL.ClinicianId = generalSpecL.StaffLoginFK;
                        TecnicalSpec TechspecL = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate).LastOrDefault(x => x.GeneralSpecFK == generalSpecL.HAGeneralSpecID);

                        //Henter techspec
                        if (TechspecL.CreateDate != null)
                        {
                            procesSpecL.TechSpecCreateDateTime = TechspecL.CreateDate;
                            procesSpecL.TechnicalId            = TechspecL.StaffLoginFK;
                            procesSpecL.Printed = TechspecL.Printed;

                            //Henter EarScan
                            TechspecL.RawEarScan = _dbContext.RawEarScans.OrderBy(x => x.ScanDate).LastOrDefault(x => x.TecnicalSpecFK == TechspecL.HATechinalSpecID);
                            if (TechspecL.RawEarScan != null)
                            {
                                procesSpecL.scanTechId   = TechspecL.StaffLoginFK;
                                procesSpecL.scanDateTime = TechspecL.CreateDate;
                            }

                            //Henter Earprint
                            if (procesSpecL.Printed)
                            {
                                RawEarPrint rawEarPrint = _dbContext.RawEarPrints.OrderBy(x => x.PrintDate).LastOrDefault(x => x.TecnicalSpecFK == TechspecL.HATechinalSpecID && x.EarSide == Ear.Left);
                                ;
                                procesSpecL.PrintDateTime = rawEarPrint.PrintDate;
                                procesSpecL.PrintTechId   = rawEarPrint.StaffLoginFK;
                            }
                        }
                    }

                    procesSpecs.Add(procesSpecL);
                }
                catch
                {
                    procesSpecs.Add(procesSpecL);
                }

                try
                {
                    //Højre
                    //Henter GeneralSpec
                    GeneralSpec generalSpecR = _dbContext.GeneralSpecs.OrderBy(x => x.CreateDate).LastOrDefault(x => x.PatientFK == patient.PatientId && x.EarSide == Ear.Right);
                    if (generalSpecR.CreateDate != null)
                    {
                        procesSpecR.GeneralSpecCreateDateTime = generalSpecR.CreateDate;
                        procesSpecR.ClinicianId = generalSpecR.StaffLoginFK;
                        TecnicalSpec TechspecR = _dbContext.TecnicalSpecs.OrderBy(x => x.CreateDate).LastOrDefault(x => x.GeneralSpecFK == generalSpecR.HAGeneralSpecID);

                        //Henter techspec
                        if (TechspecR.CreateDate != null)
                        {
                            procesSpecR.TechSpecCreateDateTime = TechspecR.CreateDate;
                            procesSpecR.TechnicalId            = TechspecR.StaffLoginFK;
                            procesSpecR.Printed = TechspecR.Printed;

                            //Henter EarScan
                            TechspecR.RawEarScan = _dbContext.RawEarScans.OrderBy(x => x.ScanDate).LastOrDefault(x => x.TecnicalSpecFK == TechspecR.HATechinalSpecID);
                            if (TechspecR.RawEarScan != null)
                            {
                                procesSpecR.scanTechId   = TechspecR.StaffLoginFK;
                                procesSpecR.scanDateTime = TechspecR.CreateDate;
                            }

                            //Henter Earprint
                            if (procesSpecR.Printed)
                            {
                                RawEarPrint rawEarPrint = _dbContext.RawEarPrints.OrderBy(x => x.PrintDate).LastOrDefault(x => x.TecnicalSpecFK == TechspecR.HATechinalSpecID && x.EarSide == Ear.Right);
                                procesSpecR.PrintDateTime = rawEarPrint.PrintDate;
                                procesSpecR.PrintTechId   = rawEarPrint.StaffLoginFK;
                            }
                        }
                    }

                    procesSpecs.Add(procesSpecR);
                }
                catch
                {
                    procesSpecs.Add(procesSpecR);
                }

                return(procesSpecs);
            }
            catch
            {
                return(null);
            }
        }
Ejemplo n.º 18
0
        static void Main(string[] args)
        {
            ClinicDBContext  dbContext        = new ClinicDBContext();
            ClinicianDBLogic clinicianDbLogic = new ClinicianDBLogic(dbContext);

            ProgramHL7 program = new ProgramHL7();

            program.metode();


            #region Create (CRUD)

            #region Create patient
            Patient newPatient = new Patient()
            {
                CPR         = "123456-2332",
                Name        = "Accepttest",
                Lastname    = "Patient",
                Adress      = "Testvej 1",
                zipcode     = 4321,
                Age         = 20,
                City        = "TestBy",
                Email       = "*****@*****.**",
                MobilNummer = "30405060"
            };

            clinicianDbLogic.CreatePatient(newPatient);


            #endregion

            #region Create Staff

            StaffLogin newStaffLogin = new StaffLogin()
            {
                Name        = "Kliniker",
                Password    = "******",
                StaffStatus = Status.Clinician,
            };

            //clinicianDbLogic.CreateStaffLogin(newStaffLogin);

            StaffLogin nStaffLogin = new StaffLogin()
            {
                Name        = "Tekniker",
                Password    = "******",
                StaffStatus = Status.Technician
            };

            //clinicianDbLogic.CreateStaffLogin(nStaffLogin);

            #region Create EarCast 2

            EarCast newCast = new EarCast()
            {
                EarSide = Ear.Right,
            };

            //clinicianDbLogic.CreateEarCast(newCast);

            #endregion

            #endregion

            #region Create GeneralSpec

            GeneralSpec newGeneralSpecL = new GeneralSpec()
            {
                //CPR = "111111-1111",
                Type         = Material.AntiAllergi,
                Color        = PlugColor.Honey,
                EarSide      = Ear.Left,
                CreateDate   = DateTime.Now,
                StaffLoginFK = 1,
            };

            //clinicianDbLogic.CreateNewGeneralSpec(newGeneralSpecL);

            GeneralSpec newGeneralSpecR = new GeneralSpec()
            {
                //CPR = "111111-1111",
                Type         = Material.AntiAllergi,
                Color        = PlugColor.Honey,
                EarSide      = Ear.Right,
                CreateDate   = DateTime.Now,
                StaffLoginFK = 1,
            };

            //clinicianDbLogic.CreateNewGeneralSpec(newGeneralSpecR);

            #endregion

            #region Create TecnicalSpec

            TecnicalSpec newTecnicalSpecR = new TecnicalSpec()
            {
                EarSide      = Ear.Right,
                CreateDate   = DateTime.Now,
                StaffLoginFK = 1,
                //CPR = "111111-1111"
            };

            //clinicianDbLogic.CreateTechnicalSpec(newTecnicalSpecR);

            TecnicalSpec newTecnicalSpecL = new TecnicalSpec()
            {
                EarSide      = Ear.Left,
                CreateDate   = DateTime.Now,
                StaffLoginFK = 1,
                //CPR = "111111-1111",
            };

            //clinicianDbLogic.CreateTechnicalSpec(newTecnicalSpecL);

            #endregion

            #region Create rawEarPrint

            RawEarPrint print = new RawEarPrint()
            {
                EarSide      = Ear.Left,
                StaffLoginFK = 1,
                PrintDate    = DateTime.Now,
            };

            //clinicianDbLogic.SavePrint(print, "111111-1111");

            #endregion

            #endregion

            #region Delete (CRUD)

            #region Delete patient

            //Patient DeletePatient = new Patient()
            //{
            //   PCPR = "110396-0000",
            //};

            //clinicianDbLogic.DeletePatient(DeletePatient);

            #endregion

            #region Delete EarCast

            //EarCast DeleteEarCast = new EarCast()
            //{
            //   EarCastID = 2,
            //};

            // clinicianDbLogic.DeleteEarCast(DeleteEarCast);

            #endregion

            #endregion

            #region Update (CRUD)

            #region Update patient

            //Patient UpdatePatient = new Patient()
            //{
            //   PCPR = "110396-0000",
            //   Lastname = "Nedergaard Enevoldsen",
            //   Adress = "Trøjbordvej 72",

            //};

            //clinicianDbLogic.UpdatePatient(UpdatePatient);

            #endregion

            #endregion

            #region Retrive (CRUD)

            #region Retrieve Alle patienter

            //List<Patient> Patients = clinicianDbLogic.GetAllPatients();

            //foreach (Patient patient in Patients)
            //{
            //   Console.WriteLine(patient.Name);
            //}

            #endregion

            #region Retrieve Patient tilhørende øre afstøbning

            //Patient Patient = clinicianDbLogic.GetPatientFromEarCast(2);

            //Console.WriteLine(Patient.Name);

            #endregion

            #region Create afstøbning

            //EarCast earCast = clinicianDbLogic.Get
            //Patient Patient = clinicianDbLogic.GetPatient("250997-0000");

            // Console.WriteLine(Patient.Name);

            #endregion

            #region Retrieve Patient tilhørende øre afstøbning

            //Patient earPatient = clinicianDbLogic.GetPatientWithEarCast("250997-0000");

            //foreach (EarCast earPatientEarCast in earPatient.EarCasts)
            //{
            //    Console.WriteLine($"PCPR: {earPatientEarCast.PCPR} Øre side: {earPatientEarCast.EarSide.ToString()} ID: {earPatientEarCast.EarCastID}");
            //}

            #endregion

            #region Hent en patient med alle parametre udfyldt

            //Patient patient = clinicianDbLogic.GetPatientWithGeneralSpecAndTechnicalSpec("111111-1111");

            #endregion


            #endregion
        }