コード例 #1
0
        public String insertLabT02(LabT02 p, String userId)
        {
            String sql = "", re = "";

            chkNull(p);
            sql = "Insert Into lab_t02 " +
                  "(MNC_REQ_YR,MNC_REQ_NO,MNC_REQ_DAT,MNC_REQ_STS" +
                  ",MNC_LB_CD,MNC_LB_RMK,MNC_LB_COS,MNC_LB_PRI" +
                  ",MNC_LB_RFN, MNC_SPC_SEND_DAT, MNC_SPC_SEND_TM,MNC_STAMP_DAT" +
                  ",MNC_STAMP_TIM,MNC_SPC_TYP,MNC_RESULT_DAT,MNC_RESULT_TIM" +
                  ",MNC_USR_RESULT,MNC_USR_RESULT_REPORT,MNC_USR_RESULT_APPROVE,MNC_CANCEL_STS" +
                  ",MNC_USR_UPD,MNC_SND_OUT_STS,MNC_LB_STS" +
                  ")" +
                  "Values ('" + p.MNC_REQ_YR + "','" + p.MNC_REQ_NO + "','" + p.MNC_REQ_DAT + "','" + p.MNC_REQ_STS + "'" +
                  ",'" + p.MNC_LB_CD + "','" + p.MNC_LB_RMK + "','" + p.MNC_LB_COS + "','" + p.MNC_LB_PRI + "'" +
                  ",'" + p.MNC_LB_RFN + "','" + p.MNC_SPC_SEND_DAT + "','" + p.MNC_SPC_SEND_TM + "',convert(varchar(10), GETDATE(),23)" +
                  ",replace(left(convert(varchar(100),getdate(),108),5),':',''),'" + p.MNC_SPC_TYP + "','" + p.MNC_RESULT_DAT + "','" + p.MNC_RESULT_TIM + "'" +
                  ",'" + p.MNC_USR_RESULT + "','" + p.MNC_USR_RESULT_REPORT + "','" + p.MNC_USR_RESULT_APPROVE + "','" + p.MNC_CANCEL_STS + "'" +
                  ",'" + p.MNC_USR_UPD + "','" + p.MNC_SND_OUT_STS + "','" + p.MNC_LB_STS + "'" +
                  ")";
            try
            {
                re = conn.ExecuteNonQuery(conn.connMainHIS, sql);
                //new LogWriter("d", "PharmacyT02 insertPharmacyT02 sql " + sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
                new LogWriter("e", "LabT02 insertLabT02 " + ex.InnerException);
            }

            return(re);
        }
コード例 #2
0
        public String update(LabOut p, String userId)
        {
            String re  = "";
            String sql = "";
            int    chk = 0;

            chkNull(p);
            sql = "Update " + labo.table + " Set " +
                  " " + labo.lab_code + " = '" + p.lab_code + "'" +
                  "," + labo.lab_name + " = '" + p.lab_name + "'" +
                  "," + labo.patient_fullname + " = '" + p.patient_fullname + "'" +
                  "," + labo.pre_no + " = '" + p.pre_no + "'" +
                  "," + labo.hn + " = '" + p.hn + "'" +
                  "," + labo.vn + " = '" + p.vn + "'" +
                  "," + labo.visit_date + " = '" + p.visit_date + "'" +
                  "," + labo.req_no + " = '" + p.req_no + "'" +
                  "," + labo.date_modi + " = convert(varchar, getdate(), 23)" +
                  "," + labo.user_modi + " = '" + userId + "'" +
                  "Where " + labo.pkField + "='" + p.lab_out_id + "'"
            ;
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
コード例 #3
0
        public String insert(XrayT04 p)
        {
            String sql = "", chk = "";

            try
            {
                chkNull(p);
                sql = "Insert Into " + xrt04.table + "(" + xrt04.MNC_REQ_YR + "," + xrt04.MNC_REQ_NO + "," + xrt04.MNC_REQ_DAT + "," +
                      xrt04.MNC_XR_CD + "," + xrt04.MNC_STS + "," + xrt04.MNC_XR_TYP + "," +
                      xrt04.MNC_GRP_NO + "," + xrt04.MNC_XR_DSC + "," + xrt04.MNC_RES + "," +
                      xrt04.MNC_XR_USR + "," + xrt04.MNC_DOT_DF_CD + "," + xrt04.MNC_DOT_GRP_CD + "," +
                      xrt04.MNC_STAMP_DAT + "," + xrt04.MNC_STAMP_TIM + "" +
                      ") " +
                      "Values('" + p.MNC_REQ_YR + "','" + p.MNC_REQ_NO + "','" + p.MNC_REQ_DAT + "','" +
                      p.MNC_XR_CD + "','" + p.MNC_STS + "','" + p.MNC_XR_TYP + "','" +
                      p.MNC_GRP_NO + "','" + p.MNC_XR_DSC.Replace("'", "''") + "','" + p.MNC_RES.Replace("'", "''") + "','" +
                      p.MNC_XR_USR + "','" + p.MNC_DOT_DF_CD + "','0'," +
                      "convert(VARCHAR(20),getdate(),20),'0'" +
                      ") ";
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);
            }
            catch (Exception ex)
            {
                chk = ex.Message + " " + ex.InnerException;
                new LogWriter("e", "insert Insert  sql " + sql + " ex " + chk);
            }
            return(chk);
        }
