示例#1
0
        public void TestGetById()
        {
            var patientService = new PatientServices(_patientRepository.Object);
            var result         = patientService.GetById(1);

            Assert.NotNull(result);
        }
示例#2
0
        public async Task TestDeleteTask()
        {
            var patientService = new PatientServices(_patientRepository.Object);
            var result         = await patientService.Delete(5);

            Assert.True(result);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Patient temp = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);

            string consult = this.doctor.Name + ":" + this.doctor.Phone;

            if (patient.Status != 1)
            {
                textBox2.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                MessageBox.Show("NO Data");
            }
            else if (patient != null && patient.Consultant.Equals(consult))
            {
                textBox2.Text = patient.Name;
                textBox3.Text = patient.Gender;
                textBox4.Text = patient.Age.ToString();
            }
            else
            {
                textBox2.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                MessageBox.Show("NO Data");
            }
        }
示例#4
0
        public void TestGetAll()
        {
            var patientService = new PatientServices(_patientRepository.Object);
            var result         = patientService.GetAll();

            Assert.True(result.Count() == 10);
        }
示例#5
0
 public RegistrationNewPatientForm_3(NewPatient newPatient)
 {
     InitializeComponent();
     patientServices  = new PatientServices();
     this.newPatient3 = newPatient;
     setGolonganDarah();
 }
 public RegistrationNewPatientForm_2()
 {
     InitializeComponent();
     patientServices = new PatientServices();
     getJenisKel();
     txtJenisKel.Choices = ListJenisKelamins;
 }
        private void extraServicesBtn_Click(object sender, EventArgs e)
        {
            dataGridView1.Visible = false;

            label14.Show();
            label15.Show();
            textBox10.Show();
            textBox11.Show();

            if (textBox1.Text == "")
            {
                MessageBox.Show("provide Id");
            }
            else
            {
                Patient temp = new Patient();
                temp.Id = Convert.ToInt32(textBox1.Text);

                Patient         patient         = new Patient();
                PatientServices patientServices = new PatientServices();
                patient = patientServices.Get(temp);
                if (patient.OT == 1)
                {
                    textBox11.Text = "YES";
                }
                else
                {
                    textBox11.Text = "NO";
                }

                textBox10.Text = patient.ExtraServices;
            }
        }
示例#8
0
        private void loadBtn_Click(object sender, EventArgs e)
        {
            //List<Patient> patients = new List<Patient>();
            PatientServices patientServices = new PatientServices();

            dataGridView1.DataSource = patientServices.GetAllCurrent();
        }
示例#9
0
        private void checkOutBtn_Click(object sender, EventArgs e)
        {
            Patient patient = new Patient();

            patient.Seat         = Convert.ToInt32(textBox12.Text);
            patient.Id           = Convert.ToInt32(textBox1.Text);
            patient.Status       = 0;
            patient.RoomNumber   = Convert.ToInt32(textBox11.Text);
            patient.CheckOutDate = DateTime.Today.ToString();
            PatientServices patientServices = new PatientServices();
            bool            check           = patientServices.Update(patient);

            if (check)
            {
                MessageBox.Show("Checked Out ");

                printDialog1.Document = printDocument1;
                if (printDialog1.ShowDialog() == DialogResult.OK)
                {
                    printDocument1.Print();
                }
            }
            else
            {
                MessageBox.Show("Error");
            }
        }
示例#10
0
 public PatientsController(AppDb newDb)
 {
     Db         = newDb;
     orgService = new OrganisationServices(Db);
     depService = new DepartmentServices(Db);
     patService = new PatientServices(Db);
 }
示例#11
0
        private void button1_Click(object sender, EventArgs e)
        {
            dataGridView1.Dock    = DockStyle.Fill;
            dataGridView1.Visible = true;
            //extraServicesControl1.Visible = false;
            comboBox3.Hide();
            label15.Hide();
            checkedListBox1.Hide();
            label14.Hide();
            button3.Hide();
            button4.Hide();

            List <Patient>  patients        = new List <Patient>();
            PatientServices patientServices = new PatientServices();

            patients = patientServices.GetAllCurrent();

            foreach (Patient item in patients.ToList())
            {
                // MessageBox.Show(doctor.Name + ":" + doctor.Phone);
                if (item.Consultant.Equals(doctor.Name + ":" + doctor.Phone) == false)
                {
                    patients.Remove(item);
                }
            }

            dataGridView1.DataSource = patients;
        }
