コード例 #1
0
        private void PrepareDocument()
        {
            Patient patient = new PatientData().GetPatientById(_patientid);

            StringBuilder content = new StringBuilder();
            content.Append("<p>");
            content.Append("<b>Patient Name : </b>" + patient.FirstName.ToUpper() + " " + patient.LastName.ToUpper());
            content.Append("<br/>");
            content.Append("<b>Patient Id : </b>" + _patientid.ToString());
            content.Append("<br/>");
            content.Append("<b>Age : </b>" + Utility.GetAgeFromDob(patient.DOB).ToString());
            content.Append("<br/>");
            content.Append("<b>Address : </b>" + patient.Address.ToUpper());
            content.Append("<br/>");
            content.Append("<b>Hospital : </b>");
            content.Append("<br/>");
            content.Append("<b>IP Number : </b>");
            content.Append("<br/>");
            content.Append("<b>Date : </b>");
            content.Append("<br/>");
            content.Append("</p>");


            HtmlFormatProvider provider = new HtmlFormatProvider();
            Telerik.WinControls.RichTextBox.Model.RadDocument document = provider.Import(content.ToString());
            this.docPrintVisit.Document = document;

            this.docPrintVisit.InsertImage((Bitmap)Resources.letterhead);
            docPrintVisit.InsertLineBreak();
            docPrintVisit.InsertLineBreak();
        }
コード例 #2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            List<Patient> patients = new PatientData().GetSearchResult(txtName.Text, Convert.ToInt32(ddlHospital.SelectedValue.ToString()));
            var result = from p in patients
                         select new {
                             Id = p.PatientId,
                             Name = p.FirstName + " " + p.LastName,
                             Age = Utility.GetAgeFromDob(p.DOB),
                             Gender = p.Gender,
                             Mobile = p.Mobile,
                             HomePhone = p.HomePhone,
                             Email = p.Email
                         };


            SearchGrid.DataSource = result;
            SearchGrid.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            SearchGrid.ClearSelection();
        }
コード例 #3
0
        private void PopulatePatient(int patientId)
        {
            Patient patient = new PatientData().GetPatientById(patientId);

            if (patient != null)
            {
                txtFirstName.Text = patient.FirstName;
                txtLastName.Text = patient.LastName;
                txtMiddleName.Text = patient.MiddleName;
                if (patient.Gender.Trim() == "M")
                {
                    chkMale.Checked = true; chkFemale.Checked = false;
                }
                else
                {
                    chkMale.Checked = false; chkFemale.Checked = true;
                }
                txtMobile.Text = patient.Mobile;
                txtPhone.Text = patient.HomePhone;
                txtAddress.Text = patient.Address;
                txtEmail.Text = patient.Email;
                DOB.Value = patient.DOB;

                PopulateData.SelectDropDownItem(ddlHospital, patient.HospitalId.ToString().Trim());
                if (patient.Prefix.Trim() != "")
                    ddlPrefix.FindItemExact(patient.Prefix.Trim(), false).Selected = true;

                txtMedicalIssues.Text = patient.KnownIllness;
                txtAllergies.Text = patient.KnownAllergy;
                txtMedication.Text = patient.Medications;
                txtReferredBy.Text = patient.ReferredBy;
                txtFamilyHistory.Text = patient.FamilyHistory;
                txtSocioStatus.Text = patient.SocioEconomicStatus;
                txtDiet.Text = patient.Diet;
                chkSmoker.Checked = (bool)(patient.IsSmoker == null ? false : patient.IsSmoker);
                txtSmoker.Text = patient.SmokingInfo;
                chkAlchoholic.Checked = (bool)(patient.IsAlchoholic == null ? false : patient.IsAlchoholic);
                txtAlchoholic.Text = patient.AlchoholInfo;
                txtMeicalInsurance.Text = patient.MedicalInsurance;
            }
        }
コード例 #4
0
 private void PrepareDocument()
 {
     this.docPrintPhoto.InsertImage((Bitmap)Resources.letterhead);
     docPrintPhoto.InsertLineBreak();
     docPrintPhoto.InsertLineBreak();
     Patient patient = new PatientData().GetPatientById(Convert.ToInt32(_patientid));
     docPrintPhoto.Insert("Patient Name : " + patient.FirstName.ToUpper() + " " + patient.LastName.ToUpper());
     docPrintPhoto.InsertLineBreak();
     docPrintPhoto.Insert("Patient Id : " + _patientid);
     docPrintPhoto.InsertLineBreak();
     docPrintPhoto.Insert("Age : " + Utility.GetAgeFromDob(patient.DOB).ToString());
     docPrintPhoto.InsertLineBreak();
     docPrintPhoto.Insert("Address : " + patient.Address.ToUpper());
     docPrintPhoto.InsertLineBreak();
     docPrintPhoto.Insert("Hospital : ");
     docPrintPhoto.InsertLineBreak();
     docPrintPhoto.Insert("IP Number : ");
     docPrintPhoto.InsertLineBreak();
     docPrintPhoto.Insert("Surgery : ");
     docPrintPhoto.InsertLineBreak();
     docPrintPhoto.Insert("Date of Surgery : ");
     docPrintPhoto.InsertLineBreak();
 }