コード例 #4
0
        public String insert(DocGroupFM p, String userId)
        {
            String re  = "";
            String sql = "";

            p.active = "1";
            //p.ssdata_id = "";
            int chk = 0;

            chkNull(p);
            sql = "Insert Into " + dfm.table + " (" + dfm.fm_code + "," + dfm.active + "," + dfm.fm_name + "," + dfm.doc_group_sub_id + "" +
                  "," + dfm.status_doc_adminsion + "," + dfm.status_doc_medical + "," + dfm.status_doc_nurse + "," + dfm.status_doc_office + "" +
                  ") " +
                  "Values ('" + p.fm_code.Replace("'", "''") + "','1','" + p.fm_name.Replace("'", "''") + "','" + p.doc_group_sub_id + "' " +
                  ",'" + p.status_doc_adminsion + "','" + p.status_doc_medical + "','" + p.status_doc_nurse + "','" + p.status_doc_office + "' " +
                  ")";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
コード例 #5
0
        public String insertXrayT02(XrayT02 p, String userId)
        {
            String sql = "", re = "";

            chkNull(p);
            sql = "Insert Into xray_t02 " +
                  "(MNC_REQ_YR,MNC_REQ_NO,MNC_REQ_DAT,MNC_REQ_STS" +
                  ",MNC_XR_CD,MNC_XR_RMK,MNC_XR_COS,MNC_XR_PRI" +
                  ",MNC_XR_RFN, MNC_XR_PRI_R, MNC_FLG_K,MNC_STAMP_DAT" +
                  ",MNC_STAMP_TIM,MNC_XR_COS_R,MNC_DOT_CD_DF,MNC_DOT_GRP_CD" +
                  ",MNC_ACT_DAT,MNC_ACT_TIM,MNC_CANCEL_STS,MNC_USR_UPD" +
                  ",MNC_SND_OUT_STS,MNC_XR_STS,status_pacs" +
                  ")" +
                  "Values ('" + p.MNC_REQ_YR + "','" + p.MNC_REQ_NO + "','" + p.MNC_REQ_DAT + "','" + p.MNC_REQ_STS + "'" +
                  ",'" + p.MNC_XR_CD + "','" + p.MNC_XR_RMK + "','" + p.MNC_XR_COS + "','" + p.MNC_XR_PRI + "'" +
                  ",'" + p.MNC_XR_RFN + "','" + p.MNC_XR_PRI_R + "','" + p.MNC_FLG_K + "',convert(varchar(10), GETDATE(),23)" +
                  ",replace(left(convert(varchar(100),getdate(),108),5),':',''),'" + p.MNC_XR_COS_R + "','" + p.MNC_DOT_CD_DF + "','" + p.MNC_DOT_GRP_CD + "'" +
                  ",'" + p.MNC_ACT_DAT + "','" + p.MNC_ACT_TIM + "','" + p.MNC_CANCEL_STS + "','" + p.MNC_USR_UPD + "'" +
                  ",'" + p.MNC_SND_OUT_STS + "','" + p.MNC_XR_STS + "','" + p.status_pacs + "'" +
                  ")";
            try
            {
                re = conn.ExecuteNonQuery(conn.connMainHIS, sql);
                //new LogWriter("d", "PharmacyT02 insertPharmacyT02 sql " + sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
                new LogWriter("e", "XrayT02 insertXrayT02 " + ex.InnerException);
            }

            return(re);
        }
コード例 #6
0
        public String updateStatusPACs(String reqno, String reqyr)
        {
            String sql = "", re = "";

            sql = "Update xray_t01 Set status_pacs = '1' Where mnc_req_no = '" + reqno + "' and mnc_req_yr = '" + reqyr + "' ";
            re  = conn.ExecuteNonQuery(conn.connMainHIS, sql);
            return(re);
        }
コード例 #7
0
        public String insert(Patient p)
        {
            String sql = "", chk = "", hn = "";
            long   hn1 = 0;

            try
            {
                chkNull(p);
                //hn = selectHnMax();
                //long.TryParse(hn, out hn1);
                //hn1++;
                //hn = hn1.ToString();
                sql = "Insert Into " + ptt.table + "(" + ptt.MNC_HN_NO + "," + ptt.MNC_HN_YR + "," + ptt.MNC_PFIX_CDT + "," +
                      ptt.MNC_PFIX_CDE + "," + ptt.MNC_FNAME_T + "," + ptt.MNC_LNAME_T + "," +
                      ptt.MNC_FNAME_E + "," + ptt.MNC_LNAME_E + "," + ptt.MNC_AGE + "," +
                      ptt.MNC_BDAY + "," + ptt.MNC_ID_NO + "," + ptt.MNC_SS_NO + "," +

                      ptt.MNC_CUR_ADD + "," + ptt.MNC_CUR_TUM + "," + ptt.MNC_CUR_AMP + "," +
                      ptt.MNC_CUR_CHW + "," + ptt.MNC_CUR_POC + "," + ptt.MNC_CUR_TEL + "," +
                      ptt.MNC_DOM_ADD + "," + ptt.MNC_DOM_TUM + "," + ptt.MNC_DOM_AMP + "," +
                      ptt.MNC_DOM_CHW + "," + ptt.MNC_DOM_POC + "," + ptt.MNC_DOM_TEL + "," +
                      ptt.MNC_REF_NAME + "," + ptt.MNC_REF_ADD + "," + ptt.MNC_REF_TUM + "," +
                      ptt.MNC_REF_AMP + "," + ptt.MNC_REF_CHW + "," + ptt.MNC_REF_POC + "," +
                      ptt.MNC_REF_TEL + "," + ptt.MNC_CUR_MOO + "," + ptt.MNC_DOM_MOO + "," +
                      ptt.MNC_REF_MOO + "," + ptt.MNC_CUR_SOI + "," + ptt.MNC_DOM_SOI + "," +
                      ptt.MNC_REF_SOI + "," + ptt.MNC_FN_TYP_CD + "," + ptt.MNC_ATT_NOTE + "," +

                      ptt.MNC_SEX + "," + ptt.MNC_FULL_ADD + "," + ptt.MNC_STAMP_DAT + "," +
                      ptt.MNC_STAMP_TIM + "," + ptt.MNC_COM_CD + "," + ptt.MNC_COM_CD2 +
                      ") " +
                      "Values((select max(mnc_hn_no) from patient_m01)+1,year(getdate())+543,'" + p.MNC_PFIX_CDT + "','" +
                      p.MNC_PFIX_CDE + "','" + p.MNC_FNAME_T.Replace("'", "''") + "','" + p.MNC_LNAME_T.Replace("'", "''") + "','" +
                      p.MNC_FNAME_E.Replace("'", "''") + "','" + p.MNC_LNAME_E.Replace("'", "''") + "','" + p.MNC_AGE + "','" +
                      p.MNC_BDAY + "','" + p.MNC_ID_NO + "','" + p.MNC_SS_NO + "','" +

                      p.MNC_CUR_ADD.Replace("'", "''") + "','" + p.MNC_CUR_TUM + "','" + p.MNC_CUR_AMP + "','" +
                      p.MNC_CUR_CHW + "','" + p.MNC_CUR_POC + "','" + p.MNC_CUR_TEL.Replace("'", "''") + "','" +
                      p.MNC_DOM_ADD.Replace("'", "''") + "','" + p.MNC_DOM_TUM + "','" + p.MNC_DOM_AMP + "','" +
                      p.MNC_DOM_CHW + "','" + p.MNC_DOM_POC + "','" + p.MNC_DOM_TEL + "','" +
                      p.MNC_REF_NAME.Replace("'", "''") + "','" + p.MNC_REF_ADD.Replace("'", "''") + "','" + p.MNC_REF_TUM + "','" +
                      p.MNC_REF_AMP + "','" + p.MNC_REF_CHW + "','" + p.MNC_REF_POC + "','" +
                      p.MNC_REF_TEL.Trim().Replace("'", "''") + "','" + p.MNC_CUR_MOO.Replace("หมู่ที่", "").Trim().Replace("'", "''") + "','" + p.MNC_DOM_MOO.Replace("หมู่ที่", "").Trim().Replace("'", "''") + "','" +
                      p.MNC_REF_MOO.Replace("หมู่ที่", "").Trim().Replace("'", "''") + "','" + p.MNC_CUR_SOI.Trim().Replace("'", "''") + "','" + p.MNC_DOM_SOI.Trim().Replace("'", "''") + "','" +
                      p.MNC_REF_SOI.Trim().Replace("'", "''") + "','" + p.MNC_FN_TYP_CD + "','" + p.MNC_ATT_NOTE.Replace("'", "''") + "','" +

                      p.MNC_SEX + "','" + p.MNC_FULL_ADD.Replace("'", "''") + "',convert(varchar(20), getdate(),23)," +
                      "REPLACE(convert(varchar(5),getdate(),108),':',''),'17352','17352'" +
                      ") ";
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);
                new LogWriter("d", "insert Patient chk " + chk);
            }
            catch (Exception ex)
            {
                chk = ex.Message + " " + ex.InnerException;
                new LogWriter("e", "insert Patient sql " + sql + " ex " + chk);
            }
            return(chk);
        }
