예제 #1
0
        static void Main(string[] args)
        {
            //hardcoded patient 1
            var cnpPacient  = "0123456789";
            var numePacient = new NumeIntreg("Ana", "David");
            var sex         = "F ";
            var dataNastere = new Data(7, 3, 1995);
            var adresa      = new Adresa("Timis", "Timisoara", "Timocului", 1);
            var ocupatie    = "student";
            var locMunca    = "Firma1";

            //hardcoded patient 2
            var cnpPacient2  = "1234567890";
            var numePacient2 = new NumeIntreg("Denis", "Iulian");
            var sex2         = "M ";
            var dataNastere2 = new Data(11, 10, 1995);
            var adresa2      = new Adresa("Timis", "Timisoara", "Marasti", 20);
            var ocupatie2    = "contabil";
            var locMunca2    = "Firma2";

            //creeaza pacient
            var pacient1 = PacientFactory.Instance.creeazaPacient(cnpPacient, numePacient, sex, dataNastere, adresa, ocupatie, locMunca);
            //Console.WriteLine(pacient1.toString());

            //creeaza pacient 2
            var pacient2 = PacientFactory.Instance.creeazaPacient(cnpPacient2, numePacient2, sex2, dataNastere2, adresa2, ocupatie2, locMunca2);
            //Console.WriteLine(pacient2.toString());

            //for every hardcoded patient, generate his pdf file with personal data
            string pathPDF1          = @"DatePacient-" + pacient1.cnp + ".pdf";
            string pathPDF2          = @"DatePacient-" + pacient2.cnp + ".pdf";
            var    generatorFisaDate = new FisaDateIdentificare();

            generatorFisaDate.GenerareFisa(pacient1, pathPDF1);
            generatorFisaDate.GenerareFisa(pacient2, pathPDF2);


            //afisare lista pacienti
            //Console.WriteLine("TOTI DIN LISTA");
            //foreach(Pacient p in Pacient.listaPacienti)
            //{
            //    Console.WriteLine(p.cnp);
            //}

            //afisare cnp pacienti
            Console.WriteLine("cnp pacienti existenti");
            foreach (Pacient p in Pacient.listaPacienti)
            {
                Console.WriteLine(p.cnp);
            }

            //MENIU

            int optiune = 0;

            do
            {
                var          meniu = new MeniuPrincipal();
                CautaPacient cautaPacient;
                int          gasit     = 0;
                string       pathPDF   = "";
                string       cnpCautat = "";

                Console.WriteLine("\nAlegeti o optiune: \n");
                optiune = Convert.ToInt16(Console.ReadLine());

                switch (optiune)
                {
                case 0: break;

                case 1:     //adaugare pacient
                    var     meniuAdaugare = new MeniuSecundar();
                    Pacient pacientNou    = meniuAdaugare.MeniuAdaugarePacient();
                    Pacient.listaPacienti.Add(pacientNou);

                    pathPDF = @"DatePacient-" + pacientNou.cnp + ".pdf";
                    var generator = new FisaDateIdentificare();
                    generator.GenerareFisa(pacientNou, pathPDF);

                    break;

                case 2:     //vizualizare fisa date personale
                    var meniuDate = new MeniuSecundar();
                    var cnp       = meniuDate.MeniuFisaPersonala();

                    cautaPacient = new CautaPacient();
                    gasit        = cautaPacient.Cauta(cnp);

                    if (gasit == 1)
                    {
                        pathPDF = @"DatePacient-" + cnp + ".pdf";

                        var pdfDoc = new DeschidePDF(pathPDF);
                    }
                    else
                    {
                        Console.WriteLine("cnp-ul cautat nu este inregistrat");
                    }

                    break;

                case 3:    //vizualizare istoric
                    Console.WriteLine("Dati cnp-ul pacientului cautat:");
                    cnpCautat = Console.ReadLine();

                    pathPDF = @"Istoric" + cnpCautat + ".pdf";

                    cautaPacient = new CautaPacient();
                    gasit        = cautaPacient.Cauta(cnpCautat);
                    if (gasit == 1)
                    {
                        var pacientGasit3 = cautaPacient.PacientGasit(cnpCautat);

                        if (pacientGasit3.istoricExistent == 1)
                        {
                            var docIstoric = new IstoricPacient();
                            docIstoric.GenerareFisa(pacientGasit3, pathPDF);
                            var pdfDoc3 = new DeschidePDF(pathPDF);
                        }
                        else
                        {
                            Console.WriteLine("pacientul nu are istoric");
                        }
                    }


                    break;

                case 4:    //generare docuemnt

                    Console.WriteLine("Dati cnp-ul pacientului cautat.");
                    cnpCautat = Console.ReadLine();

                    //cauta pacient
                    cautaPacient = new CautaPacient();
                    gasit        = cautaPacient.Cauta(cnpCautat);
                    var pacientGasit = new Pacient();

                    if (gasit == 1)
                    {
                        pacientGasit = cautaPacient.PacientGasit(cnpCautat);
                    }

                    var meniu4 = new MeniuSecundar();
                    var doc4   = Convert.ToInt16(meniu4.MeniuGenerareDocumente());

                    switch (doc4)
                    {
                    case 1:         //adeverinta medicala

                        var generareDoc = new GenerareDoc();
                        generareDoc.AlegeTipulDocumentului("adeverinta medicala", cnpCautat);

                        //se adauga in dictionar pentru a ramane in istoricul pacientului datele
                        // pacientGasit.afectiuneRecomandare.Add()

                        break;

                    case 2:         //reteta

                        var generareDocReteta = new GenerareDoc();
                        generareDocReteta.AlegeTipulDocumentului("reteta", cnpCautat);

                        break;
                    }
                    break;
                }
            } while (optiune != 0);
            //Console.Read();
        }