コード例 #5
0
        public PatientForm(int patientId)
        {
            InitializeComponent();

            this._patientId = patientId;

            Patient patient = new PatientData().GetPatientById(_patientId);
            this._patientname = patient.FirstName.ToUpper() + " " + patient.LastName.ToUpper();
            this._patientage = Utility.GetAgeFromDob(patient.DOB).ToString();

            new TelerikMetroTheme();
            this.ThemeName = "Panorama";

            this.radPanorama1.ThemeName = "Panorama";
            this.radPanorama1.ScrollingBackground = true;
            this.radPanorama1.PanelImage = Resources.bg_pattern;
            this.radPanorama1.PanoramaElement.BackgroundImagePrimitive.ImageLayout = ImageLayout.Tile;
            this.radPanorama1.SizeChanged += new EventHandler(radTilePanel1_SizeChanged);
            this.radPanorama1.ScrollBarAlignment = HorizontalScrollAlignment.Bottom;
            this.radPanorama1.ScrollBarThickness = 10;
            this.radPanorama1.PanoramaElement.GradientStyle = GradientStyles.Solid;
            this.radPanorama1.PanoramaElement.DrawFill = true;
            this.radPanorama1.PanoramaElement.BackColor = System.Drawing.Color.FromArgb(1, 23, 117);
            this.FormElement.TitleBar.MaxSize = new Size(0, 1);
            this.Text = ConfigurationSettings.AppSettings["ApplicationLabel"].ToString();

            try
            {
                this.PrepareHeader();
                this.PrepareTitleBar();
                //this.PrepareLogo();
                //this.PrepareFooter();
                this.PreparePages();
            }
            catch (Exception x) { string error = x.Message; }
        }
コード例 #6
0
        private void LoadPrescription(int visitid)
        {

            Patient patient = new PatientData().GetPatientById(_patientid);

            StringBuilder content = new StringBuilder();
            content.Append("<p>");
            content.Append("<b>Patient Name : </b>" + patient.FirstName.ToUpper() + " " + patient.LastName.ToUpper());
            content.Append("<br/>");
            content.Append("<b>Patient Id : </b>" + _patientid.ToString());
            content.Append("<br/>");
            content.Append("<b>Age : </b>" + Utility.GetAgeFromDob(patient.DOB).ToString());
            content.Append("<br/>");
            content.Append("<b>Address : </b>" + patient.Address.ToUpper());
            content.Append("<br/>");
            content.Append("<b>Hospital : </b>");
            content.Append("<br/>");
            content.Append("<b>IP Number : </b>");
            content.Append("<br/>");
            content.Append("<b>Date : </b>");
            content.Append("<br/>");
            content.Append("</p>");

            VisitData db = new VisitData();

            PatientVisit visit = db.GetVisitById(visitid);
            if (visit != null)
            {
                content.Append("<p>");

                content.Append("<br/>");
                content.Append("<b>Presenting complaint and relevant history : </b>");
                content.Append("<br/>");
                content.Append(visit.ComplaintHistory);
                content.Append("<br/>");

                content.Append("<br/>");
                content.Append("<b>Clinical findings : </b>");
                content.Append("<br/>");
                content.Append(visit.ExaminationNotes);
                content.Append("<br/>");

                content = AddLabData(db.GetLabData(visitid), content);

                AddImagingData(db.GetImagingData(visitid), content);

                content.Append("<br/>");
                content.Append("<b>Diagnosis : </b>");
                content.Append("<br/>");
                content.Append(visit.Diagnosis);
                content.Append("<br/>");

                AddPrescriptionData(db.GetPrescriptionData(visitid), content);

                content.Append("<br/>");
                content.Append("<b>Other Advise : </b>");
                content.Append("<br/>");
                content.Append(visit.OtherAdvise);
                content.Append("<br/>");

                content.Append("<br/>");
                content.Append("<b>Follow Up Date : </b>");
                content.Append("<br/>");
                if (visit.IsFolowUpRequired)
                {
                    content.Append(visit.FollowUpDate.ToShortDateString());
                }
                content.Append("<br/>");

                content.Append("</p>");
            }

            HtmlFormatProvider provider = new HtmlFormatProvider();
            Telerik.WinControls.RichTextBox.Model.RadDocument document = provider.Import(content.ToString());
            this.docPrintVisit.Document = document;

            this.docPrintVisit.InsertImage((Bitmap)Resources.letterhead);
            docPrintVisit.InsertLineBreak();
            docPrintVisit.InsertLineBreak();
        }