コード例 #8
0
        public String insert(PatientSmartcard p, String userId)
        {
            String re  = "";
            String sql = "";

            p.active = "1";
            //p.ssdata_id = "";
            int chk = 0;

            chkNull(p);
            sql = "Insert Into " + pttsc.table + " (" + pttsc.prefixname + "," + pttsc.first_name + "," + pttsc.middle_name + "," + pttsc.last_name + "" +
                  "," + pttsc.first_name_e + "," + pttsc.middle_name_e + "," + pttsc.last_name_e + "," + pttsc.pid + "" +
                  "," + pttsc.dob + "," + pttsc.home_no + "," + pttsc.moo + "," + pttsc.trok + "" +
                  "," + pttsc.soi + "," + pttsc.road + "," + pttsc.district_name + "," + pttsc.amphur_name + "" +
                  "," + pttsc.province_name + "," + pttsc.date_order + "," + pttsc.status_send + "," + pttsc.doc + "" +
                  "," + pttsc.hn + "," + pttsc.hn_year + "," + pttsc.mobile + "," + pttsc.prefixname_e + "" +
                  "," + pttsc.MNC_OCC_CD + "," + pttsc.MNC_EDU_CD + "," + pttsc.MNC_NAT_CD + "," + pttsc.MNC_REL_CD + "" +
                  "," + pttsc.MNC_NATI_CD + "" +
                  "," + pttsc.attach_note + "" +
                  "," + pttsc.sex + "," + pttsc.req_no + "," + pttsc.req_date + "," + pttsc.pre_no + "" +
                  "," + pttsc.visit_date + "" +
                  ") " +
                  "Values ('" + p.prefixname.Replace("'", "''") + "','" + p.first_name.Replace("'", "''") + "','" + p.middle_name.Replace("'", "''") + "','" + p.last_name.Replace("'", "''") + "' " +
                  ",'" + p.first_name_e.Replace("'", "''") + "','" + p.middle_name_e.Replace("'", "''") + "','" + p.last_name_e.Replace("'", "''") + "','" + p.pid + "' " +
                  ",'" + p.dob + "','" + p.home_no.Replace("'", "''") + "','" + p.moo.Replace("'", "''") + "','" + p.trok.Replace("'", "''") + "' " +
                  ",'" + p.soi.Replace("'", "''") + "','" + p.road.Replace("'", "''") + "','" + p.district_name.Replace("'", "''") + "','" + p.amphur_name.Replace("'", "''") + "' " +
                  ",'" + p.province_name.Replace("'", "''") + "','" + p.date_order + "','" + p.status_send + "','" + p.doc + "' " +
                  ",'" + p.hn.Replace("'", "''") + "','" + p.hn_year + "','" + p.mobile + "','" + p.prefixname_e.Replace("'", "''") + "' " +
                  ",'" + p.MNC_OCC_CD.Replace("'", "''") + "','" + p.MNC_EDU_CD + "','" + p.MNC_NAT_CD + "','" + p.MNC_REL_CD + "' " +
                  ",'" + p.MNC_NATI_CD.Replace("'", "''") + "' " +
                  ",'" + p.attach_note.Replace("'", "''") + "' " +
                  ",'" + p.sex + "','" + p.req_no + "','" + p.req_date + "','" + p.pre_no + "' " +
                  ",'" + p.visit_date + "' " +
                  ")";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                //sql = ex.Message + " " + ex.InnerException;
                new LogWriter("d", "PatientSmartcardDB insert ex.InnerException " + ex.InnerException + "\n" + sql);
            }

            return(re);
        }
