示例#1
0
        /// <summary>
        /// 创建申请单的报告组【1】
        /// </summary>
        /// <param name="p_strApplyUnitsIDArr"></param>
        /// <returns></returns>
        private void m_mthGenerateAppContent(string[] p_strApplyUnitsIDArr)
        {
            //形成申请单的申请单元
            m_mthGenerateAppApplyUnits(p_strApplyUnitsIDArr);

            if (m_objAppApplyUnits.Count == 0)
            {
                return;
            }


            //创建申请单的报告组
            m_mthGenerateAppReports();

            foreach (clsLIS_AppCheckReport objReport in m_objAppReports)
            {
                clsLisApplMainVO objAppVO = new clsLisApplMainVO();
                clsLIS_App       objApp   = new clsLIS_App(objAppVO, false);

                foreach (clsLIS_AppSampleGroup objSG in objReport.m_ObjAppSampleGroups)
                {
                    for (int i = 0; i < objSG.m_ObjAppUnitArr.Length; i++)
                    {
                        objApp.m_ObjAppApplyUnits.Add(objSG.m_ObjAppUnitArr[i]);
                    }
                }

                m_objApps.Add(objApp);
                objApp.m_ObjAppReports.Add(objReport);
            }
        }
示例#2
0
        private bool CreateApplicationDB(clsLisApplMainVO patientInfo, clsTestApplyItme_VO[] arrChargeInfo, bool isSended, string[] strUnits)
        {
            clsLIS_App objApp      = null;
            ArrayList  arrChargeId = null;
            bool       isConstruct = ConstructAppliction(patientInfo, arrChargeInfo, strUnits, out objApp, out arrChargeId);

            if (!isConstruct)
            {
                return(false);
            }

            this.m_currentApplication = objApp;
            string strMessage = null;

            if (!m_blnSaveApp(out strMessage, m_currentApplication))
            {
                errorMessage = strMessage;
                return(false);
            }

            if (isSended)
            {
                if (!m_blnSendApp(out strMessage, m_currentApplication))
                {
                    errorMessage = strMessage;
                    return(false);
                }
            }

            m_arrResults.Add(GetApplicationResult(objApp, arrChargeId));
            return(true);
        }
示例#3
0
        private bool ConstructAppliction(clsLisApplMainVO p_objPatientInfo, clsTestApplyItme_VO[] p_objChargeInfoArr, string[] strUnits, out clsLIS_App objApp, out ArrayList arrChargeId)
        {
            objApp      = null;
            arrChargeId = null;

            clsGeneratorCheckContent checkContent = new clsGeneratorCheckContent(strUnits);

            if (checkContent.Apps == null)
            {
                return(false);
            }

            //自定义检验申请单参数
            clsLisApplMainVO objMainVO = new clsLisApplMainVO();

            p_objPatientInfo.m_mthCopyTo(objMainVO);

            objApp = new clsLIS_App(objMainVO);
            objApp.m_ObjAppApplyUnits.AddRange(checkContent.AppApplyUnits);
            objApp.m_ObjAppReports.AddRange(checkContent.AppReports);
            objApp.m_ObjDataVO.m_strSampleTypeID = m_mthGetSampleType(strUnits);
            objApp.m_ObjDataVO.m_strSampleType   = new ctlLISSampleTypeComboBox().m_strGetTypeName(objApp.m_ObjDataVO.m_strSampleTypeID);
            objApp.m_ObjDataVO.m_strAppl_Dat     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            arrChargeId = new ArrayList();

            foreach (clsTestApplyItme_VO objTestVO in p_objChargeInfoArr)
            {
                foreach (string strUnit in strUnits)
                {
                    arrChargeId.Add(objTestVO.strPartID);
                    m_unitOrder.Add(objTestVO.m_strItemID, objTestVO.m_strOrderID);
                }
            }

            //如果是微生物标本,则获取医生实际选择的标本类型!
            bool isGermSample = strUnits != null && strUnits.Length == 1 && p_objChargeInfoArr.Length > 0 &&
                                !string.IsNullOrEmpty(objApp.m_ObjDataVO.m_strSampleType) &&
                                objApp.m_ObjDataVO.m_strSampleType.Trim() == "微生物标本";

            if (isGermSample)
            {
                foreach (clsTestApplyItme_VO applyItem in p_objChargeInfoArr)
                {
                    if (applyItem.m_strItemID == strUnits[0])
                    {
                        objApp.m_ObjDataVO.m_strSampleTypeID = applyItem.m_strUsageID;
                        objApp.m_ObjDataVO.m_strSampleType   = new ctlLISSampleTypeComboBox().m_strGetTypeName(objApp.m_ObjDataVO.m_strSampleTypeID);
                    }
                }
            }

            //收费信息
            objApp.m_ObjDataVO.m_strChargeInfo = GetChargeInfo(p_objChargeInfoArr, strUnits);
            //获取检验内容
            objApp.m_ObjDataVO.m_strCheckContent = GetCheckContent(objApp);
            objApp.m_ObjDataVO.m_strOperator_ID  = operatorID;

            return(true);
        }
