コード例 #1
0
        public List <MedicalStaff> getMedicalStaff(MySqlConnection conn, int bedsideId)
        {
            List <MedicalStaff> listMedicalStaff = new List <MedicalStaff>();

            string       sql     = "SELECT medicalStaff_id, work_status FROM medicalstaff WHERE currentBedsideId ='" + bedsideId + "'";
            MySqlCommand sqlComm = new MySqlCommand(sql, conn);

            try
            {
                MySqlDataReader myReader;
                myReader = sqlComm.ExecuteReader();

                while (myReader.Read())
                {
                    MedicalStaff ms = new MedicalStaff();
                    ms.Id         = (string)myReader.GetValue(0);
                    ms.WorkStatus = (bool)myReader.GetValue(1);
                    listMedicalStaff.Add(ms);
                }
                myReader.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
            return(listMedicalStaff);
        }
コード例 #2
0
ファイル: SetData.cs プロジェクト: nbIxMaN/EMKT
        public MedicalStaff MinDoctorSet()
        {
            MedicalStaff doctor = new MedicalStaff
            {
                //IdSpeciality = DoctorData.otherDoctor.IdSpeciality,
                //IdPosition = DoctorData.otherDoctor.IdPosition,
                //Person = new PersonWithIdentity
                //{
                //    IdPersonMis = DoctorData.otherDoctor.Person.IdPersonMis,
                //    HumanName = new HumanName
                //    {
                //        FamilyName = DoctorData.otherDoctor.Person.HumanName.FamilyName,
                //        GivenName = DoctorData.otherDoctor.Person.HumanName.GivenName,
                //    }
                //}

                //"Organization/ab0dba1c-f83f-4605-b436-5da807187466"
                //Data.idlpu
                IdSpeciality = 27,
                IdPosition   = 72,
                IdLpu        = Data.idlpu,
                Person       = new PersonWithIdentity
                {
                    IdPersonMis = "Doctor" + DateTime.Now.ToString() + "." + DateTime.Now.Millisecond.ToString(),
                    HumanName   = new HumanName
                    {
                        FamilyName = "Игрович",
                        GivenName  = "Борис",
                        MiddleName = "Петрович",
                    },
                }
            };

            return(doctor);
        }
コード例 #3
0
ファイル: Data.cs プロジェクト: nbIxMaN/EMKT
        private static MedicalStaff SetOtherDoctor()
        {
            MedicalStaff doctor = new MedicalStaff
            {
                IdLpu        = idlpu,
                IdSpeciality = 4,
                IdPosition   = 69,
                Person       = new PersonWithIdentity
                {
                    IdPersonMis = "123123123259",
                    Sex         = 1,
                    Birthdate   = new DateTime(1978, 01, 07),
                    Documents   = new List <IdentityDocument>
                    {
                        DocumentData.SNILS
                    },
                    HumanName = new HumanName
                    {
                        FamilyName = "Петров",
                        GivenName  = "Евгений",
                        MiddleName = "Васильевич",
                    },
                }
            };

            return(doctor);
        }
コード例 #4
0
ファイル: Data.cs プロジェクト: nbIxMaN/EMKT
        private static MedicalStaff SetDoctor()
        {
            MedicalStaff doctor = new MedicalStaff
            {
                IdLpu        = idlpu,
                IdSpeciality = 29,
                IdPosition   = 74,
                Person       = new PersonWithIdentity
                {
                    IdPersonMis = "Doctor" + DateTime.Now.ToString() + "." + "." + DateTime.Now.Millisecond.ToString(),
                    Sex         = 1,
                    Birthdate   = new DateTime(1974, 01, 07),
                    Documents   = new List <IdentityDocument>
                    {
                        DocumentData.SNILS
                    },
                    HumanName = new HumanName
                    {
                        FamilyName = "Иванов",
                        GivenName  = "Дмитрий",
                        MiddleName = "Александрович",
                    },
                }
            };

            return(doctor);
        }
コード例 #5
0
ファイル: Data.cs プロジェクト: nbIxMaN/EMKT
        private static MedicalStaff SetDoctorWithSNILS()
        {
            MedicalStaff doctor = new MedicalStaff
            {
                IdLpu        = idlpu,
                IdSpeciality = 29,
                IdPosition   = 74,
                Person       = new PersonWithIdentity
                {
                    IdPersonMis = "1234testTEST",
                    Sex         = 1,
                    Birthdate   = new DateTime(1974, 01, 07),
                    Documents   = new List <IdentityDocument>
                    {
                        DocumentData.SNILS,
                    },
                    HumanName = new HumanName
                    {
                        FamilyName = "Иванов",
                        GivenName  = "Дмитрий",
                        MiddleName = "Александрович",
                    },
                }
            };

            return(doctor);
        }
コード例 #6
0
        // Factory Function
        public static Appointment Make(MedicalStaff staff, Patient patient)
        {
            Appointment appointment = new Appointment();

            appointment.MedicalStaff = staff;
            appointment.Patient      = patient;
            return(appointment);
        }
コード例 #7
0
        // Factory Function
        public static Prescription Make(MedicalStaff staff, Patient patient)
        {
            Prescription prescription = new Prescription();

            prescription.Prescriber = staff;
            prescription.Patient    = patient;
            return(prescription);
        }
コード例 #8
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            MedicalStaff medicalStaff = await db.MedicalStaffs.FindAsync(id);

            db.MedicalStaffs.Remove(medicalStaff);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
コード例 #9
0
ファイル: TestDoctor.cs プロジェクト: nbIxMaN/EMKT
 public TestDoctor(MedicalStaff d, string idLpu = "")
 {
     if (d != null)
     {
         doctor = d;
         if (d.IdLpu == null)
             d.IdLpu = idLpu;
         if (d.Person != null)
             person = new TestPerson(d.Person);
     }
 }
コード例 #10
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Degree,ProfileId,FirstName,SecondName")] MedicalStaff medicalStaff)
        {
            if (ModelState.IsValid)
            {
                db.Entry(medicalStaff).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.ProfileId = new SelectList(db.MedicalStaffProfiles, "Id", "ProfileName", medicalStaff.ProfileId);
            return(View(medicalStaff));
        }
コード例 #11
0
        // GET: MedicalStaffs/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MedicalStaff medicalStaff = await db.MedicalStaffs.FindAsync(id);

            if (medicalStaff == null)
            {
                return(HttpNotFound());
            }
            return(View(medicalStaff));
        }
コード例 #12
0
ファイル: TestDoctor.cs プロジェクト: nbIxMaN/EMKT
 public TestDoctor(MedicalStaff d, string idLpu = "")
 {
     if (d != null)
     {
         doctor = d;
         if (d.IdLpu == null)
         {
             d.IdLpu = idLpu;
         }
         if (d.Person != null)
         {
             person = new TestPerson(d.Person);
         }
     }
 }
コード例 #13
0
        // GET: MedicalStaffs/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MedicalStaff medicalStaff = await db.MedicalStaffs.FindAsync(id);

            if (medicalStaff == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ProfileId = new SelectList(db.MedicalStaffProfiles, "Id", "ProfileName", medicalStaff.ProfileId);
            return(View(medicalStaff));
        }
コード例 #14
0
        // Custom load method for staffs because there are 2 types of staffs.
        public override T Load(int id)
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.STAFFS);

            query.Comparator = new QueryComparator()
            {
                Source  = new QueryElement(Database.Tables.Generic.ID),
                Operand = new QueryElement(null, id),
                Equal   = true
            };

            query.Add(Database.Tables.Staffs.Type);

            MySqlCommand    command = new MySqlCommand(query.Select, Database.Connection);
            MySqlDataReader reader  = command.ExecuteReader();

            if (reader.Read())
            {
                Staff obj;
                char  type = reader.GetChar(0);

                if (type.ToString().ToUpper().Equals("M"))
                {
                    obj = new MedicalStaff();
                }

                else if (type.ToString().ToUpper().Equals("R"))
                {
                    obj = new Receptionist();
                }

                else
                {
                    throw new UnknownStaffTypeError();
                }

                obj.Load(id);
                if (obj.Loaded)
                {
                    Add(( T )(obj));
                }
            }

            return(null);
        }
