예제 #1
0
        private void button_change_pres_Click(object sender, EventArgs e)
        {
            if (comboBox_presId.SelectedIndex == -1)
            {
                return;
            }
            PrescriptionForm    pf     = new PrescriptionForm();
            PermissibleValueObj presId = new PermissibleValueObj(comboBox_presId.SelectedItem.ToString(), comboBox_presId.SelectedItem.ToString());

            pf.setPresId(ref presId);
            pf.setPatId(int.Parse(textBox_patId.Text));
            pf.ShowDialog();
        }
예제 #2
0
        private void addDrugToDGV(PermissibleValueObj drug)
        {
            DataGridViewRow row = new DataGridViewRow();

            row.CreateCells(DGV_selected);

            /*foreach (DataGridViewRow r in DGV_selected.Rows)
             * {
             *  if (((String)r.Cells[1].Value) == drug.getValue())
             *  {
             *      MessageBox.Show("此藥已在藥單上", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
             *      return;
             *  }
             * }*/
            if (isExistInDGV_selected(drug.getValue(), drug.getName()))
            {
                return;
            }
            row.Cells[1].Value = drug.getValue();
            row.Cells[2].Value = drug.getName();
            List <PermissibleValueObj> units = drugMgr.getPermissibleUnitForDrug(drug.getValue().Split(new String[] { "||" }, StringSplitOptions.None)[0]);

            foreach (PermissibleValueObj o in units)
            {
                ((DataGridViewComboBoxCell)row.Cells[4]).Items.Add(o.getName());
            }
            if (((DataGridViewComboBoxCell)row.Cells[4]) != null)
            {
                if (((String)((DataGridViewComboBoxCell)row.Cells[4]).Items[0]) == "分")
                {
                    ((DataGridViewComboBoxCell)row.Cells[4]).Value = ((DataGridViewComboBoxCell)row.Cells[4]).Items[1];
                }
                else
                {
                    ((DataGridViewComboBoxCell)row.Cells[4]).Value = ((DataGridViewComboBoxCell)row.Cells[4]).Items[0];
                }
            }

            List <String> methodDesc = methods.Keys.ToList();

            foreach (String m in methodDesc)
            {
                ((DataGridViewComboBoxCell)row.Cells[5]).Items.Add(m);
            }
            if (((DataGridViewComboBoxCell)row.Cells[5]) != null)
            {
                ((DataGridViewComboBoxCell)row.Cells[5]).Value = ((DataGridViewComboBoxCell)row.Cells[5]).Items[(((DataGridViewComboBoxCell)row.Cells[5]).Items.Count > 1?1:0)];
            }

            DGV_selected.Rows.Add(row);
        }
 private void button_addFromFreeText_Click(object sender, EventArgs e)
 {
     textBox_freeText.Text = textBox_freeText.Text.Trim().Replace(" ", "").Replace(" ", "").Replace(";", ";");
     String[] freeTextEx = textBox_freeText.Text.Split(new String[] { ";" }, StringSplitOptions.None);
     foreach (String s in freeTextEx)
     {
         PermissibleValueObj objToBeAdded = new PermissibleValueObj(s, "FreeText");
         if (!checkDuplication(objToBeAdded))
         {
             listBox_selectedDiffResult.Items.Add(objToBeAdded);
         }
     }
     textBox_freeText.Clear();
 }
예제 #4
0
        private void button_add_pres_Click(object sender, EventArgs e)
        {
            PrescriptionForm    pf     = new PrescriptionForm();
            PermissibleValueObj presId = new PermissibleValueObj("", "");

            pf.setPresId(ref presId);
            pf.setPatId(int.Parse(textBox_patId.Text));
            pf.ShowDialog();
            comboBox_presId.Items.Add(presId);
            if (comboBox_presId.Items.Count > 0)
            {
                comboBox_presId.SelectedIndex = comboBox_presId.Items.Count - 1;
            }
        }