示例#12
0
        private void button2_Click(object sender, EventArgs e)
        {
            comboBox3.Hide();
            label15.Hide();
            checkedListBox1.Hide();
            label14.Hide();
            button3.Hide();
            button4.Hide();



            Patient temp = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);
            string consult = doctor.Name + ":" + doctor.Phone;

            if (patient.Status != 1)
            {
                textBox2.Text = "";
                textBox8.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                textBox5.Text = "";
                textBox6.Text = "";
                textBox7.Text = "";
                textBox9.Text = "";

                MessageBox.Show("No data");
            }
            else if (patient != null && patient.Consultant.Equals(consult))
            {
                textBox2.Text  = patient.Name;
                textBox8.Text  = patient.Date;
                textBox3.Text  = patient.Gender;
                textBox4.Text  = patient.Age.ToString();
                textBox5.Text  = patient.Phone;
                textBox6.Text  = patient.Consultant;
                textBox7.Text  = patient.Address;
                textBox9.Text  = patient.Emergency;
                comboBox2.Text = patient.ReadyToRelease;
                comboBox1.Text = patient.ReleaseCondition;
            }
            else
            {
                textBox2.Text = "";
                textBox8.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                textBox5.Text = "";
                textBox6.Text = "";
                textBox7.Text = "";
                textBox9.Text = "";
                MessageBox.Show("NO Data");
            }
        }
示例#13
0
 public AppInfoController(AppDb newDb)
 {
     Db         = newDb;
     orgService = new OrganisationServices(Db);
     depService = new DepartmentServices(Db);
     patService = new PatientServices(Db);
     queueCalc  = new QueuePositionCalculator();
 }
示例#14
0
        private void button3_Click(object sender, EventArgs e)
        {
            PatientServices patientServices = new PatientServices();
            Patient         temp            = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);

            Patient patient = new Patient();

            patient = patientServices.Get(temp);

            List <string> test = new List <string>();

            foreach (string item in checkedListBox1.CheckedItems)
            {
                test.Add(item);
            }
            string testList = "";
            double tcost    = patient.TotalCost;

            foreach (string item in test)
            {
                testList += item + ",";
                tcost    += 500;
            }


            // patient.Id = Convert.ToInt32(textBox1.Text);
            if (comboBox3.Text.Equals("YES"))
            {
                patient.OT = 1;
                tcost     += 2000;
            }
            else
            {
                patient.OT = 0;
            }

            patient.ExtraServices = testList;
            patient.TotalCost     = tcost;


            bool check = patientServices.ExtraServicesUpdate(patient);

            if (check)
            {
                MessageBox.Show("Extra services added.");
            }

            else
            {
                MessageBox.Show("error occured.");
            }
        }
示例#15
0
        public async Task TestUpdateTask()
        {
            var patientService = new PatientServices(_patientRepository.Object);

            var newPatient = Builder <Patient> .CreateNew()
                             .With(q => q.id = 1)
                             .Build();

            var result = await patientService.Update(newPatient);

            Assert.AreEqual(newPatient, result);
        }
示例#16
0
        public async Task TestAddTask()
        {
            var patientService = new PatientServices(_patientRepository.Object);

            var newPatient = Builder <Patient> .CreateNew()
                             .With(q => q.id = 0)
                             .Build();

            var result = await patientService.Add(newPatient);

            Assert.True(result.id == 525);
        }
        public RegistrationNewPatientForm_4(NewPatient newPatient)
        {
            InitializeComponent();
            patientServices      = new PatientServices();
            registrationServices = new RegistrationServices();
            this.newPatient4     = newPatient;
            newRegistration      = new NewRegistration();

            newRegistration.NoKtp      = App.noKTPNewRegis;
            newRegistration.tglreg     = App.TglPeriksaNewRegis;
            newRegistration.kodedokter = App.KodeDokterNewRegis;
            newRegistration.kodeKLinik = App.KodeKlinikNewRegis;
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Patient temp = new Patient();



            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);
            if (patient.Status != 1)
            {
                textBox2.Text = "";
                textBox8.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                textBox5.Text = "";
                textBox6.Text = "";
                textBox7.Text = "";
                textBox9.Text = "";



                MessageBox.Show("No data");
            }
            else if (patient != null)
            {
                textBox2.Text = patient.Name;
                textBox8.Text = patient.Date;
                textBox3.Text = patient.Gender;
                textBox4.Text = patient.Age.ToString();
                textBox5.Text = patient.Phone;
                textBox6.Text = patient.Consultant;
                textBox7.Text = patient.Address;
                textBox9.Text = patient.Emergency;

                comboBox2.Text = patient.ReadyToRelease;
                if (patient.ReadyToRelease == "Yes")
                {
                    comboBox1.Text = patient.ReleaseCondition;
                }
                else
                {
                    comboBox1.Enabled = false;
                }
            }
        }
        public RegistrationNewPatientForm_2(NewPatient newPatient)
        {
            InitializeComponent();
            string currentDate = Preferences.Get("currentDate", "");

            DateTime current_date = DateUtil.ConvertStringToDate(currentDate, "dd/MM/yyyy");

            this.newPatient2 = newPatient;
            patientServices  = new PatientServices();
            getJenisKel();
            txtJenisKel.Choices = ListJenisKelamins;
            txtNamaPasien.Text  = newPatient2.NamaPasien;
            txtTempatLahir.Text = newPatient2.vc_tp_lhr;
            dtTglLahir.Date     = current_date;
            setUmur();
            //  await DisplayAlert("Alert", "You have been alerted3", "OK");
        }