コード例 #15
0
ファイル: TestMiacClient.cs プロジェクト: nbIxMaN/EMKT
 private EMKServise.MedicalStaff ConvertMedicalStaff(MedicalStaff c)
 {
     if ((object)c != null)
     {
         EMKServise.MedicalStaff em = new EMKServise.MedicalStaff();
         if (c.IdLpu != "")
         {
             em.IdLpu = c.IdLpu;
         }
         em.IdPosition   = c.IdPosition;
         em.IdSpeciality = c.IdSpeciality;
         em.Person       = ConvertPersonWithIdentity(c.Person);
         return(em);
     }
     else
     {
         return(null);
     }
 }
コード例 #16
0
ファイル: TestDoctor.cs プロジェクト: nbIxMaN/EMKT
 static public TestDoctor BuildTestDoctorFromDataBase(string doctorId)
 {
     if (doctorId != null)
     {
         using (SqlConnection connection = Global.GetSqlConnection())
         {
             string     findDoctor = "SELECT TOP(1) * FROM Doctor, nsi.DoctorSpec WHERE Doctor.IdDoctor = '" + doctorId + "' AND Doctor.IdSpeciality = nsi.DoctorSpec.IdSpeciality";
             SqlCommand doc        = new SqlCommand(findDoctor, connection);
             using (SqlDataReader doctorReader = doc.ExecuteReader())
             {
                 while (doctorReader.Read())
                 {
                     string       IdPerson = Convert.ToString(doctorReader["IdPerson"]);
                     MedicalStaff ms       = new MedicalStaff();
                     ms.IdPosition   = Convert.ToUInt16(doctorReader["IdPosition"]);
                     ms.IdSpeciality = Convert.ToUInt16(doctorReader["Code"]);
                     ms.IdLpu        = Convert.ToString(doctorReader["IdLpu"]);
                     if (Data.type == Type.oid)
                     {
                         string findIdInstitutionalString =
                             "SELECT TOP(1) * FROM Institution WHERE IdInstitution = '" + ms.IdLpu + "'";
                         using (SqlConnection connection2 = Global.GetSqlConnection())
                         {
                             SqlCommand IdInstitution = new SqlCommand(findIdInstitutionalString, connection2);
                             using (SqlDataReader IdInstitutional = IdInstitution.ExecuteReader())
                             {
                                 while (IdInstitutional.Read())
                                 {
                                     ms.IdLpu = IdInstitutional["IdFedNsi"].ToString();
                                 }
                             }
                         }
                     }
                     TestDoctor p = new TestDoctor(ms);
                     p.person = TestPerson.BuildPersonFromDataBaseData(IdPerson);
                     return(p);
                 }
             }
         }
     }
     return(null);
 }