예제 #5
0
        private void button_patDataUpdate_Click(object sender, EventArgs e)
        {
            //input validation
            if (!patientRegistration1.input_validation())
            {
                return;
            }

            if (Login.user == null)
            {
                PermissibleValueObj pwChkStatus = new PermissibleValueObj("", "0");
                PatientPwChk        patPwChk    = new PatientPwChk();
                patPwChk.setPatIdSuccessFlag(pat.PatientId, ref pwChkStatus);
                patPwChk.ShowDialog();
                if (pwChkStatus.Value == "0")
                {
                    return;
                }
            }

            String     statusMsg = "";
            PatientMgr patMgr    = new PatientMgr();

            bool isSuccess;

            if (Login.user == null)
            {
                isSuccess = patMgr.amdPatientRecordByPatient(pat.PatientId, patientRegistration1.getChiName(), Utilities.stringDataParse4SQL(patientRegistration1.getEngName()), (patientRegistration1.getPlainTextPassword().Trim().Length > 0 ? patientRegistration1.getHashedPassword() : ""), patientRegistration1.getPIDDocType(), patientRegistration1.getPIDDocNo(), patientRegistration1.getPhoneNo(), patientRegistration1.getDOB(), patientRegistration1.getSex(), patientRegistration1.getIsG6PD(), Utilities.stringDataParse4SQL(patientRegistration1.getAddr().Trim()), patientRegistration1.getAllergicDrugsIdString(), patientRegistration1.getIsPregnant(), patientRegistration1.getIsRecordShared(), ref statusMsg);
            }
            else
            {
                isSuccess = patMgr.amdPatientRecord(pat.PatientId, patientRegistration1.getChiName(), Utilities.stringDataParse4SQL(patientRegistration1.getEngName()), (patientRegistration1.getPlainTextPassword().Trim().Length > 0 ? patientRegistration1.getHashedPassword() : ""), patientRegistration1.getPIDDocType(), patientRegistration1.getPIDDocNo(), patientRegistration1.getPhoneNo(), patientRegistration1.getDOB(), patientRegistration1.getSex(), patientRegistration1.getIsG6PD(), Utilities.stringDataParse4SQL(patientRegistration1.getAddr().Trim()), patientRegistration1.getAllergicDrugsIdString(), patientRegistration1.getIsDeceased(), patientRegistration1.getIsPregnant(), patientRegistration1.getIsRecordShared(), ref statusMsg);
            }
            if (isSuccess)
            {
                MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                pat = null;
                patientRegistration1.reset();
                searchPatientInputPanel1.reset();
            }
            else
            {
                MessageBox.Show(statusMsg, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #6
0
        private void button_selectIncompatibleDrug_Click(object sender, EventArgs e)
        {
            PermissibleValueObj DSPselectedDrug = DSP_incompatibleWith.getSelectedDrug();

            if (DSPselectedDrug != null)
            {
                if (DSPselectedDrug.Value == selectedDrug.Value)
                {
                    MessageBox.Show("同一藥物必能配伍", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                foreach (PermissibleValueObj drug in listBox_selectedIncompatibleDrug.Items)
                {
                    if (DSPselectedDrug.Value == drug.Value)
                    {
                        MessageBox.Show("此項目已被選擇", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                }
                listBox_selectedIncompatibleDrug.Items.Add(DSPselectedDrug);
                //DSP_allergic.refresh();
            }
        }
예제 #7
0
 private void button_selectPatient_Click(object sender, EventArgs e)
 {
     pat = searchPatientInputPanel1.getSelectedPatient();
     if (pat == null)
     {
         return;
     }
     if (Login.user == null)
     {
         PermissibleValueObj pwChkStatus = new PermissibleValueObj("", "0");
         PatientPwChk        patPwChk    = new PatientPwChk();
         patPwChk.setPatIdSuccessFlag(pat.PatientId, ref pwChkStatus);
         patPwChk.ShowDialog();
         if (pwChkStatus.Value == "0")
         {
             pat = null;
             return;
         }
     }
     patientRegistration1.Enabled = false;
     patientRegistration1.setPatientData(pat);
     patientRegistration1.Enabled = true;
 }
예제 #8
0
 public void setPatIdSuccessFlag(int patId, ref PermissibleValueObj isChkSuccess)
 {
     this.patId        = patId;
     this.isChkSuccess = isChkSuccess;
 }