예제 #1
0
        public static void Get()
        {
            ImadHealthRepository <Appointment> appointments = new madHealthRepository <Appointment>(Help.Context);
            ImadHealthRepository <Patient>     patients     = new madHealthRepository <Patient>(Help.Context);

            DataTable rawData = Help.OpenExcel("Appointments");
            int       N       = 0;

            foreach (DataRow row in rawData.Rows)
            {
                int         oldId   = Help.getInteger(row, 0);
                int         patient = Help.getInteger(row, 2);
                Patient     pat     = patients.Get().FirstOrDefault(x => x.Id == patient);
                Appointment appt    = new Appointment()
                {
                    Date    = Help.getDate(row, 1),
                    Patient = pat,
                };
                N++;
                appointments.Insert(appt);
                appointments.Commit();
                Help.dicAppt.Add(oldId, appt.Id);
            }
            Console.WriteLine(N);
        }
예제 #2
0
        public static void Get()
        {
            ImadHealthRepository <Patient> patients = new madHealthRepository <Patient>(Help.Context);
            DataTable rawData = Help.OpenExcel("Patients");
            int       N       = 0;

            foreach (DataRow row in rawData.Rows)
            {
                int     oldId = Help.getInteger(row, 0);
                Patient pat   = new Patient()
                {
                    Name        = Help.getString(row, 1),
                    Surname     = Help.getString(row, 2),
                    MaidenName  = Help.getString(row, 3),
                    FathersName = Help.getString(row, 4),
                    BirthDate   = Help.getDate(row, 5),
                    UniqueID    = Help.getString(row, 6),
                    Married     = (MarritialStatus)Help.getInteger(row, 7)
                };
                N++;
                patients.Insert(pat);
                patients.Commit();
                Help.dicPatient.Add(oldId, pat.Id);
            }
            Console.WriteLine(N);
        }
예제 #3
0
        public static void Get()
        {
            ImadHealthRepository <AnalysisResult> analysisresults = new madHealthRepository <AnalysisResult>(Help.Context);
            ImadHealthRepository <AnalysisType>   analysistypes   = new madHealthRepository <AnalysisType>(Help.Context);
            DataTable rawData = Help.OpenExcel("AnalysisResults");
            int       N       = 1;

            foreach (DataRow row in rawData.Rows)
            {
                int            oldId  = Help.getInteger(row, 0);
                int            typeID = Help.getInteger(row, 4);
                AnalysisType   atype  = analysistypes.Get().FirstOrDefault(x => x.Id == typeID);
                AnalysisResult result = new AnalysisResult()
                {
                    Title         = Help.getString(row, 1),
                    Type          = atype,
                    Description   = Help.getString(row, 3),
                    Status        = (AnalysisStatus)Help.getInteger(row, 2),
                    AppointmentID = Help.getInteger(row, 5)
                };
                N++;
                analysisresults.Insert(result);
                analysisresults.Commit();
                Help.dicARes.Add(oldId, result.Id);
            }
            Console.WriteLine(N);
        }
예제 #4
0
        public static void Get()
        {
            ImadHealthRepository <AnalysisType> analysistypes = new madHealthRepository <AnalysisType>(Help.Context);
            DataTable rawData = Help.OpenExcel("AnalysisTypes");
            int       N       = 0;

            foreach (DataRow row in rawData.Rows)
            {
                int          oldId  = Help.getInteger(row, 0);
                AnalysisType atypes = new AnalysisType()
                {
                    Title = Help.getString(row, 1),
                };
                N++;
                analysistypes.Insert(atypes);
                analysistypes.Commit();
                Help.dicATypes.Add(oldId, atypes.Id);
            }

            Console.WriteLine(N);
        }
예제 #5
0
        public static void Get()
        {
            ImadHealthRepository <Diagnosis> diagnosises = new madHealthRepository <Diagnosis>(Help.Context);
            DataTable rawData = Help.OpenExcel("Diagnosises");
            int       N       = 0;

            foreach (DataRow row in rawData.Rows)
            {
                int       oldId = Help.getInteger(row, 0);
                Diagnosis diag  = new Diagnosis()
                {
                    Name          = Help.getString(row, 1),
                    Description   = Help.getString(row, 2),
                    Template      = Help.getString(row, 3),
                    AppointmentID = Help.getInteger(row, 4)
                };
                N++;
                diagnosises.Insert(diag);
                diagnosises.Commit();
                Help.dicDiag.Add(oldId, diag.Id);
            }

            Console.WriteLine(N);
        }