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); }
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); }
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); }
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); }
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); }
// Factory Function public static Appointment Make(MedicalStaff staff, Patient patient) { Appointment appointment = new Appointment(); appointment.MedicalStaff = staff; appointment.Patient = patient; return(appointment); }
// Factory Function public static Prescription Make(MedicalStaff staff, Patient patient) { Prescription prescription = new Prescription(); prescription.Prescriber = staff; prescription.Patient = patient; return(prescription); }
public async Task <ActionResult> DeleteConfirmed(int id) { MedicalStaff medicalStaff = await db.MedicalStaffs.FindAsync(id); db.MedicalStaffs.Remove(medicalStaff); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
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); } }
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)); }
// 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)); }
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); } } }
// 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)); }
// 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); }
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); } }
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); }
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; }
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); }
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; }
public static List <WorkingDays> GetWorkingDaysByStaff(MedicalStaff staff) { return(GetWorkingDaysByStaff(staff.Id)); }
public static List <LeaveDate> GetLeaveDatesByStaff(MedicalStaff staff) { return(GetLeaveDatesByStaff(staff.Id)); }
public static List <Prescription> GetPrescriptions(MedicalStaff staff, Patient patient) { return(GetPrescriptions(staff.Id, patient.Id)); }
public static List <TestResult> GetTestResultsByStaff(MedicalStaff staff) { return(TestResultManager.Merge(Database.Tables.TEST_RESULTS, ManagerHelper.GetEqualComparator(Database.Tables.TestResults.MedicalLicenseNo, staff.LicenseNo))); }
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; }
public static List <Appointment> GetAppointments(MedicalStaff staff, Patient patient) { return(GetAppointments(staff.Id, patient.Id)); }
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; }
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; }
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; }
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; }
public makeAppointment(MedicalStaff, Patient, Appointment) { }
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; }
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; }