コード例 #7
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            bool result = true;

            try
            {
                int patientid = Convert.ToInt32(lblPatientId.Text);
                Patient patient = new PatientData().GetPatientById(patientid);

                patient.Prefix = ddlPrefix.SelectedItem.Text;
                patient.FirstName = txtFirstName.Text.Trim();
                patient.MiddleName = txtMiddleName.Text.Trim();
                patient.LastName = txtLastName.Text.Trim();
                patient.DOB = DOB.Value;
                patient.Gender = chkMale.Checked ? "M" : "F";
                patient.Address = txtAddress.Text;
                patient.Mobile = txtMobile.Text.Trim();
                patient.HomePhone = txtPhone.Text.Trim();
                patient.Email = txtEmail.Text;
                patient.HospitalId = Convert.ToInt32(ddlHospital.SelectedValue.ToString());

                patient.KnownIllness = txtMedicalIssues.Text;
                patient.KnownAllergy = txtAllergies.Text;
                patient.Medications = txtMedication.Text;
                patient.ReferredBy = txtReferredBy.Text;
                patient.FamilyHistory = txtFamilyHistory.Text;
                patient.SocioEconomicStatus = txtSocioStatus.Text;
                patient.Diet = txtDiet.Text;
                patient.IsSmoker = chkSmoker.Checked;
                patient.SmokingInfo = txtSmoker.Text;
                patient.IsAlchoholic = chkAlchoholic.Checked;
                patient.AlchoholInfo = txtAlchoholic.Text;
                patient.MedicalInsurance = txtMeicalInsurance.Text;

                patient.UpdatedOn = DateTime.Now;

                result = new PatientData().UpdatePatient(patient);
            }
            catch (Exception x)
            {
                FileLogger.LogError(x); MessageBox.Show("Error updating patient : Please contact support"); return;
            }

            if (result)
            {
                MessageBox.Show("Patient successfully updated");
            }
            else
            {
                MessageBox.Show("Error updating patient : Please contact support");
                return;
            }
        }
コード例 #8
0
        private void btnSavePatient_Click(object sender, EventArgs e)
        {
            bool result = true;
            if (txtFirstName.Text.Trim() == "")
            {
                MessageBox.Show("Enter first name"); return;
            }
            try
            {
                Patient patient = new Patient();
                patient.Prefix = ddlPrefix.SelectedItem == null ? "" : ddlPrefix.SelectedItem.Text;
                patient.FirstName = txtFirstName.Text.Trim();
                patient.MiddleName = txtMiddleName.Text.Trim();
                patient.LastName = txtLastName.Text.Trim();
                patient.DOB = DOB.Value;
                patient.Gender = chkMale.Checked ? "M" : "F";
                patient.Address = txtAddress.Text;
                patient.Mobile = txtMobile.Text.Trim();
                patient.HomePhone = txtPhone.Text.Trim();
                patient.Email = txtEmail.Text;
                patient.HospitalId = Convert.ToInt32(ddlHospital.SelectedValue.ToString());
                patient.CreatedOn = DateTime.Now;
                patient.UpdatedOn = DateTime.Now;
                patient.IsSmoker = false;
                patient.IsAlchoholic = false;
                PatientData patientObject = new PatientData();
                _patientid = patientObject.AddPatient(patient);
            }
            catch (Exception x)
            {
                FileLogger.LogError(x); return;
            }

            if (result)
            {
                txtFirstName.Text = "";
                txtLastName.Text = "";
                txtMiddleName.Text = "";
                txtMobile.Text = "";
                txtPhone.Text = "";
                txtAddress.Text = "";
                txtEmail.Text = "";

                //Make Dirctories
                DataFolder.CreatePatientDataFolders(_patientid);

                //Open Patient hub
                new PatientForm(_patientid).ShowDialog();
            }
            else
            {
                btnSavePatient.Visible = true;
                MessageBox.Show("Error adding a patient : Please contact support");
                return;
            }
        }