Example #1
0
        public DataTable SelectAll()
        {
            DataTable dt = new DataTable();

            String sql = "select * " +
                         "From lab_m01  ";

            dt = conn.selectData(sql);
            //new LogWriter("d", "SelectHnLabOut1 sql "+sql);
            return(dt);
        }
Example #2
0
        public DataTable SelectAll()
        {
            DataTable dt = new DataTable();

            String sql = "select * " +
                         "From finance_m01  " +
                         //"Where MNC_FN_TYP_STS = 'Y' " +
                         "Order By MNC_FN_CD";

            dt = conn.selectData(sql);
            //new LogWriter("d", "SelectHnLabOut1 sql "+sql);MNC_DEF_DSC
            return(dt);
        }
        public DataTable selectAll()
        {
            DataTable dt  = new DataTable();
            String    sql = "select * " +
                            "From " + dgs.table + " dgs " +
                            //"Left Join f_patient_prefix pfx On stf.prefix_id = pfx.f_patient_prefix_id " +
                            " Where dgs." + dgs.active + " ='1' " +
                            "Order By doc_group_id ";

            dt = conn.selectData(conn.conn, sql);

            return(dt);
        }
        public DataTable selectAll()
        {
            DataTable dt  = new DataTable();
            String    sql = "select dfm.*, dgss.doc_group_sub_name " +
                            "From " + dfm.table + " dfm " +
                            "Left Join doc_group_sub_scan dgss On dfm.doc_group_sub_id = dgss.doc_group_sub_id " +
                            " Where dfm." + dfm.active + " ='1' " +
                            "Order By dfm.fm_code ";

            dt = conn.selectData(conn.conn, sql);

            return(dt);
        }
        public DataTable SelectAll()
        {
            DataTable dt = new DataTable();

            String sql = "select * " +
                         "From b_patient_smartcard  " +
                         //"Where MNC_FN_TYP_STS = 'Y' " +
                         "Order By patient_smartcard_id desc";

            dt = conn.selectData(conn.conn, sql);
            //new LogWriter("d", "SelectHnLabOut1 sql "+sql);MNC_DEF_DSC
            return(dt);
        }
Example #6
0
        public DataTable selectLabM01By(String labcode)
        {
            DataTable dt  = new DataTable();
            String    sql = "select * " +
                            "From LAB_M01 " +
                            //"Left Join f_patient_prefix pfx On stf.prefix_id = pfx.f_patient_prefix_id " +
                            "Where MNC_LB_CD ='" + labcode + "'  " +
                            "Order By MNC_LB_CD ";

            dt = conn.selectData(conn.connMainHIS, sql);

            return(dt);
        }
        public DataTable selectAllDeptUS()
        {
            DataTable dt  = new DataTable();
            String    sql = "select dgss.*, dgs.doc_group_name " +
                            "From " + dgss.table + " dgss " +
                            "Left Join doc_group_scan dgs On dgs.doc_group_id = dgss.doc_group_id " +
                            " Where dgss." + dgss.active + " ='1' and dept_us = '1' " +
                            "Order By dgss.doc_group_id, dgss.doc_group_sub_id ";

            dt = conn.selectData(conn.conn, sql);

            return(dt);
        }
        public DataTable SelectAll()
        {
            DataTable dt = new DataTable();

            String sql = "select * " +
                         "From finance_m02  " +
                         "Where MNC_FN_TYP_STS = 'Y' " +
                         "Order By mnc_fn_typ_cd";

            dt = conn.selectData(sql);
            //new LogWriter("d", "SelectHnLabOut1 sql "+sql);
            return(dt);
        }
Example #9
0
        public DataTable selectResultByAccessNumber(String acc)
        {
            ResOrderTab cop1 = new ResOrderTab();
            DataTable   dt   = new DataTable();
            String      sql  = "select * " +
                               "From " + rpttc.table + " rpttc " +
                               //"Left Join f_patient_prefix pfx On stf.prefix_id = pfx.f_patient_prefix_id " +
                               "Where rpttc." + rpttc.AccessNumber + " ='" + acc + "' " +
                               " ";

            dt = conn.selectData(conn.conn, sql);

            return(dt);
        }
        public OPDCheckUP selectByPk(String id)
        {
            OPDCheckUP item = new OPDCheckUP();
            String     sql  = "";
            DataTable  dt   = new DataTable();

            sql = "Select * From " + opdc.table + " Where " + opdc.pkField + "='" + id + "'";
            dt  = conn.selectData(sql);
            if (dt.Rows.Count > 0)
            {
                item = setData(item, dt);
            }
            return(item);
        }
        public DataTable SelectAll()
        {
            DataTable dt = new DataTable();

            String sql = "select pm01.*, pm05.mnc_ph_pri01, pm05.mnc_ph_pri02, pm05.mnc_ph_pri03 " +
                         "From pharmacy_m01 pm01 " +
                         "inner join pharmacy_m05 pm05 on pm01.mnc_ph_cd = pm05.mnc_ph_cd " +
                         //"Where MNC_FN_TYP_STS = 'Y' " +
                         "Order By pm01.MNC_PH_CD";

            dt = conn.selectData(conn.connMainHIS, sql);
            //new LogWriter("d", "SelectHnLabOut1 sql "+sql);
            return(dt);
        }