コード例 #9
0
        public String UpdateTMTCodeOPBKK(String drugcode, String tmtcode)
        {
            String sql = "", chk = "";

            sql = "Update pharmacy_m01 Set " +
                  " tmt_code_opbkk = '" + tmtcode + "' " +
                  "Where mnc_ph_cd ='" + drugcode + "'";
            try
            {
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);
            }
            catch (Exception ex)
            {
            }

            return(chk);
        }
コード例 #10
0
        public String updateDoseDOBAddress1(String id, String address, String dob, String dateInjected)
        {
            String sql = "", chk = "";

            try
            {
                sql = "Update t_reserve_vaccine_dose Set " +
                      "address1 = '" + address.Replace("'", "''") + "' " +
                      ",dob = '" + dob + "' " +
                      ",status_inject = '1' " +
                      ",date_injected = '" + dateInjected + "' " +
                      "Where reserve_vaccine_dose_id = '" + id + "'";
                chk = conn.ExecuteNonQuery(conn.connMySQL, sql);
                //chk = p.RowNumber;
            }
            catch (Exception ex)
            {
                new LogWriter("e", " LabM01DB updateDoseDOB error " + ex.InnerException);
            }
            return(chk);
        }
コード例 #11
0
ファイル: LabExDB.cs プロジェクト: eploentham/bangna_hospital
        private String insert(LabEx p)
        {
            String sql = "", chk = "";

            try
            {
                if (p.Id == "")
                {
                    p.Id = p.getGenID();
                }
                //p.monthId = "RIGHT('00' + CAST(month(GETDATE()) AS NVARCHAR), 2)";
                //p.yearId = "CAST(year(GETDATE()) AS NVARCHAR)";
                //p.dateCreate = " CAST(year(GETDATE()) AS NVARCHAR)+'-'+ RIGHT('00' + CAST(month(GETDATE()) AS NVARCHAR), 2)+'-'+ RIGHT('00' + CAST(day(GETDATE()) AS NVARCHAR), 2)"
                //    + "' '+ RIGHT('00' + CAST(hour(GETDATE()) AS NVARCHAR), 2)+':'+ RIGHT('00' + CAST(minute(GETDATE()) AS NVARCHAR), 2)+':'+ RIGHT('00' + CAST(second(GETDATE()) AS NVARCHAR), 2)";
                p.RowNumber = selectMaxRowNumber(p.YearId);
                p.Active    = "1";
                sql         = "Insert Into " + labex.table + "(" + labex.pkField + "," + labex.Active + "," + labex.Description + "," +
                              labex.Hn + "," + labex.LabDate + "," + labex.LabExDate + "," +
                              labex.PatientName + "," + labex.Remark + "," + labex.RowNumber + "," +
                              labex.VisitDate + "," + labex.VisitTime + "," + labex.Vn + "," +
                              labex.YearId + "," + labex.DoctorId + "," + labex.LabTime + "," +
                              labex.ReqNo + "," + labex.DoctorName + ") " +
                              "Values('" + p.Id + "','" + p.Active + "','" + p.Description + "','" +
                              p.Hn + "','" + p.LabDate + "','" + p.LabExDate + "','" +
                              p.PatientName + "','" + p.Remark + "','" + p.RowNumber + "','" +
                              p.VisitDate + "','" + p.VisitTime + "','" + p.Vn + "','" +
                              p.YearId + "','" + p.DoctorId + "','" + p.LabTime + "','" +
                              p.ReqNo + "','" + p.DoctorName + "') ";
                chk = conn.ExecuteNonQuery(sql);
                //chk = p.RowNumber;
                chk = p.Id;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex.ToString(), "insert LabEx");
            }
            return(chk);
        }