示例#4
0
        private clsT_OPR_LIS_SAMPLE_VO ConstructSampleVO(clsLisApplMainVO p_objLisApplMainVO, string strBarcode)
        {
            clsT_OPR_LIS_SAMPLE_VO sampleVO = new clsT_OPR_LIS_SAMPLE_VO();

            sampleVO.m_strAPPL_DAT                 = p_objLisApplMainVO.m_strAppl_Dat;
            sampleVO.m_strSEX_CHR                  = p_objLisApplMainVO.m_strSex;
            sampleVO.m_strPATIENT_NAME_VCHR        = p_objLisApplMainVO.m_strPatient_Name;
            sampleVO.m_strPATIENT_SUBNO_CHR        = p_objLisApplMainVO.m_strPatient_SubNO;
            sampleVO.m_strAGE_CHR                  = p_objLisApplMainVO.m_strAge;
            sampleVO.m_strPATIENT_TYPE_CHR         = p_objLisApplMainVO.m_strPatientType;
            sampleVO.m_strDIAGNOSE_VCHR            = p_objLisApplMainVO.m_strDiagnose;
            sampleVO.m_strBEDNO_CHR                = p_objLisApplMainVO.m_strBedNO;
            sampleVO.m_strICD_VCHR                 = p_objLisApplMainVO.m_strICD;
            sampleVO.m_strPATIENTCARDID_CHR        = p_objLisApplMainVO.m_strPatientcardID;
            sampleVO.m_strPATIENTID_CHR            = p_objLisApplMainVO.m_strPatientID;
            sampleVO.m_strAPPL_EMPID_CHR           = p_objLisApplMainVO.m_strAppl_EmpID;
            sampleVO.m_strAPPL_DEPTID_CHR          = p_objLisApplMainVO.m_strAppl_DeptID;
            sampleVO.m_strAPPLICATION_ID_CHR       = p_objLisApplMainVO.m_strAPPLICATION_ID;
            sampleVO.m_strPATIENT_INHOSPITALNO_CHR = p_objLisApplMainVO.m_strPatient_inhospitalno_chr;
            sampleVO.m_strSAMPLE_TYPE_ID_CHR       = p_objLisApplMainVO.m_strSampleTypeID;
            sampleVO.m_strSAMPLETYPE_VCHR          = p_objLisApplMainVO.m_strSampleType;
            sampleVO.m_intSTATUS_INT               = 3;
            sampleVO.m_strQCSAMPLEID_CHR           = "-1";
            sampleVO.m_strSAMPLEKIND_CHR           = "1";
            sampleVO.m_strSAMPLE_ID_CHR            = null;
            sampleVO.m_strSAMPLESTATE_VCHR         = "";
            sampleVO.m_strBARCODE_VCHR             = strBarcode;
            sampleVO.m_strOPERATOR_ID_CHR          = p_objLisApplMainVO.m_strOperator_ID;
            sampleVO.m_strSAMPLING_DATE_DAT        = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            sampleVO.m_strCOLLECTOR_ID_CHR         = null;
            sampleVO.m_strACCEPTOR_ID_CHR          = p_objLisApplMainVO.m_strOperator_ID;
            sampleVO.m_strACCEPT_DAT               = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            return(sampleVO);
        }
示例#5
0
        /// <summary>
        /// 增加-组新的检验申请信息
        /// </summary>
        /// <param name="applMain"></param>
        /// <param name="arrReports"></param>
        /// <param name="arrSamples"></param>
        /// <param name="arrCheckItems"></param>
        /// <param name="arrApplyUnits"></param>
        /// <param name="arrUnitItemRelations"></param>
        /// <returns></returns>
        public long m_lngAddApplyApplication(clsLisApplMainVO applMain, bool isSend,
                                             clsT_OPR_LIS_APP_REPORT_VO[] arrReports,
                                             clsT_OPR_LIS_APP_SAMPLE_VO[] arrSamples,
                                             clsT_OPR_LIS_APP_CHECK_ITEM_VO[] arrCheckItems,
                                             clsT_OPR_LIS_APP_APPLY_UNIT_VO[] arrApplyUnits,
                                             clsLisAppUnitItemVO[] arrUnitItemRelations)
        {
            long             lngRes      = 0;
            clsLisApplMainVO applMainOut = null;

            try
            {
                lngRes = objSvc.m_lngAddNewAppInfo(applMain, out applMainOut, isSend, arrReports, arrSamples, arrCheckItems, arrApplyUnits, arrUnitItemRelations);
                if (lngRes > 0 && applMainOut != null)
                {
                    applMainOut.m_mthCopyTo(applMain);
                }
            }
            catch (Exception ex)
            {
                throw new LisCreateApplyException(string.Format("创建检验申请失败!({0})", ex.Message));
            }

            return(lngRes);
        }
示例#6
0
        private clsAppCollection InitNewApplication(clsLisApplMainVO p_objPatientInfo, clsTestApplyItme_VO[] p_objChargeInfoArr)
        {
            m_arrResults.Clear();

            string[] arrApplyUnitId = GetDifferentUnits(p_objChargeInfoArr);

            bool isUnValid = p_objPatientInfo == null || p_objChargeInfoArr == null || p_objChargeInfoArr.Length == 0 ||
                             arrApplyUnitId == null || arrApplyUnitId.Length == 0;

            if (isUnValid)
            {
                errorMessage = "病人信息为空或者申请单元ID为空!";
                return(null);
            }

            p_objPatientInfo.m_intPStatus_int = 1; //未发送的记录
            p_objPatientInfo.m_intForm_int    = 1;

            clsGeneratorCheckContent generatorCheckContent = new clsGeneratorCheckContent(arrApplyUnitId);
            clsAppCollection         appCollection         = generatorCheckContent.Apps;

            if (appCollection == null)
            {
                return(null);
            }
            return(appCollection);
        }
示例#7
0
        private clsLISAppResults GetApplicationResult(clsLisApplMainVO patientInfo, string[] strUnits)
        {
            clsLISAppResults objResult = new clsLISAppResults();

            objResult.m_StrApplicationID       = patientInfo.m_strAPPLICATION_ID;
            objResult.m_strSampleTypeID        = patientInfo.m_strSampleTypeID;
            objResult.m_strSampleTypeName      = patientInfo.m_strSampleType;
            objResult.m_StrAppCheckContentDesc = patientInfo.m_strCheckContent;

            int applyUnitCount = strUnits.Length;

            objResult.m_ObjApplyUnitIDArr = new string[applyUnitCount];

            List <string> lstOrderId = new List <string>();

            for (int i = 0; i < applyUnitCount; i++)
            {
                objResult.m_ObjApplyUnitIDArr[i] = strUnits[i];
                string[] arrOrder = m_unitOrder.GetValues(strUnits[i]);
                if (arrOrder != null && arrOrder.Length > 0)
                {
                    lstOrderId.AddRange(arrOrder);
                }
            }

            objResult.m_arrOrderId = lstOrderId.ToArray();
            return(objResult);
        }
示例#8
0
        /// <summary>
        /// 批量保存检验编号
        /// </summary>
        internal void m_mthBatchSave()
        {
            List <clsLisApplMainVO> m_lst   = new List <clsLisApplMainVO>();
            clsLisApplMainVO        objTemp = null;
            long lngRes = 0;

            for (int i = 0; i < m_objViewer.m_dgAppList.Rows.Count; i++)
            {
                objTemp = new clsLisApplMainVO();
                objTemp.m_strAPPLICATION_ID = m_objViewer.m_dgAppList.Rows[i].Cells["colApplicationID"].Value.ToString();
                if (m_objViewer.m_dgAppList.Rows[i].Cells["colCheckNum"].Value != null)
                {
                    objTemp.m_strApplication_Form_NO = m_objViewer.m_dgAppList.Rows[i].Cells["colCheckNum"].Value.ToString().Trim();
                }
                m_lst.Add(objTemp);
            }
            if (m_lst.Count <= 0)
            {
                return;
            }
            lngRes = m_objDomain.m_lngUpdateCheckNUM(m_lst.ToArray(), m_objViewer.LoginInfo.m_strEmpID);
            if (lngRes > 0)
            {
                System.Windows.Forms.MessageBox.Show("保存成功");
            }
        }