コード例 #17
0
ファイル: TestDoctor.cs プロジェクト: nbIxMaN/EMKT
 public static TestDoctor BuildTestDoctorFromDataBase(string doctorId)
 {
     if (doctorId != null)
     {
         using (SqlConnection connection = Global.GetSqlConnection())
         {
             string findDoctor = "SELECT TOP(1) * FROM Doctor, nsi.DoctorSpec WHERE Doctor.IdDoctor = '" + doctorId + "' AND Doctor.IdSpeciality = nsi.DoctorSpec.IdSpeciality";
             SqlCommand doc = new SqlCommand(findDoctor, connection);
             using (SqlDataReader doctorReader = doc.ExecuteReader())
             {
                 while (doctorReader.Read())
                 {
                     string IdPerson = Convert.ToString(doctorReader["IdPerson"]);
                     MedicalStaff ms = new MedicalStaff();
                     ms.IdPosition = Convert.ToUInt16(doctorReader["IdPosition"]);
                     ms.IdSpeciality = Convert.ToUInt16(doctorReader["Code"]);
                     ms.IdLpu = Convert.ToString(doctorReader["IdLpu"]);
                     if (Data.type == Type.oid)
                     {
                         string findIdInstitutionalString =
                             "SELECT TOP(1) * FROM Institution WHERE IdInstitution = '" + ms.IdLpu + "'";
                         using (SqlConnection connection2 = Global.GetSqlConnection())
                         {
                             SqlCommand IdInstitution = new SqlCommand(findIdInstitutionalString, connection2);
                             using (SqlDataReader IdInstitutional = IdInstitution.ExecuteReader())
                             {
                                 while (IdInstitutional.Read())
                                 {
                                     ms.IdLpu = IdInstitutional["IdFedNsi"].ToString();
                                 }
                             }
                         }
                     }
                     TestDoctor p = new TestDoctor(ms);
                     p.person = TestPerson.BuildPersonFromDataBaseData(IdPerson);
                     return p;
                 }
             }
         }
     }
     return null;
 }