コード例 #12
0
        public String insertPharmacyT02(PharmacyT02 p, String userId)
        {
            String sql = "", re = "";

            chkNull(p);
            sql = "Insert Into pharmacy_t02 " +
                  "(MNC_DOC_CD,MNC_REQ_YR,MNC_REQ_NO,MNC_PH_CD" +
                  ",MNC_PH_QTY,MNC_PH_UNTF_QTY,MNC_PH_UNT_CD,MNC_PH_DIR_DSC" +
                  ",MNC_PH_PRI, MNC_PH_COS, MNC_SUP_STS,MNC_ORD_NO" +
                  ",MNC_PH_RFN,MNC_PH_DIR_CD,MNC_PH_FRE_CD,MNC_PH_TIM_CD" +
                  ",MNC_PH_CAU,MNC_PH_IND,MNC_FN_CD,MNC_PHA_HID" +
                  ",MNC_PH_FLG,MNC_STAMP_DAT,MNC_STAMP_TIM,MNC_USR_ADD" +
                  ",MNC_USR_UPD,MNC_PH_DIR_TXT,MNC_CANCEL_STS,MNC_PH_REM" +
                  ",MNC_PAY_FLAG,MNC_PH_STS" +
                  ")" +
                  "Values ('" + p.MNC_DOC_CD + "','" + p.MNC_REQ_YR + "','" + p.MNC_REQ_NO + "','" + p.MNC_PH_CD + "'" +
                  ",'" + p.MNC_PH_QTY + "','" + p.MNC_PH_UNTF_QTY + "','" + p.MNC_PH_UNT_CD + "','" + p.MNC_PH_DIR_DSC + "'" +
                  ",'" + p.MNC_PH_PRI + "','" + p.MNC_PH_COS + "','" + p.MNC_SUP_STS + "','" + p.MNC_ORD_NO + "'" +
                  ",'" + p.MNC_PH_RFN + "','" + p.MNC_PH_DIR_CD + "','" + p.MNC_PH_FRE_CD + "','" + p.MNC_PH_TIM_CD + "'" +
                  ",'" + p.MNC_PH_CAU + "','" + p.MNC_PH_IND + "','" + p.MNC_FN_CD + "','" + p.MNC_PHA_HID + "'" +
                  ",'" + p.MNC_PH_FLG + "','" + p.MNC_STAMP_DAT + "','" + p.MNC_STAMP_TIM + "','" + p.MNC_USR_ADD + "'" +
                  ",'" + p.MNC_USR_UPD + "','" + p.MNC_PH_DIR_TXT + "','" + p.MNC_CANCEL_STS + "','" + p.MNC_PH_REM + "'" +
                  ",'" + p.MNC_PAY_FLAG + "','" + p.MNC_PH_STS + "'" +
                  ")";
            try
            {
                re = conn.ExecuteNonQuery(conn.connMainHIS, sql);
                //new LogWriter("d", "PharmacyT02 insertPharmacyT02 sql " + sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
                new LogWriter("e", "PharmacyT02 insertPharmacyT02 " + ex.InnerException);
            }

            return(re);
        }
コード例 #13
0
        public String insert(DocGroupScan p, String userId)
        {
            String re  = "";
            String sql = "";

            p.active = "1";
            //p.ssdata_id = "";
            int chk = 0;

            sql = "Insert Into " + dgs.table + " (" + dgs.doc_group_name + "," + dgs.active + "," + dgs.status_opd + "" +
                  ") " +
                  "Values ('" + p.doc_group_name.Replace("'", "''") + "','1','" + p.status_opd + "'" +
                  ")";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
コード例 #14
0
        public String updateOPBKKCode(String labcode, String opbkkcode)
        {
            String sql = "", chk = "";

            try
            {
                sql = "Update lab_m01 Set " +
                      "ucep_code = '" + opbkkcode + "' " +
                      "Where mnc_lb_cd = '" + labcode + "'";
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);
                //chk = p.RowNumber;
            }
            catch (Exception ex)
            {
                new LogWriter("e", " LabM01DB updateOPBKKCode error " + ex.InnerException);
            }
            return(chk);
        }
コード例 #15
0
        public String updateOPBKKCode(String paidtypeid, String opbkkcode)
        {
            String sql = "", chk = "";

            try
            {
                sql = "Update finance_m02 Set " +
                      "opbkk_inscl ='" + opbkkcode + "' " +
                      "Where mnc_fn_typ_cd ='" + paidtypeid + "'";
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);
                //chk = p.RowNumber;
            }
            catch (Exception ex)
            {
                new LogWriter("e", " FinanceM02DB updateOPBKKCode error " + ex.InnerException);
            }
            return(chk);
        }
コード例 #16
0
        public String updateUcepcode(String paidtypecode, String ucepcode)
        {
            String sql = "", chk = "";

            try
            {
                sql = "Update finance_m01 Set " +
                      "ucep_code ='" + ucepcode + "' " +
                      "Where MNC_FN_CD ='" + paidtypecode + "' ";
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);
                //chk = p.RowNumber;
            }
            catch (Exception ex)
            {
                new LogWriter("e", " finance_m01 updateOPBKKCode error " + ex.InnerException);
            }
            return(chk);
        }