示例#9
0
        /// <summary>
        /// 查询申请单信息
        /// </summary>
        internal void m_mthQueryAppInfo()
        {
            string m_strBarcode = m_objViewer.m_txtBarcode.Text;

            if (string.IsNullOrEmpty(m_strBarcode))
            {
                return;
            }
            clsLisApplMainVO m_objMainVO = null;
            long             lngRes      = m_objDomain.m_lngQuerySampleInfo(m_strBarcode, out m_objMainVO);

            if (m_objMainVO != null)
            {
                string strCheckNO = null;
                if (m_objViewer.m_dgAppList.Rows.Count > 0)
                {
                    if (m_objViewer.m_dgAppList.Rows[m_objViewer.m_dgAppList.Rows.Count - 1].Cells["colCheckNum"].Value != null)
                    {
                        this.m_objDecoder.m_mthGetNextCheckNO(m_objViewer.m_dgAppList.Rows[m_objViewer.m_dgAppList.Rows.Count - 1].Cells["colCheckNum"].Value.ToString(), out strCheckNO);
                        m_objViewer.m_txtCheckNo.Text = strCheckNO;
                    }
                }
                m_objViewer.m_dgAppList.Rows.Add(new object[] { m_objMainVO.m_strApplication_Form_NO, m_objMainVO.m_strPatient_Name, m_objMainVO.m_strCheckContent, m_objMainVO.m_strAPPLICATION_ID });
                m_objViewer.m_dgAppList.Rows[m_objViewer.m_dgAppList.Rows.Count - 1].Selected = true;
            }
        }
示例#10
0
        private void CreateApplyApplication(clsLisApplMainVO patientInfo, clsTestApplyItme_VO[] unitItems, string[] strUnits, bool isSended)
        {
            InitApplyApplication(unitItems, strUnits, ref patientInfo);

            SaveApplyApplication(patientInfo, strUnits, isSended);

            m_arrResults.Add(GetApplicationResult(patientInfo, strUnits));
        }
示例#11
0
 /// <summary>
 /// 查询申请单信息通过条码号
 /// </summary>
 /// <param name="p_strBarcode"></param>
 /// <param name="p_objMainVO"></param>
 /// <returns></returns>
 public long m_lngQuerySampleInfo(string p_strBarcode, out clsLisApplMainVO p_objMainVO)
 {
     long lngRes = 0;
     clsBatchSaveReportQuerySvc objSvc =
         (clsBatchSaveReportQuerySvc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsBatchSaveReportQuerySvc));
     lngRes = objSvc.m_lngQuerySampleInfo(p_strBarcode, out p_objMainVO);
     return lngRes;
 }
示例#12
0
        private void m_mthReportListAddReport(clsLisApplMainVO p_objAppMainVO)
        {
            ListViewItem lvt = new ListViewItem();

            lvt.Text = p_objAppMainVO.m_strPatient_Name;

            lvt.SubItems.Add(p_objAppMainVO.m_strCheckContent);
            lvt.SubItems.Add(p_objAppMainVO.m_strPatient_inhospitalno_chr);
            lvt.SubItems.Add(p_objAppMainVO.m_strBedNO);

//			com.digitalwave.Utility.ctlDeptTextBox txtDept = new com.digitalwave.Utility.ctlDeptTextBox();
//			txtDept.m_StrDeptID = p_objAppMainVO.m_strAppl_DeptID;
//			string strDeptName = txtDept.m_StrDeptName;
//			lvt.SubItems.Add(strDeptName);
//
//			com.digitalwave.Utility.ctlEmpTextBox txtDoct = new com.digitalwave.Utility.ctlEmpTextBox();
//			txtDoct.m_StrEmployeeID = p_objAppMainVO.m_strAppl_EmpID;
//			string strDoctName = txtDoct.m_StrEmployeeName;
//			lvt.SubItems.Add(strDoctName);
            if (p_objAppMainVO.m_strAppl_DeptID != null && this.m_hasDeptList.ContainsKey(p_objAppMainVO.m_strAppl_DeptID))
            {
                object objDeptName = this.m_hasDeptList[p_objAppMainVO.m_strAppl_DeptID];
                if (objDeptName != null)
                {
                    lvt.SubItems.Add(objDeptName.ToString());
                }
            }
            else
            {
                lvt.SubItems.Add("");
            }
            if (p_objAppMainVO.m_strAppl_EmpID != null && this.m_hasEmployeeList.ContainsKey(p_objAppMainVO.m_strAppl_EmpID))
            {
                object objEmployeeName = this.m_hasEmployeeList[p_objAppMainVO.m_strAppl_EmpID];
                if (objEmployeeName != null)
                {
                    lvt.SubItems.Add(objEmployeeName.ToString());
                }
            }
            else
            {
                lvt.SubItems.Add("");
            }
            lvt.SubItems.Add(p_objAppMainVO.m_strAppl_Dat);
            lvt.SubItems.Add(p_objAppMainVO.m_strReportDate);
            if (p_objAppMainVO.m_intReportStatus == 2)
            {
                lvt.SubItems.Add("√");
            }
            else
            {
                lvt.SubItems.Add("");
            }
            lvt.Tag = p_objAppMainVO;
            this.m_objViewer.m_lsvReportList.Items.Add(lvt);
        }
示例#13
0
 private void SetGermSampleType(ref clsLisApplMainVO patientInfo, clsTestApplyItme_VO[] unitItems, string[] strUnits)
 {
     foreach (clsTestApplyItme_VO applyItem in unitItems)
     {
         if (applyItem.m_strItemID == strUnits[0])
         {
             patientInfo.m_strSampleTypeID = applyItem.m_strUsageID;
             patientInfo.m_strSampleType   = GetSampleTypeName(patientInfo.m_strSampleTypeID);
         }
     }
 }
示例#14
0
 internal void m_mthPrint()
 {
     if (this.m_lsvReportList.SelectedItems.Count != 0)
     {
         if (this.m_lsvReportList.SelectedItems[0].Tag != null)
         {
             clsLisApplMainVO objReport = ((clsLisApplMainVO)this.m_lsvReportList.SelectedItems[0].Tag);
             this.m_objPrinter.m_mthGetPrintContentFromDB(objReport.m_strReportGroupID, objReport.m_strAPPLICATION_ID, true);
             this.m_objPrinter.m_mthPrint();
         }
     }
 }