Example #12
0
        public DataTable SelectDepartment()
        {
            DataTable dt = new DataTable();

            String sql = "Select pttm32.mnc_md_dep_no, pttm32.mnc_md_dep_dsc, pttm32.mnc_sec_no " +
                         "From Patient_m32 pttm32 " +
                         " " +
                         "where MNC_DP_NO in ('111','302','OPE','ERI','XRY','W7A','CCU','W5W','ICU','WNS','W6A','W5M') " +

                         "Order By mnc_md_dep_dsc ";

            dt = conn.selectData(sql);

            return(dt);
        }
Example #13
0
        public DataTable selectSummaryOPD(String hn, String hnyr, String vn, String vsdate)
        {
            DataTable dt = new DataTable();
            String    sql = "", whereAn = "";

            sql = "Select tem02.*, tem01.mnc_hn_name, tem01.mnc_com_name, tem01.mnc_com_addr, tem01.mnc_age, tem01.mnc_sex,convert(VARCHAR(20), tem01.mnc_doc_dat ,23) as doc_dat, tem02.MNC_def_lev " +
                  ", tem01.MNC_SUM_AMT, tem01.MNC_FN_TYP_CD, tem01.MNC_FN_TYP_DSC,tem01.MNC_COM_NAME, tem01.MNC_DIA_DSC, convert(VARCHAR(20),tem01.MNC_DIS_DAT) as MNC_DIS_DAT, convert(VARCHAR(20),tem01.MNC_ADM_DAT) as MNC_ADM_DAT, convert(VARCHAR(20),tem01.MNC_DIA_DAT) as MNC_DIA_DAT " +
                  "From temporary_m01 tem01 " +
                  "inner join temporary_m02 tem02 on tem01.MNC_DOC_CD = tem02.MNC_DOC_CD and tem01.MNC_DOC_YR = tem02.MNC_DOC_YR and tem01.MNC_DOC_NO = tem02.MNC_DOC_NO and tem01.MNC_DOC_DAT = tem02.MNC_DOC_DAT " +
                  "where tem01.mnc_hn_yr  = '" + hnyr + "' and tem01.mnc_hn_no = '" + hn + "' and tem01.mnc_vn_no = '" + vn + "' and tem01.mnc_doc_dat = '" + vsdate + "'" +
                  "Order By tem02.mnc_ord_by ";
            //}
            dt = conn.selectData(sql);
            return(dt);
        }
Example #14
0
        public DataTable selectLabAll()
        {
            DataTable dt  = new DataTable();
            String    sql = "";

            sql = "Select  lab01.mnc_lb_cd, lab01.mnc_lb_dsc, lab01.mnc_lb_typ_cd, lab01.mnc_lb_grp_cd,lab_m06.MNC_LB_GRP_DSC " +
                  ",lab01.MNC_LB_GRP_CD,lab_m07.MNC_LB_TYP_DSC " +
                  "From  lab_m01 lab01  " +
                  "inner join LAB_M06 on lab01.MNC_LB_GRP_CD = LAB_M06.MNC_LB_GRP_CD " +
                  "inner join LAB_M07 on lab01.MNC_LB_TYP_CD= LAB_M07.MNC_LB_TYP_CD and lab01.MNC_LB_GRP_CD = LAB_M07.MNC_LB_GRP_CD " +

                  " Where lab01.MNC_lb_STS = 'Y'  " +
                  "Order By lab01.mnc_lb_cd";
            dt = conn.selectData(sql);

            return(dt);
        }