コード例 #17
0
        public String updateOPBKKCode(String dep_no, String sec_no, String div_no, String typ_pt, String opbkkcode)
        {
            String sql = "", chk = "";

            try
            {
                sql = "Update patient_m32 Set " +
                      "opbkk_clinic ='" + opbkkcode + "' " +
                      "Where mnc_md_dep_no ='" + dep_no + "' and mnc_sec_no ='" + sec_no + "' and mnc_div_no ='" + div_no + "' and mnc_typ_pt = '" + typ_pt + "'";
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);
                //chk = p.RowNumber;
            }
            catch (Exception ex)
            {
                new LogWriter("e", " PatientM30DB updateOPBKKCode error " + ex.InnerException);
            }
            return(chk);
        }
コード例 #18
0
        public String updateOPBKKCode(String srcode, String opbkkcode, String ditcode)
        {
            String sql = "", chk = "";

            try
            {
                sql = "Update patient_m30 Set " +
                      "ucep_code ='" + opbkkcode + "' " +
                      ",dit_code ='" + ditcode + "' " +
                      "Where mnc_sr_cd ='" + srcode + "' ";
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);
                //chk = p.RowNumber;
            }
            catch (Exception ex)
            {
                new LogWriter("e", " PatientM30DB updateOPBKKCode error " + ex.InnerException);
            }
            return(chk);
        }