示例#15
0
        public long m_lngGetApplVO(string orderId, out clsLisApplMainVO applMain)
        {
            long lngRes = 0;

            applMain = null;

            string sql = @"select a.application_id_chr, a.patientid_chr, a.application_dat, a.sex_chr,
                                  a.patient_name_vchr, a.patient_subno_chr, a.age_chr,
                                  a.patient_type_id_chr, a.diagnose_vchr, a.bedno_chr, a.icdcode_chr,
                                  a.patientcardid_chr, a.application_form_no_chr, a.modify_dat,
                                  a.operator_id_chr, a.appl_empid_chr, a.appl_deptid_chr, a.summary_vchr,
                                  a.pstatus_int, a.emergency_int, a.special_int, a.form_int,
                                  a.patient_inhospitalno_chr, a.sample_type_id_chr, a.check_content_vchr,
                                  a.sample_type_vchr, a.oringin_dat, a.charge_info_vchr, a.printed_num,
                                  a.orderunitrelation_vchr, a.printed_date, b.sample_id_chr
                             from t_opr_lis_application a, t_opr_lis_sample b
                            where a.application_id_chr = b.application_id_chr(+)
                              and a.orderunitrelation_vchr like ?
                              and b.status_int > 0";

            try
            {
                DataTable          dtbResult   = new DataTable();
                clsHRPTableService objHRPSvc   = new clsHRPTableService();
                IDataParameter[]   objParamArr = null;
                objHRPSvc.CreateDatabaseParameter(1, out objParamArr);
                objParamArr[0].Value = "%" + orderId + "%";
                lngRes = objHRPSvc.lngGetDataTableWithParameters(sql, ref dtbResult, objParamArr);
                objHRPSvc.Dispose();
                if (lngRes > 0 && dtbResult != null)
                {
                    if (dtbResult.Rows.Count == 0)
                    {
                        // throw new Exception(string.Format("未找到医嘱Id{0}对应的申请单!", orderId));
                    }
                    else if (dtbResult.Rows.Count == 1)
                    {
                        applMain = new clsVOConstructor().m_objConstructAppMainVO(dtbResult.Rows[0]);
                    }
                    else
                    {
                        throw new Exception(string.Format("医嘱Id为{0}对应的不只一个申请单!", orderId));
                    }
                }
            }
            catch (Exception ex)
            {
                new clsLogText().LogError(ex.Message);
                throw ex;
            }

            return(lngRes);
        }
示例#16
0
        private void SaveApplyApplication(clsLisApplMainVO patientInfo, string[] arrUnitIds, bool isSend)
        {
            long lngRes = 0;

            //创建一个新的申请单
            patientInfo.m_strAPPLICATION_ID = string.Empty;

            clsT_OPR_LIS_APP_APPLY_UNIT_VO[] applyUnits;
            clsT_OPR_LIS_APP_CHECK_ITEM_VO[] checkItems;
            clsT_OPR_LIS_APP_SAMPLE_VO[]     samples;
            clsT_OPR_LIS_APP_REPORT_VO[]     reports;
            clsLisAppUnitItemVO[]            unitItems;

            m_unitInfo.GetApplyUnitInfo(arrUnitIds, out applyUnits, out checkItems, out samples, out reports, out unitItems);

            if (patientInfo.m_strPatientType == "2")    // 门诊
            {
                patientInfo.m_intPStatus_int = 2;
                lngRes = clsApplicationBizSmp.s_obj.m_lngAddAppInfoWithoutReceive(patientInfo, reports, samples, checkItems, applyUnits, unitItems);   //取消核收状态
            }
            else
            {
                //4002开关:是否跳过样本的采集和核收
                int intConfig = clsLisSetting.IsSkipCollectionReceive();
                switch (intConfig)
                {
                case 1:
                    patientInfo.m_intPStatus_int = 2;
                    lngRes = 0;
                    lngRes = clsApplicationBizSmp.s_obj.m_lngAddApplicationInfo(patientInfo, reports, samples, checkItems, applyUnits, unitItems);
                    break;

                case 2:       //跳过采集不跳过核收
                    patientInfo.m_intPStatus_int = 2;
                    lngRes = 0;
                    lngRes = clsApplicationBizSmp.s_obj.m_lngAddAppInfoWithoutReceive(patientInfo, reports, samples, checkItems, applyUnits, unitItems);       //取消核收状态
                    break;

                default:
                    lngRes = 0;
                    // lngRes = clsApplicationBizSmp.s_obj.m_lngAddNewAppInfo(patientInfo, reports, samples, checkItems, applyUnits, unitItems);
                    lngRes = clsLisServiceSmp.s_obj.m_lngAddApplyApplication(patientInfo, isSend, reports, samples, checkItems, applyUnits, unitItems);
                    break;
                }
            }

            if (lngRes == 0)
            {
                throw new LisCreateApplyException("申请单保存到数据库失败!");
            }
        }