Example #15
0
        public DataTable selectDrugAll()
        {
            DataTable dt  = new DataTable();
            String    sql = "";

            sql = "Select  pm01.mnc_ph_cd, pm01.mnc_ph_id, pm01.mnc_ph_ctl_cd, pm01.mnc_ph_tn, pm01.mnc_ph_gn" +
                  ", pm01.mnc_ph_unt_cd, pm01.mnc_ph_grp_cd, pm01.mnc_ph_typ_cd " +
                  ", pm01.mnc_ph_dir_cd, pm04.mnc_ph_dir_dsc, pm01.MNC_PH_CAU_CD, pm11.MNC_PH_CAU_dsc " +
                  "From  pharmacy_m01 pm01 " +
                  "Left join pharmacy_m04 pm04 on pm01.MNC_PH_DIR_CD = pm04.MNC_PH_DIR_CD " +
                  "Left join PHARMACY_M11 pm11 on pm01.MNC_PH_CAU_CD = pm11.MNC_PH_CAU_CD " +
                  "Where pm01.MNC_ph_STS = 'Y' and pm01.mnc_ph_typ_flg = 'P' " +
                  "Order By pm01.mnc_ph_tn";
            dt = conn.selectData(sql);

            return(dt);
        }
Example #16
0
        public Staff selectByUsernameLevelDoctor(String username)
        {
            Staff     cop1 = new Staff();
            DataTable dt   = new DataTable();
            String    sql  = "select stf.mnc_usr_name, stf.mnc_usr_pw, stf.mnc_usr_full,stf.mnc_usr_lev " +
                             "From userlog_m01 stf " +
                             //"Left Join f_patient_prefix pfx On stf.prefix_id = pfx.f_patient_prefix_id " +
                             "Where stf." + stf.username + " ='" + username + " and mnc_usr_lev = '5'  ";

            dt   = conn.selectData(conn.connMainHIS, sql);
            cop1 = setStaff(dt);
            return(cop1);
        }
Example #17
0
        public DataTable SelectAll()
        {
            DataTable dt = new DataTable();

            String sql = "select * " +
                         "From drugcatalog  ";

            dt = conn.selectData(conn.connOPBKK, sql);
            //new LogWriter("d", "SelectHnLabOut1 sql "+sql);
            return(dt);
        }
Example #18
0
        public LabEx selectByPk(String Id)
        {
            LabEx     item = new LabEx();
            String    sql  = "";
            DataTable dt   = new DataTable();

            sql = "Select * From " + labex.table + " Where " + labex.pkField + "='" + Id + "'";
            //lw.WriteLog("LabExDB.selectByPk  sql " + sql);
            //lw.WriteLog("LabExDB.selectByPk  connBua.hostNameBua " + connBua.hostNameBua + " connBua.databaseNameBua " + connBua.databaseNameBua);
            //MessageBox.Show("111111 connBua.databaseNameBua " + connBua.databaseNameBua, "1111111");
            //if (connBua.hostNameBua.Equals(""))
            //{
            //    lw.WriteLog("LabExDB.selectByPk  connBua.hostNameBua if (connBua.hostNameBua.Equals" );
            //    IniFile iniFile = new IniFile("reportbangna.ini");
            //    connBua.databaseNameBua = iniFile.Read("database_name_bua");
            //    connBua.hostNameBua = iniFile.Read("host_name_bua");
            //    connBua.userNameBua = iniFile.Read("user_name_bua");
            //    connBua.passwordBua = iniFile.Read("password_bua");
            //    //MessageBox.Show("connBua.databaseNameBua " + connBua.databaseNameBua, "");
            //    //MessageBox.Show("connBua.hostNameBua " + connBua.hostNameBua, "");
            //    //MessageBox.Show("connBua.hostNameMainHIS " + connBua.hostNameMainHIS, "");
            //    //MessageBox.Show("connBua.hostNameMainHIS " + , "");
            //}

            dt = conn.selectData(sql);
            if (dt.Rows.Count > 0)
            {
                item = setData(item, dt);
            }
            //lw.WriteLog("LabExDB.selectByPk  End connBua.connMainHIS.State " + connBua.connMainHIS.State);
            return(item);
        }
Example #19
0
        public String selectByPk(String reqyr, String reqdate, String reqno, String xrcode)
        {
            DataTable dt = new DataTable();
            String    sql = "", re = "insert";

            sql = "Select * from xray_t04 Where mnc_req_yr = '" + reqyr + "' and mnc_req_no = '" + reqno + "' and mnc_req_dat = '" + reqdate + "' and mnc_xr_cd = '" + xrcode + "'";
            dt  = conn.selectData(sql);
            if (dt.Rows.Count > 0)
            {
                re = "update";
            }
            return(re);
        }
Example #20
0
        public DataTable selectAll()
        {
            DataTable dt  = new DataTable();
            String    sql = "select labB.* " +
                            "From " + queueType.table + " labB " +
                            //"Left Join f_patient_prefix pfx On stf.prefix_id = pfx.f_patient_prefix_id " +
                            //"Where labB." + queueType.active + "='1'  " +
                            "Order By labB. " + queueType.queue_type_name;

            dt = conn.selectData(conn.conn, sql);

            return(dt);
        }