コード例 #19
0
        private String insert(OPDCheckUP p)
        {
            String sql = "", chk = "";

            try
            {
                if (p.Id == "")
                {
                    p.Id = p.getGenID();
                }
                //p.monthId = "RIGHT('00' + CAST(month(GETDATE()) AS NVARCHAR), 2)";
                //p.yearId = "CAST(year(GETDATE()) AS NVARCHAR)";
                //p.dateCreate = " CAST(year(GETDATE()) AS NVARCHAR)+'-'+ RIGHT('00' + CAST(month(GETDATE()) AS NVARCHAR), 2)+'-'+ RIGHT('00' + CAST(day(GETDATE()) AS NVARCHAR), 2)"
                //    + "' '+ RIGHT('00' + CAST(hour(GETDATE()) AS NVARCHAR), 2)+':'+ RIGHT('00' + CAST(minute(GETDATE()) AS NVARCHAR), 2)+':'+ RIGHT('00' + CAST(second(GETDATE()) AS NVARCHAR), 2)";
                //p.RowNumber = selectMaxRowNumber(p.YearId);
                p.Active = "1";
                sql      = "Insert Into " + opdc.table + "(" + opdc.pkField + "," + opdc.ABOGroup + "," + opdc.Active + "," +
                           opdc.Addr1 + "," + opdc.Addr2 + "," + opdc.Sex + "," +
                           opdc.Age + "," + opdc.AllergicOther + "," + opdc.AllergicStatus + "," +
                           opdc.BloodPressure + "," + opdc.Breath + "," + opdc.CBCAtrLyN + "," +
                           opdc.CBCAtrLyR + "," + opdc.CBCAtrLyV + "," + opdc.CBCBasN + "," +
                           opdc.CBCBasR + "," + opdc.CBCBasV + "," + opdc.CBCEosN + "," +
                           opdc.CBCEosR + "," + opdc.CBCEosV + "," + opdc.CBCHbN + "," +
                           opdc.CBCHbR + "," + opdc.CBCHbV + "," + opdc.CBCHctN + "," +
                           opdc.CBCHctR + "," + opdc.CBCHctV + "," + opdc.CBCLyN + "," +
                           opdc.CBCLyR + "," + opdc.CBCLyV + "," + opdc.CBCMchcN + "," +
                           opdc.CBCMchcR + "," + opdc.CBCMchcV + "," + opdc.CBCMchN + "," +
                           opdc.CBCMchR + "," + opdc.CBCMchV + "," + opdc.CBCMcvN + "," +
                           opdc.CBCMcvR + "," + opdc.CBCMcvV + "," + opdc.CBCMonoN + "," +
                           opdc.CBCMonoR + "," + opdc.CBCMonoV + "," + opdc.CBCOtherCellN + "," +
                           opdc.CBCOtherCellR + "," + opdc.CBCOtherCellV + "," + opdc.CBCPlaCntN + "," +
                           opdc.CBCPlaCntR + "," + opdc.CBCPlaCntV + "," + opdc.CBCPLaSmeN + "," +
                           opdc.CBCPlaSmeR + "," + opdc.CBCPlaSmeV + "," + opdc.CBCPmnN + "," +
                           opdc.CBCPmnR + "," + opdc.CBCPmnV + "," + opdc.CBCRBCCntN + "," +
                           opdc.CBCRBCCntR + "," + opdc.CBCRBCCntV + "," + opdc.CBCRBCMorN + "," +
                           opdc.CBCRBCMorR + "," + opdc.CBCRBCMorV + "," + opdc.CBCResult + "," +
                           opdc.CBCSuggest + "," + opdc.CBCWBCCntN + "," + opdc.CBCWBCCntR + "," +
                           opdc.CBCWBCCntV + "," + opdc.CheckDate + "," + opdc.CholN + "," +
                           opdc.CholR + "," + opdc.CholResult + "," + opdc.CholSuggest + "," +
                           opdc.CholV + "," + opdc.CreatiN + "," + opdc.CreatiR + "," +
                           opdc.CreatiResult + "," + opdc.CreatiSuggest + "," + opdc.CreatiV + "," +
                           opdc.FBSN + "," + opdc.FBSR + "," + opdc.FBSResult + "," +
                           opdc.FBSSuggest + "," + opdc.FBSV + "," + opdc.Height + "," +
                           opdc.HistOther + "," + opdc.HistStatus + "," + opdc.HN + "," +
                           opdc.Name + "," + opdc.OROther + "," + opdc.ORStatus + "," +
                           opdc.Phone + "," + opdc.Pulse + "," + opdc.RhGroup + "," +
                           opdc.Sex + "," + opdc.SgotN + "," + opdc.SgotR + "," +
                           opdc.SgotResult + "," + opdc.SgotSuggest + "," + opdc.SgotV + "," +
                           opdc.SgptN + "," + opdc.SgptR + "," + opdc.SgptV + "," +
                           opdc.Tempu + "," + opdc.VN + "," + opdc.Weight +
                           opdc.Result + "," + opdc.Suggest + "," + opdc.PreNo + ") " +
                           "Values('" + p.Id + "','" + p.ABOGroup + "','" + p.Active + "','" +
                           p.Addr1 + "','" + p.Addr2 + "','" + p.Sex + "','" +
                           p.Age + "','" + p.AllergicOther + "','" + p.AllergicStatus + "','" +
                           p.BloodPressure + "','" + p.Breath + "','" + p.CBCAtrLyN + "','" +
                           p.CBCAtrLyR + "','" + p.CBCAtrLyV + "','" + p.CBCBasN + "','" +
                           p.CBCBasR + "','" + p.CBCBasV + "','" + p.CBCEosN + "','" +
                           p.CBCEosR + "','" + p.CBCEosV + "','" + p.CBCHbN + "','" +
                           p.CBCHbR + "','" + p.CBCHbV + "','" + p.CBCHctN + "','" +
                           p.CBCHctR + "','" + p.CBCHctV + "','" + p.CBCLyN + "','" +
                           p.CBCLyR + "','" + p.CBCLyV + "','" + p.CBCMchcN + "','" +
                           p.CBCMchcR + "','" + p.CBCMchcV + "','" + p.CBCMchN + "','" +
                           p.CBCMchR + "','" + p.CBCMchV + "','" + p.CBCMcvN + "','" +
                           p.CBCMcvR + "','" + p.CBCMcvV + "','" + p.CBCMonoN + "','" +
                           p.CBCMonoR + "','" + p.CBCMonoV + "','" + p.CBCOtherCellN + "','" +
                           p.CBCOtherCellR + "','" + p.CBCOtherCellV + "','" + p.CBCPlaCntN + "','" +
                           p.CBCPlaCntR + "','" + p.CBCPlaCntV + "','" + p.CBCPLaSmeN + "','" +
                           p.CBCPlaSmeR + "','" + p.CBCPlaSmeV + "','" + p.CBCPmnN + "','" +
                           p.CBCPmnR + "','" + p.CBCPmnV + "','" + p.CBCRBCCntN + "','" +
                           p.CBCRBCCntR + "','" + p.CBCRBCCntV + "','" + p.CBCRBCMorN + "','" +
                           p.CBCRBCMorR + "','" + p.CBCRBCMorV + "','" + p.CBCResult + "','" +
                           p.CBCSuggest + "','" + p.CBCWBCCntN + "','" + p.CBCWBCCntR + "','" +
                           p.CBCWBCCntV + "','" + p.CheckDate + "','" + p.CholN + "','" +
                           p.CholR + "','" + p.CholResult + "','" + p.CholSuggest + "','" +
                           p.CholV + "','" + p.CreatiN + "','" + p.CreatiR + "','" +
                           p.CreatiResult + "','" + p.CreatiSuggest + "','" + p.CreatiV + "','" +
                           p.FBSN + "','" + p.FBSR + "','" + p.FBSResult + "','" +
                           p.FBSSuggest + "','" + p.FBSV + "','" + p.Height + "','" +
                           p.HistOther + "','" + p.HistStatus + "','" + p.HN + "','" +
                           p.Name + "','" + p.OROther + "','" + p.ORStatus + "','" +
                           p.Phone + "','" + p.Pulse + "','" + p.RhGroup + "','" +
                           p.Sex + "','" + p.SgotN + "','" + p.SgotR + "','" +
                           p.SgotResult + "','" + p.SgotSuggest + "','" + p.SgotV + "','" +
                           p.SgptN + "','" + p.SgptR + "','" + p.SgptV + "','" +
                           p.Tempu + "','" + p.VN + "','" + p.Weight + "','" +
                           p.Result + "','" + p.Suggest + "','" + p.PreNo + "') ";
                chk = conn.ExecuteNonQuery(sql);
                //chk = p.RowNumber;
                chk = p.Id;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex.ToString(), "insert OPDCheckUP");
            }

            return(chk);
        }