示例#17
0
        /// <summary>
        /// Show检验申请单
        /// </summary>
        public void m_mthLISApply()
        {
            iCare.DoctorWorkStation.frmChoosePatient frmCP = new iCare.DoctorWorkStation.frmChoosePatient();

            if (MDIParent.s_ObjCurrentPatient == null)
            {
                frmCP.SetPatientInfo = null;
            }
            else
            {
                //frmCP.SetPatientInfo=MDIParent.s_ObjCurrentPatient;
            }

            clsEmrPatient_VO objPatient;

            //if(frmCP.ShowDialog()==DialogResult.No)
            if (frmCP.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            objPatient = frmCP.SetPatientInfo;
            frmCP.Close();
            frmLisAppl obj = new frmLisAppl();

            #region 收费病人基本数据
            clsLisApplMainVO objLMVO = new clsLisApplMainVO();
            objLMVO.m_intEmergency = 0;
            objLMVO.m_intForm_int  = 0;
            objLMVO.m_strAge       = objPatient.m_strMARRIED_CHR;
            //objLMVO.m_strAge=objPatient.m_ObjPeopleInfo.m_StrAge;
            objLMVO.m_strAppl_DeptID  = MDIParent.s_ObjDepartment.m_StrDeptID;
            objLMVO.m_strAppl_EmpID   = MDIParent.strOperatorID;
            objLMVO.m_strDiagnose     = "";
            objLMVO.m_strOperator_ID  = MDIParent.strOperatorID;
            objLMVO.m_strPatient_Name = objPatient.m_strLASTNAME_VCHR;
            //objLMVO.m_strPatient_Name=objPatient.m_StrName;
            objLMVO.m_strPatientcardID = "";
            com.digitalwave.iCare.gui.HIS.clsDcl_ShowReports objSR = new com.digitalwave.iCare.gui.HIS.clsDcl_ShowReports();
            objLMVO.m_strPatientID = objPatient.m_strPATIENTID_CHR;
            //objLMVO.m_strPatientID=objSR.m_mthFindPatientIDByInHospitalNo(objPatient.m_StrInPatientID);
            objLMVO.m_strPatientType = "1";
            objLMVO.m_strSex         = objPatient.m_strSEX_CHR.Trim();
            objLMVO.m_strPatient_inhospitalno_chr = objPatient.m_strINPATIENTID_CHR;
            objLMVO.m_strAge = objPatient.m_strMARRIED_CHR.Trim();
            //objLMVO.m_strSex=objPatient.m_StrSex;
            //objLMVO.m_strPatient_inhospitalno_chr = objPatient.m_StrInPatientID;
            //objLMVO.m_strAge = objPatient.m_ObjPeopleInfo.m_IntAge.ToString();
            obj.m_mthNewApp(objLMVO);
            #endregion
        }
示例#18
0
        /// <summary>
        /// 作废医嘱
        /// </summary>
        /// <param name="orderId">医嘱号</param>
        /// <param name="objSample">样本</param>
        public void GetLisSample(string orderId, ref clsT_OPR_LIS_SAMPLE_VO objSample)
        {
            objSample = null;
            clsLisApplMainVO patientInfo = null;
            long             lngRes      = clsLisServiceSmp.s_obj.m_lngGetApplVO(orderId, out patientInfo);

            if (patientInfo == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(patientInfo.m_strSampleID))
            {
                objSample = GetSample(patientInfo.m_strSampleID);
            }
        }
示例#19
0
        public long m_lngQuerySampleInfo(string p_strBarcode, out clsLisApplMainVO p_objMainVO)
        {
            long   lngRes = 0;
            string strSQL = null;

            p_objMainVO = null;
            clsHRPTableService objHRPSvc = null;

            try
            {
                strSQL = @"select a.patient_name_vchr,
       b.application_form_no_chr,
       b.check_content_vchr,
       b.application_id_chr
  from t_opr_lis_sample a, t_opr_lis_application b
 where a.application_id_chr = b.application_id_chr
   and a.barcode_vchr = ?
   and a.status_int >=3 
   and b.pstatus_int = 2";
                IDataParameter[] objDPArr = null;
                objHRPSvc = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(1, out objDPArr);
                objDPArr[0].Value = p_strBarcode;
                DataTable dtResult = null;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtResult, objDPArr);
                if (lngRes > 0 && dtResult != null && dtResult.Rows.Count > 0)
                {
                    DataRow drTemp = dtResult.Rows[0];
                    p_objMainVO = new clsLisApplMainVO();
                    p_objMainVO.m_strPatient_Name        = drTemp["patient_name_vchr"].ToString().Trim();
                    p_objMainVO.m_strApplication_Form_NO = drTemp["application_form_no_chr"].ToString().Trim();
                    p_objMainVO.m_strCheckContent        = drTemp["check_content_vchr"].ToString().Trim();
                    p_objMainVO.m_strAPPLICATION_ID      = drTemp["application_id_chr"].ToString().Trim();
                }
            }
            catch (Exception objEx)
            {
                clsLogText objLogger = new clsLogText();
                objLogger.LogDetailError(objEx, false);
            }
            finally
            {
                objHRPSvc.Dispose();
                objHRPSvc = null;
            }
            return(lngRes);
        }
示例#20
0
        /// <summary>
        /// 改变急诊状态
        /// </summary>
        /// <param name="p_objApplVO"></param>
        /// <returns></returns>
        public long m_lngChangeEmergency(clsLisApplMainVO p_objApplVO)
        {
            long lngRes = 0;

            try
            {
                lngRes = (new clsDomainController_ApplicationManage()).UpdateEmergencyStatus(p_objApplVO);
                if (lngRes < 0)
                {
                    return(-1);
                }
            }
            catch
            {
            }
            return(lngRes);
        }
示例#21
0
        public long m_lngGetApplVO(string orderId, out clsLisApplMainVO applMain)
        {
            long lngRes = 0;

            applMain = null;

            try
            {
                lngRes = objSvc.m_lngGetApplVO(orderId, out applMain);
            }
            catch (Exception ex)
            {
                throw new LisCreateApplyException(ex.Message);
            }

            return(lngRes);
        }
示例#22
0
        /// <summary>
        /// 新建检验申请单
        /// </summary>
        /// <remarks> </remarks>
        /// <param name="p_objPatientInfo">患者基本信息</param>
        /// <param name="p_objChargeInfoArr">收费信息数组</param>
        /// <param name="p_blnSend">申请单是否发送</param>
        /// <returns>是否创建成功</returns>
        public bool m_mthNewApp(clsLisApplMainVO patientInfo, clsTestApplyItme_VO[] arrChargeInfo, bool isSended)
        {
            clsAppCollection appCollection = InitNewApplication(patientInfo, arrChargeInfo);

            if (appCollection == null)
            {
                return(false);
            }

            ArrayList separatedUnits = SeparateApplication(GetUnitId(appCollection));

            foreach (string[] arrUnit in separatedUnits)
            {
                CreateApplicationDB(patientInfo, arrChargeInfo, isSended, arrUnit);
            }

            return(true);
        }
示例#23
0
 public void m_mthGenerateAppContent()
 {
     m_mthGenerateAppApplyUnits();
     m_mthGenerateAppReports();
     foreach (clsLIS_AppCheckReport objReport in m_objAppReports)
     {
         clsLisApplMainVO objAppVO = new clsLisApplMainVO();
         clsLIS_App       objApp   = new clsLIS_App(objAppVO, false);
         foreach (clsLIS_AppSampleGroup objSG in objReport.m_ObjAppSampleGroups)
         {
             for (int i = 0; i < objSG.m_ObjAppUnitArr.Length; i++)
             {
                 objApp.m_ObjAppApplyUnits.Add(objSG.m_ObjAppUnitArr[i]);
             }
         }
         this.m_objApps.Add(objApp);
         objApp.m_ObjAppReports.Add(objReport);
     }
 }
