示例#1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (txtLabId.Text == "")
            {
                MessageBox.Show("Please Enter Lab Id");
                txtLabId.Focus();
                return;
            }

            LabResponseModel     labResponse     = xDb.GetLabRecordFromLabId(Convert.ToInt32(txtLabId.Text));
            PatientResponseModel patientResponse = xDb.GetPatientFromPatientId(labResponse.PatientId);
            DoctorResponseModel  doctorResponse  = xDb.GetDoctorFromDoctorId(labResponse.DoctorId);

            txtBillDate.Text    = labResponse.BillDate.ToString();
            txtPatientId.Text   = patientResponse.PatientId.ToString();
            txtPatientName.Text = patientResponse.PatientName.ToString();
            txtUhid.Text        = patientResponse.UHID.ToString();
            txtDoctorName.Text  = doctorResponse.DoctorName;

            string xQry = "select bld.lab_id,bld.test_id,ltf.test_name as TestName, " +
                          " ltf.test_description as TestDescription, " +
                          " bld.patient_test_details as PatientTestDetails  " +
                          " from billing_lab_details bld, " +
                          " m_lab_test_fees ltf, billing_lab bl" +
                          " where bld.test_id = ltf.lab_test_fees_id " +
                          " and bl.lab_id = bld.lab_id and bld.lab_id= " + txtLabId.Text;

            xDb.LoadGrid(xQry, dataGridView1);
            dataGridView1.Columns[0].Visible = false;
            dataGridView1.Columns[1].Visible = false;
            dataGridView1.Columns[2].Width   = 200;
            txtLabId.Enabled  = false;
            btnUpdate.Enabled = true;
            btnView.Enabled   = true;
        }
        public PatientResponseModel GetPatientFromPatientId(int xPatientId)
        {
            PatientResponseModel model = new PatientResponseModel();

            using (connection = new MySqlConnection(conString))
            {
                string xQry = "select p.patient_id,p.uhid,p.patient_name,p.patient_address from " +
                              " m_patient_registration p " +
                              " where  p.patient_id = " + xPatientId + "";
                connection.Open();
                MySqlCommand comm = new MySqlCommand(xQry, connection);

                MySqlDataReader reader = comm.ExecuteReader();

                while (reader.Read())
                {
                    model = new PatientResponseModel()
                    {
                        PatientId      = Convert.ToInt32(reader.GetInt32(0)),
                        UHID           = reader.GetString(1),
                        PatientName    = reader.GetString(2),
                        PatientAddress = reader.GetString(3)
                    };
                }
                connection.Close();
            }
            return(model);
        }
        private void cmbIPNo_SelectedIndexChanged(object sender, EventArgs e)
        {
            IPDetailModel        ipResponse      = xDb.GetIpDetailsFromIpNo(Convert.ToInt32(cmbIPNo.Text));
            PatientResponseModel patientResponse = xDb.GetPatientFromPatientId(ipResponse.PatientId);
            DoctorResponseModel  doctorResponse  = xDb.GetDoctorFromDoctorId(ipResponse.DoctorId);

            txtPatientName.Text = patientResponse.PatientName.ToString();
            txtDoctorName.Text  = doctorResponse.DoctorName;
            txtCaseType.Text    = xDb.GetCaseTypeNameFromCaseTypeId(ipResponse.CaseTypeId);
        }
示例#4
0
        /// <summary>
        /// პაციენტის შესახებ ინფორმაცია
        /// </summary>
        /// <param name="PatientID"></param>
        /// <returns></returns>
        public async Task <PatientResponseModel> Get(int PatientID)
        {
            var response = new PatientResponseModel();

            using (var connection = new SqlConnection(_connectionStrings.DBConnectionString))
            {
                connection.Open();
                var queryParameters = new DynamicParameters();
                queryParameters.Add("@PatientID", PatientID);
                response = await connection.QuerySingleOrDefaultAsync <PatientResponseModel>("dbo.PatientGet",
                                                                                             queryParameters,
                                                                                             null,
                                                                                             200,
                                                                                             CommandType.StoredProcedure);
            }
            return(response);
        }
        public ActionResult GetPatients()
        {
            var responseModel = new PatientResponseModel();

            responseModel.PatientDetails    = GetPatientDtos();
            responseModel.TestGroups        = testService.GetTestGroups().ToList();
            responseModel.TestTitles        = testService.GetTestTitles().ToList();
            responseModel.Initials          = otherService.GetInitials().ToList();
            responseModel.Genders           = otherService.GetGenders().ToList();
            responseModel.RegistrationTypes = otherService.GetReferredByTypes().ToList();
            responseModel.HdlRegistrations  = dhlRegistrationService.GetDhlRegistrations().HdlRegistrations;
            responseModel.FieldOptions      = maintenanceService.GetFieldOptions().FieldOptions;

            if (responseModel != null)
            {
                return(Ok(GetResponse(ResponseType.OBJECT, ResponseStatusCode.SUCCESS, responseModel)));
            }
            else
            {
                return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "No patients found", "Please register a patient"))));
            }
        }