Example #21
0
        public String InsertPrakunM01()
        {
            String    sql = "", cnt = "";
            DataTable dt = new DataTable();

            sql = "Delete from prakun_m01_pop_temp;";
            conn.ExecuteNonQueryLogPage(conn.connMainHIS, sql);
            sql = "insert into prakun_m01_pop_temp (SocialID, Social_Card_no,TitleName,FirstName, LastName,FullName, PrakanCode, Prangnant, StartDate,EndDate,BirthDay,UploadDate,FLAG   ) " +
                  "Select SocialID, Social_Card_no,TitleName,FirstName, LastName,FullName, PrakanCode, Prangnant, StartDate,EndDate,BirthDay,UploadDate,FLAG From prakun_m01_pop ";
            conn.ExecuteNonQueryLogPage(conn.connMainHIS, sql);
            sql = "Select count(1) as cnt from prakun_m01_pop_temp";
            dt  = conn.selectData(conn.connMainHIS, sql);
            if (dt.Rows.Count > 0)
            {
                cnt = dt.Rows[0]["cnt"].ToString();
            }
            return(cnt);
        }
        public DataTable selectReq(String hnyr, String hn, String vsdate, String preno)
        {
            String    sql = "";
            DataTable dt  = new DataTable();

            sql = "Select phart02.*, pharm01.mnc_ph_tn, pharm01.mnc_ph_id, pharm01.mnc_ph_ctl_cd, pharm01.mnc_ph_gn " +
                  ", pharm01.mnc_ph_unt_cd, pharm01.mnc_ph_grp_cd, pharm01.mnc_ph_typ_cd " +
                  ", pharm01.mnc_ph_dir_cd, pm04.mnc_ph_dir_dsc, pharm01.MNC_PH_CAU_CD, pm11.MNC_PH_CAU_dsc,pharm01.mnc_ph_typ_flg " +
                  "From " + pharT02.table + " phart02 " +
                  "inner join pharmacy_t01 phart01 on phart02.mnc_doc_cd = phart01.mnc_doc_cd and phart02.mnc_req_no = phart01.mnc_req_no and phart02.mnc_req_yr = phart01.mnc_req_yr " +
                  "Left Join pharmacy_m01 pharm01 on phart02.mnc_ph_cd = pharm01.mnc_ph_cd  " +
                  "Left join pharmacy_m04 pm04 on pharm01.MNC_PH_DIR_CD = pm04.MNC_PH_DIR_CD " +
                  "Left join PHARMACY_M11 pm11 on pharm01.MNC_PH_CAU_CD = pm11.MNC_PH_CAU_CD " +
                  "Where phart01.mnc_hn_no = '" + hn + "' and phart01.mnc_hn_yr = '" + hnyr + "' and phart01.mnc_pre_no = '" + preno + "' and phart01.mnc_date = '" + vsdate + "' " +
                  "Order By phart02.mnc_ord_no";
            dt = conn.selectData(sql);
            return(dt);
        }
Example #23
0
        public String selectHnMax()
        {
            DataTable dt = new DataTable();
            String    sql = "", re = "";

            sql = "Select max(m01.mnc_hn_no) as hn_no " +
                  "From  patient_m01 m01 ";
            dt = conn.selectData(conn.connMainHIS, sql);
            if (dt.Rows.Count > 0)
            {
                re = dt.Rows[0]["hn_no"].ToString();
            }
            return(re);
        }