示例#24
0
        /// <summary>
        /// 修改-组检验申请信息(包含报告组,申请单元,样本组,检验项目在内的全部信息)
        /// </summary>
        /// <param name="applMain"></param>
        /// <param name="arrReports"></param>
        /// <param name="arrSamples"></param>
        /// <param name="arrCheckItems"></param>
        /// <param name="arrApplyUnits"></param>
        /// <param name="arrUnitItemRelations"></param>
        /// <returns></returns>
        public long m_lngModifyAppInfo(clsLisApplMainVO p_objLisApplMainVO,
                                       clsT_OPR_LIS_APP_REPORT_VO[] p_objReportArr,
                                       clsT_OPR_LIS_APP_SAMPLE_VO[] p_objAppSampleArr,
                                       clsT_OPR_LIS_APP_CHECK_ITEM_VO[] p_objAppItemArr,
                                       clsT_OPR_LIS_APP_APPLY_UNIT_VO[] p_objAppUnitArr,
                                       clsLisAppUnitItemVO[] p_objAppUnitItemArr)
        {
            long lngRes = 0;

            try
            {
                lngRes = objSvc.m_lngModifyAppInfo(objPrincipal, p_objLisApplMainVO, p_objReportArr, p_objAppSampleArr, p_objAppItemArr, p_objAppUnitArr, p_objAppUnitItemArr);
            }
            catch
            {
                lngRes = 0;
            }
            return(lngRes);
        }
示例#25
0
文件: clsBIHLis.cs 项目: ewin66/HIS
        public bool m_mthNewApp(clsLisApplMainVO patientInfo, clsTestApplyItme_VO[] unitItems, bool isSend)
        {
            //return inter.m_mthNewApp(p_objPatientInfo, p_objChargeInfoArr, p_blnSend);
            string message;
            string strAge = patientInfo.m_strAge;

            try
            {
                int intAgeNum = 0;
                int idx       = 0;
                if (strAge.Contains("岁"))
                {
                    idx                  = strAge.IndexOf("岁");
                    intAgeNum            = Convert.ToInt32(strAge.Substring(0, idx).Trim());
                    patientInfo.m_strAge = intAgeNum.ToString() + " " + "岁";
                }
                else if (strAge.Contains("月"))
                {
                    idx                  = strAge.IndexOf("月");
                    intAgeNum            = Convert.ToInt32(strAge.Substring(0, idx).Trim());
                    patientInfo.m_strAge = intAgeNum.ToString() + " " + "月";
                }
                else if (strAge.Contains("天"))
                {
                    idx                  = strAge.IndexOf("天");
                    intAgeNum            = Convert.ToInt32(strAge.Substring(0, idx).Trim());
                    patientInfo.m_strAge = intAgeNum.ToString() + " " + "天";
                }
                else if (strAge.Contains("小时"))
                {
                    idx                  = strAge.IndexOf("小时");
                    intAgeNum            = Convert.ToInt32(strAge.Substring(0, idx).Trim());
                    patientInfo.m_strAge = intAgeNum.ToString() + " " + "小时";
                }
            }
            catch
            {
            }
            return(service.CreateApply(patientInfo, unitItems, isSend, out message));
        }
示例#26
0
        /// <summary>
        ///新增检验申请单
        /// </summary>
        /// <param name="objApplMainVO"></param>
        /// <returns></returns>
        public long m_lngAddNewApplication(clsLisApplMainVO objApplMainVO)
        {
            clsLisApplMainVO objOutVO = null;
            long             lngRes   = 0;

            clsApplicationSvc objAppSvc =
                (clsApplicationSvc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsApplicationSvc));

            try
            {
                lngRes = objAppSvc.m_lngAddNewAppl(objPrincipal, objApplMainVO, out objOutVO);
                if (lngRes > 0 && objOutVO != null)
                {
                    objOutVO.m_mthCopyTo(objApplMainVO);
                }
            }
            catch
            {
                lngRes = 0;
            }
            return(lngRes);
        }
示例#27
0
        /// <summary>
        /// 跳过采样不核收4002.status=2
        /// 莫宝健 2007.09.13 add
        /// </summary>
        /// <param name="p_objLisApplMainVO"></param>
        /// <param name="p_objReportArr"></param>
        /// <param name="p_objAppSampleArr"></param>
        /// <param name="p_objAppItemArr"></param>
        /// <param name="p_objAppUnitArr"></param>
        /// <param name="p_objAppUnitItemArr"></param>
        /// <returns></returns>
        public long m_lngAddAppInfoWithoutReceive(clsLisApplMainVO p_objLisApplMainVO,
                                                  clsT_OPR_LIS_APP_REPORT_VO[] p_objReportArr,
                                                  clsT_OPR_LIS_APP_SAMPLE_VO[] p_objAppSampleArr,
                                                  clsT_OPR_LIS_APP_CHECK_ITEM_VO[] p_objAppItemArr,
                                                  clsT_OPR_LIS_APP_APPLY_UNIT_VO[] p_objAppUnitArr,
                                                  clsLisAppUnitItemVO[] p_objAppUnitItemArr)
        {
            long             lngRes           = 0;
            clsLisApplMainVO objLisApplMainVO = null;

            try
            {
                lngRes = objSvc.m_lngAddNewAppAndSampleInfoWithoutReceive(objPrincipal, p_objLisApplMainVO, out objLisApplMainVO, p_objReportArr, p_objAppSampleArr, p_objAppItemArr, p_objAppUnitArr, p_objAppUnitItemArr);
                if (lngRes > 0 && objLisApplMainVO != null)
                {
                    objLisApplMainVO.m_mthCopyTo(p_objLisApplMainVO);
                }
            }
            catch
            {
                lngRes = 0;
            }
            return(lngRes);
        }