コード例 #20
0
        public String insert(DotDfDetail p)
        {
            String sql = "", chk = "";

            try
            {
                chkNull(p);
                sql = "select * from " + dotdfd.table
                      + " Where " + dotdfd.MNC_DOC_CD + "= '" + p.MNC_DOC_CD + "'"
                      + " and " + dotdfd.MNC_DOC_YR + "= '" + p.MNC_DOC_YR + "'"
                      + " and " + dotdfd.MNC_DOC_NO + "= '" + p.MNC_DOC_NO + "'"
                      + " and " + dotdfd.MNC_DOC_DAT + "= '" + p.MNC_DOC_DAT + "'"
                      + " and  " + dotdfd.MNC_FN_CD + "= '" + p.MNC_FN_CD + "'"
                      + " and " + dotdfd.MNC_FN_DAT + "= '" + p.MNC_FN_DAT + "'"
                      + " and " + dotdfd.MNC_HN_NO + "= '" + p.MNC_HN_NO + "'"
                      + " and " + dotdfd.MNC_HN_YR + "= '" + p.MNC_HN_YR + "'"
                      + " and  " + dotdfd.MNC_PRE_NO + "= '" + p.MNC_PRE_NO + "'"
                      + " and " + dotdfd.MNC_DATE + "= '" + p.MNC_DATE + "'";
                DataTable dt = conn.selectData(conn.connMainHIS, sql);
                if (dt.Rows.Count > 0)
                {
                    return("");
                }

                sql = "Delete from " + dotdfd.table
                      + " Where " + dotdfd.MNC_DOC_CD + "= '" + p.MNC_DOC_CD + "'"
                      + " and " + dotdfd.MNC_DOC_YR + "= '" + p.MNC_DOC_YR + "'"
                      + " and " + dotdfd.MNC_DOC_NO + "= '" + p.MNC_DOC_NO + "'"
                      + " and " + dotdfd.MNC_DOC_DAT + "= '" + p.MNC_DOC_DAT + "'"
                      + " and  " + dotdfd.MNC_FN_CD + "= '" + p.MNC_FN_CD + "'"
                      + " and " + dotdfd.MNC_FN_DAT + "= '" + p.MNC_FN_DAT + "'"
                      + " and " + dotdfd.MNC_HN_NO + "= '" + p.MNC_HN_NO + "'"
                      + " and " + dotdfd.MNC_HN_YR + "= '" + p.MNC_HN_YR + "'"
                      + " and  " + dotdfd.MNC_PRE_NO + "= '" + p.MNC_PRE_NO + "'"
                      + " and " + dotdfd.MNC_DATE + "= '" + p.MNC_DATE + "'"
                      + " and " + dotdfd.status_insert_manual + "= '1' ";
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);

                sql = "Insert Into " + dotdfd.table + "(" + dotdfd.MNC_DOC_CD + "," + dotdfd.MNC_DOC_YR + "," + dotdfd.MNC_DOC_NO + "," +
                      dotdfd.MNC_DOC_DAT + "," + dotdfd.MNC_FN_CD + "," + dotdfd.MNC_FN_NO + "," +
                      dotdfd.MNC_FN_DAT + "," + dotdfd.MNC_DF_DATE + "," + dotdfd.MNC_FN_TYP_DESC + "," +
                      dotdfd.MNC_DF_AMT + "," + dotdfd.MNC_FN_AMT + "," + dotdfd.MNC_DATE + "," +
                      dotdfd.MNC_TIME + "," + dotdfd.MNC_HN_NO + "," + dotdfd.MNC_HN_YR + "," +
                      dotdfd.MNC_AN_NO + "," + dotdfd.MNC_AN_YR + "," + dotdfd.MNC_PAT_NAME + "," +
                      dotdfd.MNC_PRE_NO + "," + dotdfd.MNC_FN_TYP_CD + "," + dotdfd.MNC_DOT_CD_DF + "," +
                      dotdfd.MNC_DOT_GRP_CD + "," + dotdfd.MNC_DOT_NAME + "," + dotdfd.MNC_PAY_FLAG + "," +
                      dotdfd.MNC_DF_GROUP + "," + dotdfd.MNC_PAY_TYP + "," + dotdfd.MNC_PAY_RATE + "," +
                      dotdfd.status_insert_manual +
                      ") " +
                      "Values('" + p.MNC_DOC_CD + "','" + p.MNC_DOC_YR + "','" + p.MNC_DOC_NO + "','" +
                      p.MNC_DOC_DAT + "','" + p.MNC_FN_CD + "','" + p.MNC_FN_NO + "','" +
                      p.MNC_FN_DAT + "','" + p.MNC_DF_DATE.Replace("'", "''") + "','" + p.MNC_FN_TYP_DESC.Replace("'", "''") + "','" +
                      p.MNC_DF_AMT + "','" + p.MNC_FN_AMT + "','" + p.MNC_DATE + "','" +
                      p.MNC_TIME + "','" + p.MNC_HN_NO + "','" + p.MNC_HN_YR + "','" +
                      p.MNC_AN_NO + "','" + p.MNC_AN_YR + "','" + p.MNC_PAT_NAME + "','" +
                      p.MNC_PRE_NO + "','" + p.MNC_FN_TYP_CD + "','" + p.MNC_DOT_CD_DF + "','" +
                      p.MNC_DOT_GRP_CD + "','" + p.MNC_DOT_NAME + "','" + p.MNC_PAY_FLAG + "','" +
                      p.MNC_DF_GROUP + "','" + p.MNC_PAY_TYP + "','" + p.MNC_PAY_RATE + "','1'" +
                      ") ";
                chk = conn.ExecuteNonQuery(conn.connMainHIS, sql);
            }
            catch (Exception ex)
            {
                chk = ex.Message + " " + ex.InnerException;
                new LogWriter("e", "insert Insert  sql " + sql + " ex " + chk);
            }
            return(chk);
        }