コード例 #18
0
        public void TestAddNewMedicalStaff()
        {
            DbConnector dbC  = new DbConnector();
            string      resp = dbC.connect();

            Assert.AreEqual("Done", resp);

            MedicalStaff staff = new MedicalStaff();

            staff.Staffid  = "D3";
            staff.Name     = "UnitTestName";
            staff.Password = "******";
            staff.Career   = "East Wing";
            staff.Email    = "Floor 1";
            staff.Contact  = "0102315555";
            staff.Pager    = "4415";

            MedicalStaffHandler UnitTest1 = new MedicalStaffHandler();
            int resp2 = UnitTest1.addNewMedicalStaff(dbC.getConn(), staff);

            Assert.IsNotNull(resp2);
        }
コード例 #19
0
ファイル: Data.cs プロジェクト: knastya/Fhir-Proxy
 private static MedicalStaff SetDoctor()
 {
     MedicalStaff doctor = new MedicalStaff
     {
         IdLpu = "1.2.643.5.1.13.3.25.78.118",
         IdSpeciality = 29,
         IdPosition = 74,
         Person = new PersonWithIdentity
         {
             IdPersonMis = "123400010",
             Sex = 1,
             Birthdate = new DateTime(1974, 01, 07),
             Documents = new IdentityDocument[]
             {
                 DocumentData.Passport,
                 DocumentData.SNILS
             },
             HumanName = new HumanName
             {
                 FamilyName = "Иванов" + new Random().Next(100),
                 GivenName = "Дмитрий" + new Random().Next(100),
                 MiddleName = "Александрович" + new Random().Next(100),
             },
         }
     };
     return doctor;
 }
コード例 #20
0
 public static List <WorkingDays> GetWorkingDaysByStaff(MedicalStaff staff)
 {
     return(GetWorkingDaysByStaff(staff.Id));
 }
コード例 #21
0
 public static List <LeaveDate> GetLeaveDatesByStaff(MedicalStaff staff)
 {
     return(GetLeaveDatesByStaff(staff.Id));
 }
コード例 #22
0
 public static List <Prescription> GetPrescriptions(MedicalStaff staff, Patient patient)
 {
     return(GetPrescriptions(staff.Id, patient.Id));
 }
コード例 #23
0
 public static List <TestResult> GetTestResultsByStaff(MedicalStaff staff)
 {
     return(TestResultManager.Merge(Database.Tables.TEST_RESULTS, ManagerHelper.GetEqualComparator(Database.Tables.TestResults.MedicalLicenseNo, staff.LicenseNo)));
 }
コード例 #24
0
ファイル: SetData.cs プロジェクト: knastya/Fhir-Proxy
        public MedicalStaff MinDoctorSet()
        {
            MedicalStaff doctor = new MedicalStaff
            {
                IdSpeciality = DoctorData.otherDoctor.IdSpeciality,
                IdPosition = DoctorData.otherDoctor.IdPosition,
                Person = new PersonWithIdentity
                {
                    IdPersonMis = DoctorData.otherDoctor.Person.IdPersonMis,
                    HumanName = new HumanName
                    {
                        FamilyName = DoctorData.otherDoctor.Person.HumanName.FamilyName,
                        GivenName = DoctorData.otherDoctor.Person.HumanName.GivenName,
                    }
                }
            };

            return doctor;
        }
コード例 #25
0
 public static List <Appointment> GetAppointments(MedicalStaff staff, Patient patient)
 {
     return(GetAppointments(staff.Id, patient.Id));
 }
コード例 #26
0
ファイル: TestMiacClient.cs プロジェクト: nbIxMaN/EMKT
 private EMKServise.MedicalStaff ConvertMedicalStaff(MedicalStaff c)
 {
     if ((object)c != null)
     {
         EMKServise.MedicalStaff em = new EMKServise.MedicalStaff();
         if (c.IdLpu != "")
             em.IdLpu = c.IdLpu;
         em.IdPosition = c.IdPosition;
         em.IdSpeciality = c.IdSpeciality;
         em.Person = ConvertPersonWithIdentity(c.Person);
         return em;
     }
     else
         return null;
 }
