/// <summary> /// 从数据库初始化打印内容。如果没有记录,打印空报表。(当从数据库读取时要调用.) /// </summary> public void m_mthInitPrintContent() { if (this.m_objPatient == null) { clsPublicFunction.ShowInformationMessageBox("在执行m_mthInitPrintContent之前请先执行m_mthSetPrintInfo函数"); return; } if (m_blnIsFromDataSource) { clsRecordsDomain m_objServ = new clsRecordsDomain(enmRecordsType.EMR_OXTIntravenousDrip); clsTransDataInfo[] m_objTempArr = null; if (m_objServ.m_lngGetTransDataInfoArr(m_objPatient.m_StrRegisterId, out m_objTempArr) > 0 && m_objTempArr != null && m_objTempArr.Length > 0) { m_objPrintMainInfo = m_objTempArr[0] as clsEMR_OXTIntravenousDripDataInfo; if (m_objPrintMainInfo.m_objBaseInfo != null) { if (m_objPrintMainInfo.m_objBaseInfo.m_dtmFirstPrintDate != DateTime.MinValue) { m_blnIsFirstPrint = true; } else { m_dtmFirstPrintDat = m_objPrintMainInfo.m_objBaseInfo.m_dtmFirstPrintDate; } } } } }
/// <summary> /// 设置打印内容。 /// </summary> /// <param name="p_objPrintContent"></param> public void m_mthSetPrintContent(object p_objPrintContent) { m_blnWantInit = false; if (p_objPrintContent.GetType().Name != "clsEMR_OXTIntravenousDripDataInfo") { MDIParent.ShowInformationMessageBox("参数错误"); } m_blnIsFromDataSource = false;//表明是从文件直接提取信息 m_objPrintMainInfo = (clsEMR_OXTIntravenousDripDataInfo)p_objPrintContent; //m_mthSetPrintContent((clsEMR_OXTIntravenousDrip_BASE)m_objPrintMainInfo.m_objBaseInfo, (clsEMR_OXTIntravenousDripCon)m_objPrintMainInfo.m_objBaseInfo, DateTime.Now ); }
/// <summary> /// 获取显示到DataGrid的数据 /// </summary> /// <param name="p_objTransDataInfo"></param> /// <returns></returns> protected override object[][] m_objGetRecordsValueArr(clsTransDataInfo p_objTransDataInfo) { #region 显示记录到DataGrid try { object[] objData; ArrayList objReturnData = new ArrayList(); clsEMR_OXTIntravenousDripDataInfo objInfo = p_objTransDataInfo as clsEMR_OXTIntravenousDripDataInfo; if (objInfo != null && objInfo.m_objBaseInfo != null) { m_objCurrentBaseVO = objInfo.m_objBaseInfo; } if (objInfo == null || objInfo.m_objRecordArr == null) { return(null); } int intRecordCount = objInfo.m_objRecordArr.Length; clsDSTRichTextBoxValue objclsDSTRichTextBoxValue; string strText, strXml; #region 获取修改限定时间 int intCanModifyTime = 0; try { intCanModifyTime = int.Parse(m_strCanModifyTime); } catch { intCanModifyTime = 6; } #endregion for (int i = 0; i < intRecordCount; i++) { objData = new object[16]; clsEMR_OXTIntravenousDripCon objCurrent = objInfo.m_objRecordArr[i]; clsEMR_OXTIntravenousDripCon objNext = new clsEMR_OXTIntravenousDripCon();//下一条记录 if (i < intRecordCount - 1) { objNext = objInfo.m_objRecordArr[i + 1]; } //如果该护理记录是修改前的记录且是在指定时间内修改的,修改者与创建者为同一人,则不显示 if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strModifyUserID.Trim() == objCurrent.m_strCreateUserID.Trim()) { TimeSpan tsModify = objNext.m_dtmModifyDate - objCurrent.m_dtmModifyDate; if ((int)tsModify.TotalHours < intCanModifyTime) { continue; } } #region 存放关键字段 if (objCurrent.m_dtmCreateDate != DateTime.MinValue) { objData[0] = objCurrent.m_dtmRecordDate; //存放记录时间的字符串 objData[1] = (int)enmRecordsType.EMR_OXTIntravenousDrip; //存放记录类型的int值 objData[2] = objCurrent.m_dtmCreateDate;//存放记录的OpenDate字符串 objData[3] = objCurrent.m_dtmModifyDate;//存放记录的ModifyDate字符串 //同一个则只在第一行显示日期 if (objCurrent.m_dtmRecordDate.Date.ToString() != m_dtmPreRecordDate.Date.ToString()) { objData[4] = objCurrent.m_dtmRecordDate.Date.ToString("yyyy-MM-dd");//日期字符串 } //修改后带有痕迹的记录不再显示时间 if (m_dtmPreRecordDate != objCurrent.m_dtmRecordDate) { objData[5] = objCurrent.m_dtmRecordDate.ToString("HH:mm"); //时间字符串 } objData[15] = objCurrent.m_strCreateUserID; //存放记录的createUserid字符串 } m_dtmPreRecordDate = objCurrent.m_dtmRecordDate; #endregion ; #region 存放单项信息 //催产素浓度 strText = objCurrent.m_strOXTDENSITY_RIGHT; strXml = "<root />"; if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strOXTDENSITY_RIGHT != objCurrent.m_strOXTDENSITY_RIGHT) /*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ { strXml = m_strGetDSTTextXML(strText, objCurrent.m_strModifyUserID, objCurrent.m_strModifyUserName); } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[6] = objclsDSTRichTextBoxValue; //滴数 strText = objCurrent.m_strOXTDROPCOUNT_RIGHT; strXml = "<root />"; if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strOXTDROPCOUNT_RIGHT != objCurrent.m_strOXTDROPCOUNT_RIGHT) /*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ { strXml = m_strGetDSTTextXML(objCurrent.m_strOXTDROPCOUNT_RIGHT, objCurrent.m_strModifyUserID, objCurrent.m_strModifyUserName); } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[7] = objclsDSTRichTextBoxValue; //宫缩 strText = objCurrent.m_strUTERINECONTRACTION_RIGHT; strXml = "<root />"; if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strUTERINECONTRACTION_RIGHT != objCurrent.m_strUTERINECONTRACTION_RIGHT) /*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ { strXml = m_strGetDSTTextXML(objCurrent.m_strUTERINECONTRACTION_RIGHT, objCurrent.m_strModifyUserID, objCurrent.m_strModifyUserName); } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[8] = objclsDSTRichTextBoxValue; //胎心 strText = objCurrent.m_strFETALHEART_RIGHT; strXml = "<root />"; if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strFETALHEART_RIGHT != objCurrent.m_strFETALHEART_RIGHT) /*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ { strXml = m_strGetDSTTextXML(objCurrent.m_strFETALHEART_RIGHT, objCurrent.m_strModifyUserID, objCurrent.m_strModifyUserName); } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[9] = objclsDSTRichTextBoxValue; //宫口扩张 strText = objCurrent.m_strMETREURYNT_RIGHT; strXml = "<root />"; if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strMETREURYNT_RIGHT != objCurrent.m_strMETREURYNT_RIGHT) /*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ { strXml = m_strGetDSTTextXML(objCurrent.m_strMETREURYNT_RIGHT, objCurrent.m_strModifyUserID, objCurrent.m_strModifyUserName); } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[10] = objclsDSTRichTextBoxValue; //先露高低 strText = objCurrent.m_strPRESENTATION_RIGHT; strXml = "<root />"; if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strPRESENTATION_RIGHT != objCurrent.m_strPRESENTATION_RIGHT) /*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ { strXml = m_strGetDSTTextXML(objCurrent.m_strPRESENTATION_RIGHT, objCurrent.m_strModifyUserID, objCurrent.m_strModifyUserName); } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[11] = objclsDSTRichTextBoxValue; //血压 strText = objCurrent.m_strBP_S_RIGHT + "/" + objCurrent.m_strBP_A_RIGHT; strXml = "<root />"; if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && (objNext.m_strBP_S_RIGHT + "/" + objNext.m_strBP_A_RIGHT) != (objCurrent.m_strBP_S_RIGHT + "/" + objCurrent.m_strBP_A_RIGHT)) /*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ { strXml = m_strGetDSTTextXML(strText, objCurrent.m_strModifyUserID, objCurrent.m_strModifyUserName); } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[12] = objclsDSTRichTextBoxValue; //特殊情况及处理 strText = objCurrent.m_strSPECIALINFO_RIGHT; strXml = "<root />"; if (objNext != null && objNext.m_dtmCreateDate == objCurrent.m_dtmCreateDate && objNext.m_strSPECIALINFO_RIGHT != objCurrent.m_strSPECIALINFO_RIGHT) /*objNext的记录内容与objCurrent的记录内容不一致,文本需要加双划线*/ { strXml = m_strGetDSTTextXML(objCurrent.m_strSPECIALINFO_RIGHT, objCurrent.m_strModifyUserID, objCurrent.m_strModifyUserName); } objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[13] = objclsDSTRichTextBoxValue; if (objCurrent.objSignerArr != null) { //签名 strText = string.Empty; for (int j = 0; j < objCurrent.objSignerArr.Length; j++) { strText += objCurrent.objSignerArr[j].objEmployee.m_strLASTNAME_VCHR + " "; } strXml = "<root />"; objclsDSTRichTextBoxValue = new clsDSTRichTextBoxValue(); objclsDSTRichTextBoxValue.m_strText = strText; objclsDSTRichTextBoxValue.m_strDSTXml = strXml; objData[14] = objclsDSTRichTextBoxValue; } #endregion objReturnData.Add(objData); } object[][] m_objRe = new object[objReturnData.Count][]; for (int m = 0; m < objReturnData.Count; m++) { m_objRe[m] = (object[])objReturnData[m]; } return(m_objRe); } catch (Exception ex) { MessageBox.Show(ex.Message); return(null); } #endregion }