示例#28
0
        public clsLisApplMainVO m_objConstructAppMainVO(System.Data.DataRow p_objRow)
        {
            clsLisApplMainVO objApplMainVO = new clsLisApplMainVO();

            try
            {
                if (p_objRow["APPLICATION_ID_CHR"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strAPPLICATION_ID = p_objRow["APPLICATION_ID_CHR"].ToString().Trim();
                }

                if (p_objRow["MODIFY_DAT"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strMODIFY_DAT = p_objRow["MODIFY_DAT"].ToString().Trim();
                }

                try
                {
                    // 存在没有barcode_vchr列的调用
                    if (p_objRow["barcode_vchr"] != System.DBNull.Value)
                    {
                        objApplMainVO.m_strBarcode = p_objRow["barcode_vchr"].ToString();
                    }
                }
                catch { }

                if (p_objRow["patientid_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strPatientID = p_objRow["patientid_chr"].ToString().Trim();
                }

                if (p_objRow["application_dat"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strAppl_Dat = Convert.ToDateTime(p_objRow["application_dat"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");
                }

                if (p_objRow["sex_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strSex = p_objRow["sex_chr"].ToString().Trim();
                }

                if (p_objRow["patient_name_vchr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strPatient_Name = p_objRow["patient_name_vchr"].ToString().Trim();
                }

                if (p_objRow["patient_subno_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strPatient_SubNO = p_objRow["patient_subno_chr"].ToString().Trim();
                }

                if (p_objRow["age_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strAge = p_objRow["age_chr"].ToString().Trim();
                }

                if (p_objRow["patient_type_id_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strPatientType = p_objRow["patient_type_id_chr"].ToString().Trim();
                }

                if (p_objRow["diagnose_vchr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strDiagnose = p_objRow["diagnose_vchr"].ToString().Trim();
                }

                if (p_objRow["bedno_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strBedNO = p_objRow["bedno_chr"].ToString().Trim();
                }

                if (p_objRow["icdcode_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strICD = p_objRow["icdcode_chr"].ToString().Trim();
                }

                if (p_objRow["patientcardid_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strPatientcardID = p_objRow["patientcardid_chr"].ToString().Trim();
                }


                if (p_objRow["application_form_no_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strApplication_Form_NO = p_objRow["application_form_no_chr"].ToString().Trim();
                }

                if (p_objRow["operator_id_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strOperator_ID = p_objRow["operator_id_chr"].ToString().Trim();
                }

                if (p_objRow["appl_empid_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strAppl_EmpID = p_objRow["appl_empid_chr"].ToString().Trim();
                }

                if (p_objRow["appl_deptid_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strAppl_DeptID = p_objRow["appl_deptid_chr"].ToString().Trim();
                }

                if (p_objRow["Summary_Vchr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strSummary = p_objRow["Summary_Vchr"].ToString().Trim();
                }

                if (p_objRow["PStatus_int"] != System.DBNull.Value)
                {
                    objApplMainVO.m_intPStatus_int = Convert.ToInt32(p_objRow["PStatus_int"]);
                }

                if (p_objRow["emergency_int"] != System.DBNull.Value)
                {
                    objApplMainVO.m_intEmergency = Convert.ToInt32(p_objRow["emergency_int"]);
                }

                if (p_objRow["special_int"] != System.DBNull.Value)
                {
                    objApplMainVO.m_intSpecial = Convert.ToInt32(p_objRow["special_int"]);
                }

                if (p_objRow["form_int"] != System.DBNull.Value)
                {
                    objApplMainVO.m_intForm_int = Convert.ToInt32(p_objRow["form_int"]);
                }

                if (p_objRow["patient_inhospitalno_chr"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strPatient_inhospitalno_chr = p_objRow["patient_inhospitalno_chr"].ToString().Trim();
                }

                if (p_objRow["SAMPLE_TYPE_ID_CHR"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strSampleTypeID = p_objRow["SAMPLE_TYPE_ID_CHR"].ToString().Trim();
                }

                if (p_objRow["SAMPLE_TYPE_VCHR"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strSampleType = p_objRow["SAMPLE_TYPE_VCHR"].ToString().Trim();
                }

                if (p_objRow["CHECK_CONTENT_VCHR"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strCheckContent = p_objRow["CHECK_CONTENT_VCHR"].ToString().Trim();
                }
                if (p_objRow["oringin_dat"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strOriginDate = DateTime.Parse(p_objRow["oringin_dat"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss");
                }
                if (p_objRow["CHARGE_INFO_VCHR"] != System.DBNull.Value)
                {
                    objApplMainVO.m_strChargeInfo = p_objRow["CHARGE_INFO_VCHR"].ToString().Trim();
                }

                if (p_objRow.Table.Columns.Contains("orderunitrelation_vchr"))
                {
                    if (p_objRow["orderunitrelation_vchr"] != System.DBNull.Value)
                    {
                        objApplMainVO.m_strOrderunitrelation = p_objRow["orderunitrelation_vchr"].ToString().Trim();
                    }
                    else
                    {
                        objApplMainVO.m_strOrderunitrelation = string.Empty;
                    }
                }

                try
                {
                    //先诊疗后检查的判断条件
                    if (!string.IsNullOrEmpty(p_objRow["isgreen_int"].ToString().Trim()))
                    {
                        objApplMainVO.m_intIsGreen = int.Parse(p_objRow["isgreen_int"].ToString().Trim());
                    }
                }
                catch (Exception objEx) { }

                if (p_objRow.Table.Columns.Contains("sample_id_chr"))
                {
                    if (p_objRow["sample_id_chr"] != System.DBNull.Value)
                    {
                        objApplMainVO.m_strSampleID = p_objRow["sample_id_chr"].ToString().Trim();
                    }
                    else
                    {
                        objApplMainVO.m_strSampleID = string.Empty;
                    }
                }
            }
            catch
            {
                objApplMainVO = null;
            }
            return(objApplMainVO);
        }
示例#29
0
        public long m_lngAddNewAppInfo(clsLisApplMainVO applMain, out clsLisApplMainVO applMainOut, bool isSend,
                                       clsT_OPR_LIS_APP_REPORT_VO[] arrReports, clsT_OPR_LIS_APP_SAMPLE_VO[] arrSamples,
                                       clsT_OPR_LIS_APP_CHECK_ITEM_VO[] arrCheckItems, clsT_OPR_LIS_APP_APPLY_UNIT_VO[] arrApplyUnits,
                                       clsLisAppUnitItemVO[] arrUnitItems)
        {
            long lngRes = 0;

            applMainOut = applMain;

            if (isSend)
            {
                applMain.m_intPStatus_int = 2;
            }

            if (applMain == null)
            {
                return(-2);
            }

            try
            {
                lngRes   = m_lngAddNewAppl(applMain, out applMainOut);
                applMain = applMainOut;
                if (lngRes > 0)
                {
                    #region 赋申请单ID

                    for (int i = 0; i < arrReports.Length; i++)
                    {
                        arrReports[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }
                    for (int i = 0; i < arrSamples.Length; i++)
                    {
                        arrSamples[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }
                    for (int i = 0; i < arrCheckItems.Length; i++)
                    {
                        arrCheckItems[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }
                    for (int i = 0; i < arrApplyUnits.Length; i++)
                    {
                        arrApplyUnits[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }
                    for (int i = 0; i < arrUnitItems.Length; i++)
                    {
                        arrUnitItems[i].m_strAPPLICATION_ID_CHR = applMain.m_strAPPLICATION_ID;
                    }

                    #endregion
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewReportGroup(arrReports);
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewAppSampleGroup(arrSamples);
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewAppCheckItem(arrCheckItems);
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewAppApplyUint(arrApplyUnits);
                }
                if (lngRes > 0)
                {
                    lngRes = 0;
                    lngRes = m_lngAddNewAppUintItemArr(arrUnitItems);
                }

                if (lngRes <= 0)
                {
                    throw new Exception(string.Empty);
                }
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
                throw objEx;
            }

            return(lngRes);
        }
示例#30
0
        private long m_lngAddNewAppl(clsLisApplMainVO applMain, out clsLisApplMainVO applMainOut)
        {
            #region == SQL ==

            string sql = @"insert into t_opr_lis_application
                                      ( application_id_chr      , modify_dat, 
							            patientid_chr           , application_dat, 
							            sex_chr                 , patient_name_vchr, 
							            patient_subno_chr       , age_chr, 
							            patient_type_id_chr     , diagnose_vchr, 
							            bedno_chr               , icdcode_chr, 
							            patientcardid_chr       , application_form_no_chr, 
							            operator_id_chr         , appl_empid_chr, 
							            appl_deptid_chr         , summary_vchr, 
							            pstatus_int             , emergency_int,
							            special_int             , form_int,
							            patient_inhospitalno_chr, sample_type_id_chr,
							            sample_type_vchr        , check_content_vchr,
							            oringin_dat             , charge_info_vchr,   orderunitrelation_vchr  )
								values(      ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?   )"                                ;


            #endregion

            applMainOut = applMain;
            long lngRes = 0;
            try
            {
                IDataParameter[]   objLisApplArr = null;
                clsHRPTableService objHRPSvc     = new clsHRPTableService();
                objHRPSvc.CreateDatabaseParameter(29, out objLisApplArr);

                DateTime CurTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                if (!IsNullOrEmptyOrSpace(applMain.m_strMODIFY_DAT))
                {
                    try
                    {
                        DateTime dtmPreModify = DateTime.Parse(applMain.m_strMODIFY_DAT);
                        TimeSpan ts           = CurTime - dtmPreModify;
                        if (ts.TotalMilliseconds < 1000)
                        {
                            CurTime = CurTime.AddSeconds(1f);
                        }
                    }
                    catch { }
                }

                if (IsNullOrEmptyOrSpace(applMain.m_strAPPLICATION_ID))
                {
                    string strNewApplID = null;
                    objHRPSvc.m_lngGenerateNewID("t_opr_lis_application", "APPLICATION_ID_CHR", out strNewApplID);
                    if (string.IsNullOrEmpty(strNewApplID))
                    {
                        throw new Exception("不能分配申请单ID");
                    }
                    applMain.m_strAPPLICATION_ID = strNewApplID;
                }


                objLisApplArr[0].Value   = applMain.m_strAPPLICATION_ID;
                applMain.m_strMODIFY_DAT = CurTime.ToString("yyyy-MM-dd HH:mm:ss");
                objLisApplArr[1].Value   = CurTime;
                if (IsNullOrEmptyOrSpace(applMain.m_strPatientID))
                {
                    applMain.m_strPatientID = "-1";
                }
                objLisApplArr[2].Value  = applMain.m_strPatientID;
                objLisApplArr[2].DbType = DbType.String;

                if (Microsoft.VisualBasic.Information.IsDate(applMain.m_strAppl_Dat))
                {
                    objLisApplArr[3].Value = System.DateTime.Parse(applMain.m_strAppl_Dat);
                }
                else
                {
                    applMain.m_strAppl_Dat = null;
                }
                objLisApplArr[4].Value  = applMain.m_strSex;
                objLisApplArr[5].Value  = applMain.m_strPatient_Name;
                objLisApplArr[6].Value  = applMain.m_strPatient_SubNO;
                objLisApplArr[7].Value  = applMain.m_strAge;
                objLisApplArr[8].Value  = applMain.m_strPatientType;
                objLisApplArr[9].Value  = applMain.m_strDiagnose;
                objLisApplArr[10].Value = applMain.m_strBedNO;
                objLisApplArr[11].Value = applMain.m_strICD;

                if (IsNullOrEmptyOrSpace(applMain.m_strPatientcardID))
                {
                    objLisApplArr[12].Value = System.DBNull.Value;
                }
                else
                {
                    objLisApplArr[12].Value = applMain.m_strPatientcardID;
                }

                objLisApplArr[13].Value = applMain.m_strApplication_Form_NO;
                objLisApplArr[14].Value = applMain.m_strOperator_ID;
                objLisApplArr[15].Value = applMain.m_strAppl_EmpID;
                objLisApplArr[16].Value = applMain.m_strAppl_DeptID;
                objLisApplArr[17].Value = applMain.m_strSummary;
                objLisApplArr[18].Value = applMain.m_intPStatus_int;
                objLisApplArr[19].Value = applMain.m_intEmergency;
                objLisApplArr[20].Value = applMain.m_intSpecial;
                objLisApplArr[21].Value = applMain.m_intForm_int;
                objLisApplArr[22].Value = applMain.m_strPatient_inhospitalno_chr;
                objLisApplArr[23].Value = applMain.m_strSampleTypeID;
                objLisApplArr[24].Value = applMain.m_strSampleType;
                objLisApplArr[25].Value = applMain.m_strCheckContent;
                try
                {
                    DateTime.Parse(applMain.m_strOriginDate);
                }
                catch
                {
                    applMain.m_strOriginDate = CurTime.ToString("yyyy-MM-dd HH:mm:ss");
                }

                objLisApplArr[26].Value = DateTime.Parse(applMain.m_strOriginDate);
                objLisApplArr[27].Value = applMain.m_strChargeInfo;
                objLisApplArr[28].Value = applMain.m_strOrderunitrelation;

                long lngRecEff = -1;

                lngRes = objHRPSvc.lngExecuteParameterSQL(sql, ref lngRecEff, objLisApplArr);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
                throw objEx;
            }
            return(lngRes);
        }