コード例 #27
0
ファイル: SetData.cs プロジェクト: nbIxMaN/EMKT
        public MedicalStaff MinDoctorSet()
        {
            MedicalStaff doctor = new MedicalStaff
            {
                //IdSpeciality = DoctorData.otherDoctor.IdSpeciality,
                //IdPosition = DoctorData.otherDoctor.IdPosition,
                //Person = new PersonWithIdentity
                //{
                //    IdPersonMis = DoctorData.otherDoctor.Person.IdPersonMis,
                //    HumanName = new HumanName
                //    {
                //        FamilyName = DoctorData.otherDoctor.Person.HumanName.FamilyName,
                //        GivenName = DoctorData.otherDoctor.Person.HumanName.GivenName,
                //    }
                //}

                //"Organization/ab0dba1c-f83f-4605-b436-5da807187466"
                //Data.idlpu
                IdSpeciality = 27,
                IdPosition = 72,
                IdLpu = Data.idlpu,
                Person = new PersonWithIdentity
                {
                    IdPersonMis = "Doctor" + DateTime.Now.ToString() + "." + DateTime.Now.Millisecond.ToString(),
                    HumanName = new HumanName
                    {
                        FamilyName = "Игрович",
                        GivenName = "Борис",
                        MiddleName = "Петрович",
                    },
                }
            };

            return doctor;
        }
コード例 #28
0
ファイル: Data.cs プロジェクト: nbIxMaN/EMKT
 private static MedicalStaff SetDoctor()
 {
     MedicalStaff doctor = new MedicalStaff
     {
         IdLpu = idlpu,
         IdSpeciality = 29,
         IdPosition = 74,
         Person = new PersonWithIdentity
         {
             IdPersonMis = "Doctor" + DateTime.Now.ToString()+ "."+ "." + DateTime.Now.Millisecond.ToString(),
             Sex = 1,
             Birthdate = new DateTime(1974, 01, 07),
             Documents = new List<IdentityDocument>
             {
                 DocumentData.SNILS
             },
             HumanName = new HumanName
             {
                 FamilyName = "Иванов",
                 GivenName = "Дмитрий",
                 MiddleName = "Александрович",
             },
         }
     };
     return doctor;
 }
コード例 #29
0
ファイル: Data.cs プロジェクト: nbIxMaN/EMKT
 private static MedicalStaff SetDoctorWithSNILS()
 {
     MedicalStaff doctor = new MedicalStaff
     {
         IdLpu = idlpu,
         IdSpeciality = 29,
         IdPosition = 74,
         Person = new PersonWithIdentity
         {
             IdPersonMis = "1234testTEST",
             Sex = 1,
             Birthdate = new DateTime(1974, 01, 07),
             Documents = new List<IdentityDocument>
             {
                 DocumentData.SNILS,
             },
             HumanName = new HumanName
             {
                 FamilyName = "Иванов",
                 GivenName = "Дмитрий",
                 MiddleName = "Александрович",
             },
         }
     };
     return doctor;
 }
コード例 #30
0
 public makeAppointment(MedicalStaff, Patient, Appointment)
 {
 }
コード例 #31
0
ファイル: Data.cs プロジェクト: nbIxMaN/EMKT
 private static MedicalStaff SetOtherDoctor()
 {
     MedicalStaff doctor = new MedicalStaff
     {
         IdLpu = idlpu,
         IdSpeciality = 4,
         IdPosition = 69,
         Person = new PersonWithIdentity
         {
             IdPersonMis = "123123123259",
             Sex = 1,
             Birthdate = new DateTime(1978, 01, 07),
             Documents = new List<IdentityDocument>
             {
                 DocumentData.SNILS
             },
             HumanName = new HumanName
             {
                 FamilyName = "Петров",
                 GivenName = "Евгений",
                 MiddleName = "Васильевич",
             },
         }
     };
     return doctor;
 }
コード例 #32
0
ファイル: Data.cs プロジェクト: knastya/Fhir-Proxy
 private static MedicalStaff SetOtherDoctor()
 {
     MedicalStaff doctor = new MedicalStaff
     {
         IdLpu = "1.2.643.5.1.13.3.25.78.118",
         IdSpeciality = 4,
         IdPosition = 69,
         Person = new PersonWithIdentity
         {
             IdPersonMis = "123123123256",
             Sex = 1,
             Birthdate = new DateTime(1978, 01, 07),
             Documents = new IdentityDocument[]
             {
                 DocumentData.Passport,
                 DocumentData.SNILS
             },
             HumanName = new HumanName
             {
                 FamilyName = "Петров" + new Random().Next(100),
                 GivenName = "Евгений" + new Random().Next(100),
                 MiddleName = "Васильевич" + new Random().Next(100),
             },
         }
     };
     return doctor;
 }