예제 #2
0
        public void AlegeTipulDocumentului(string tipDocument, string cnp)
        {
            //date spital
            var        judetSpital      = "judetSpital";
            var        localitateSpital = "localitateSpital";
            var        unitateSanitara  = "unitateSanitara";
            DateSpital dateSpital       = new DateSpital(judetSpital, localitateSpital, unitateSanitara);
            var        nrFisa           = 234;

            DateTime azi          = DateTime.Now;
            Data     dataEiberare = new Data(azi.Day, azi.Month, azi.Year);

            //initializare
            Pacient pacient = new Pacient();

            var cauta = new CautaPacient();
            var gasit = cauta.Cauta(cnp);

            if (gasit == 1)
            {
                // pacientAdeverinta = PacientFactory.Instance.creeazaPacient(cnp, numePacient, sexPacient, dataNastere, adresa, ocupatie, locMunca);
                pacient = cauta.PacientGasit(cnp);
            }

            switch (tipDocument)
            {
            case "adeverinta medicala":

                //adeverinta

                var afectiune   = "pneumonie";
                var recomandare = "Se recomanda perioada de o saptamana repaus acasa";
                var serive      = "insanatosire";

                AdeverintaMedicala adeverinta = new AdeverintaMedicala(dateSpital, nrFisa, pacient, afectiune, recomandare, serive, dataEiberare);

                //adaugam pt istoric
                pacient.afectiuneRecomandare.Add(afectiune, recomandare);
                //adaugam in fisa istoric existenta pentru pacient

                if (pacient.istoricExistent == 0)
                {
                    pacient.istoricExistent = 1;
                }

                adeverinta.GenereazaAdeverintaMedicala(cnp);
                break;


            case "reteta":
                //hardcoded
                var nrReteta   = 1;
                var gratuit    = "DA";
                var diagnostic = "raceala";
                var reteta     = "Nurofen Raceala si Gripa - 3ori/zi" + "\n Trachisan 1/zi";

                Reteta retetaFisa = new Reteta(dateSpital, nrReteta, gratuit, pacient, diagnostic, reteta, dataEiberare);
                retetaFisa.GenereazaReteta(cnp);

                break;
            }
        }