Example #24
0
        public DataTable selectVisitStatus1PacsReqByDate(String Date)
        {
            DataTable dt  = new DataTable();
            String    sql = "";

            String[] aa = Date.Split('/');
            //sql = "Select  xr01.*, xr01.MNC_HN_NO,m02.MNC_PFIX_DSC as prefix, " +
            //    "ptt01.MNC_FNAME_T,ptt01.MNC_LNAME_T,ptt01.MNC_AGE,t01.MNC_VN_NO,t01.MNC_VN_SEQ,t01.MNC_VN_SUM, t01.mnc_vn_no, t01.mnc_vn_seq, t01.mnc_vn_sum " +
            //    ",ptt01.mnc_bday, ptt01.mnc_sex, t01.mnc_shif_memo " +
            //    "From  xray_t01 xr01  " +
            //    "Left Join patient_m01 ptt01 on xr01.mnc_hn_no = ptt01.mnc_hn_no and xr01.mnc_hn_yr = ptt01.mnc_hn_yr " +
            //    "Left join patient_m02 m02 on ptt01.MNC_PFIX_CDT = m02.MNC_PFIX_CD " +
            //    " inner join patient_t01 t01 on xr01.MNC_HN_NO = t01.MNC_HN_NO " +
            //    " Where xr01.MNC_req_dat = '" + Date + "' and t01.mnc_sts <> 'C' and xr01.mnc_req_sts <> 'A' and xr01.status_pacs <> '1' ";
            //sql = "Select  xr01.*, xr01.MNC_HN_NO,m02.MNC_PFIX_DSC as prefix, " +
            //    "ptt01.MNC_FNAME_T,ptt01.MNC_LNAME_T,ptt01.MNC_AGE,t01.MNC_VN_NO,t01.MNC_VN_SEQ,t01.MNC_VN_SUM, t01.mnc_vn_no, t01.mnc_vn_seq, t01.mnc_vn_sum " +
            //    ",ptt01.mnc_bday, ptt01.mnc_sex, t01.mnc_shif_memo " +
            //    "From  xray_t01 xr01  " +
            //    "Left Join patient_m01 ptt01 on xr01.mnc_hn_no = ptt01.mnc_hn_no and xr01.mnc_hn_yr = ptt01.mnc_hn_yr " +
            //    "Left join patient_m02 m02 on ptt01.MNC_PFIX_CDT = m02.MNC_PFIX_CD " +
            //    " inner join patient_t01 t01 on xr01.MNC_HN_NO = t01.MNC_HN_NO  and xr01.mnc_hn_yr = t01.mnc_hn_yr " +
            //    " Where t01.MNC_date = '" + Date + "' and t01.mnc_sts <> 'C' and xr01.status_pacs = '0' " +
            //    "Order By xr01.mnc_req_dat, xr01.mnc_req_tim";
            sql = "Select  xr01.mnc_req_yr,xr01.mnc_req_no, xt02.MNC_XR_CD, xr01.mnc_req_dep, xr01.MNC_HN_NO,m02.MNC_PFIX_DSC +' '+ m01.MNC_FNAME_T+' '+m01.MNC_LNAME_T as fullname " +
                  ",m01.MNC_AGE,ptt01.MNC_VN_NO, " +
                  " ptt01.MNC_VN_SEQ,ptt01.MNC_VN_SUM, ptt01.mnc_vn_no,ptt01.mnc_vn_seq, m01.mnc_vn_sum ,convert(VARCHAR(20),m01.mnc_bday,23) as mnc_bday, " +
                  "m01.mnc_sex, ptt01.mnc_shif_memo, xt02.MNC_XR_CD, xm01.MNC_XR_DSC, xr01.MNC_DOT_CD, um01.mnc_usr_full,ptt01.MNC_SEC_NO, pm32.MNC_MD_DEP_DSC, ptt01.mnc_sts, xm01.mnc_xr_grp_cd" +
                  ", xm05.mnc_xr_grp_dsc,convert(VARCHAR(20),xr01.mnc_req_dat,23) as mnc_req_dat1 " +
                  "From  xray_t01 xr01  " +
                  "inner Join patient_m01 m01  on xr01 .mnc_hn_no = m01.mnc_hn_no  " +
                  "inner join patient_m02 m02 on m01.MNC_PFIX_CDT = m02.MNC_PFIX_CD " +
                  "inner join PATIENT_T01 ptt01 on xr01 .mnc_hn_no = ptt01.mnc_hn_no and xr01.MNC_DATE = ptt01.MNC_DATE and xr01 .MNC_PRE_NO = ptt01.MNC_PRE_NO  " +
                  "Left Join xray_t02 xt02 on xr01.MNC_REQ_NO = xt02.MNC_REQ_NO  and xr01.MNC_REQ_YR = xt02.MNC_REQ_YR and xr01.MNC_REQ_DAT = xt02.MNC_REQ_DAT " +
                  " Left Join xray_m01 xm01 on xm01.MNC_XR_CD = xt02.MNC_XR_CD " +
                  " Left Join userlog_m01 um01 on xr01.MNC_DOT_CD = um01.mnc_usr_name " +
                  " Left Join patient_m32 pm32 on ptt01.MNC_SEC_NO = pm32.MNC_SEC_NO " +
                  "Left Join xray_m05 xm05 on xm01.mnc_xr_grp_cd = xm05.mnc_xr_grp_cd " +
                  " Where xr01.MNC_REQ_DAT = '" + Date + "' and xr01.MNC_REQ_STS = 'A' " +
                  "and xt02.status_pacs = '1' " +
                  "Order By xr01.mnc_req_dat, xr01.mnc_req_tim";
            dt = conn.selectData(sql);

            return(dt);
        }