示例#20
0
        private void serachBtn_Click(object sender, EventArgs e)
        {
            Patient temp = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);
            if (patient.Status != 0)
            {
                textBox2.Text  = "";
                textBox8.Text  = "";
                textBox3.Text  = "";
                textBox4.Text  = "";
                textBox5.Text  = "";
                textBox6.Text  = "";
                textBox7.Text  = "";
                textBox9.Text  = "";
                textBox10.Text = "";
                textBox11.Text = "";
                textBox12.Text = "";
                MessageBox.Show("No data");
            }
            else if (patient != null)
            {
                textBox2.Text  = patient.Name;
                textBox8.Text  = patient.Date;
                textBox3.Text  = patient.Gender;
                textBox4.Text  = patient.Age.ToString();
                textBox5.Text  = patient.Phone;
                textBox6.Text  = patient.Consultant;
                textBox7.Text  = patient.Address;
                textBox9.Text  = patient.Emergency;
                comboBox2.Text = patient.ReadyToRelease;
                textBox10.Text = patient.TotalCost.ToString();

                textBox11.Text = patient.RoomNumber.ToString();
                textBox12.Text = patient.Seat.ToString();


                comboBox1.Text    = patient.ReleaseCondition;
                comboBox1.Enabled = true;
            }
        }
        public async Task <IActionResult> ReadRelatedDate(int?id, int?serviceId)
        {
            var relatedDate = new PatientServiceRelatedEntity();

            relatedDate.patientServices = await _db.PatientService.Include(s => s.Services)
                                          .Include(s => s.Patient)
                                          .Include(s => s.Employee)
                                          .ThenInclude(s => s.department).ToListAsync();

            if (id != null)
            {
                ViewData["PatientServiceId"] = id.Value;
                PatientServices ps = relatedDate.patientServices.Where(i => i.Id == id.Value).Single();
            }


            return(View(relatedDate));
        }
        private void button1_Click(object sender, EventArgs e)
        {
            dataGridView1.Dock    = DockStyle.Fill;
            dataGridView1.Visible = true;



            List <Patient>  patients        = new List <Patient>();
            PatientServices patientServices = new PatientServices();

            patients = patientServices.GetAllCurrent();
            dataGridView1.DataSource = patients;

            label14.Hide();
            label15.Hide();
            textBox10.Hide();
            textBox11.Hide();
        }
示例#23
0
        private void button5_Click(object sender, EventArgs e)
        {
            Patient temp = new Patient();

            temp.Id               = Convert.ToInt32(textBox1.Text);
            temp.ReadyToRelease   = comboBox2.Text;
            temp.ReleaseCondition = comboBox1.Text;


            PatientServices patientServices = new PatientServices();
            bool            check           = patientServices.ConditionUpdate(temp);

            if (check)
            {
                MessageBox.Show("Updated..");
            }
            else
            {
                MessageBox.Show("error");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Patient temp = new Patient();

            temp.Id = Convert.ToInt32(textBox1.Text);
            PatientServices patientServices = new PatientServices();
            Patient         patient         = new Patient();

            patient = patientServices.Get(temp);
            patient.Prescription = textBox5.Text;

            bool check = patientServices.PrescriptionUpdate(patient);

            if (check)
            {
                MessageBox.Show("Successfull");
            }
            else
            {
                MessageBox.Show("Error Occured");
            }
        }
示例#25
0
        private void loadBtn_Click(object sender, EventArgs e)
        {
            PatientServices patientServices = new PatientServices();

            dataGridView1.DataSource = patientServices.GetAllPrevious();
        }
 public RegistrationNewPatientForm_4()
 {
     InitializeComponent();
     patientServices      = new PatientServices();
     registrationServices = new RegistrationServices();
 }
示例#27
0
 public PatientController(PatientServices patientServices)
 {
     _patientService = patientServices;
 }
示例#28
0
 public CheckKTPForm()
 {
     InitializeComponent();
     patientServices = new PatientServices();
 }