/// <summary>
 /// 从数据库初始化打印内容。如果没有记录,打印空报表。
 /// </summary>
 public void m_mthInitPrintContent()
 {
     if (m_objPatient != null && m_dtmOpenDate != DateTime.MinValue)
     {
         m_objPrintInfo = new clsBUltrasonicCheckOrderDomain().m_objGetBUltrasonicCheckOrder(m_objPatient.m_StrInPatientID, m_dtmInPatientDate.ToString("yyyy-MM-dd HH:mm:ss"), m_dtmOpenDate.ToString("yyyy-MM-dd HH:mm:ss"));
     }
     m_blnWantInit = false;
 }
 /// <summary>
 /// 设置打印信息
 /// </summary>
 /// <param name="p_objPatient">病人</param>
 /// <param name="p_dtmInPatientDate">入院日期</param>
 /// <param name="p_dtmOpenDate">OpenDate,如果是一次打印多次记录表单的类型(如病案记录),忽略OpenDate</param>
 public void m_mthSetPrintInfo(clsPatient p_objPatient, DateTime p_dtmInPatientDate, DateTime p_dtmOpenDate)
 {
     m_objPrintInfo     = null;
     m_objPatient       = p_objPatient;
     m_dtmInPatientDate = p_dtmInPatientDate;
     m_dtmOpenDate      = p_dtmOpenDate;
     m_blnWantInit      = true;
 }
        private string m_strOrderXML(clsBUltrasonicCheckOrder p_objBUltraCheckOrder)
        {
            if (p_objBUltraCheckOrder == null)
            {
                return(null);
            }
            m_objXmlWriter.Flush();
            m_objXmlMemStream.SetLength(0);

            m_objXmlWriter.WriteStartDocument();
            m_objXmlWriter.WriteStartElement("RecordMaster");

            m_objXmlWriter.WriteAttributeString("INPATIENTID", p_objBUltraCheckOrder.m_strInPatientID.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("INPATIENTDATE", p_objBUltraCheckOrder.m_strInPatientDate.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("CREATEDATE", p_objBUltraCheckOrder.m_strCreateDate.Replace('\'', 'き'));
//			m_objXmlWriter.WriteAttributeString("MODIFYDATE", p_objBUltraCheckOrder.m_strModifyDate.Replace('\'','き'));
            m_objXmlWriter.WriteAttributeString("CREATEUSERID", p_objBUltraCheckOrder.m_strCreateUserID.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("STATUS", p_objBUltraCheckOrder.m_strStatus.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("IFCONFIRM", p_objBUltraCheckOrder.m_strIfConfirm.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("CREATEUSERDEPTID", p_objBUltraCheckOrder.m_strCreateUserDeptID.Replace('\'', 'き'));

            m_objXmlWriter.WriteAttributeString("CHECKNUMBER", p_objBUltraCheckOrder.m_strCheckNumber.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("HISTORY", p_objBUltraCheckOrder.m_strHistory.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("BODYCHECK", p_objBUltraCheckOrder.m_strBodyCheck.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("XRAY", p_objBUltraCheckOrder.m_strXRay.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("XRAYDATE", p_objBUltraCheckOrder.m_strXRayDate.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("XRAYNUMBER", p_objBUltraCheckOrder.m_strXRayNumber.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("LABCHECK", p_objBUltraCheckOrder.m_strLabCheck.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("OTHERCHECK", p_objBUltraCheckOrder.m_strOtherCheck.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("CLINICALDISGONSE", p_objBUltraCheckOrder.m_strClinicalDisgonse.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("CHECKPLACE", p_objBUltraCheckOrder.m_strCheckPlace.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("PATHOLYDISGONSEDATE", p_objBUltraCheckOrder.m_strPatholyDisgonseDate.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("OPERATIONDATE", p_objBUltraCheckOrder.m_strOperationDate.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("OPERATIONINFORMATION", p_objBUltraCheckOrder.m_strOperationInformation.Replace('\'', 'き'));

            m_objXmlWriter.WriteEndElement();
            m_objXmlWriter.WriteEndDocument();
            m_objXmlWriter.Flush();
            return(System.Text.Encoding.Unicode.GetString(m_objXmlMemStream.ToArray(), 39 * 2, (int)m_objXmlMemStream.Length - 39 * 2));
        }
        //耶紗曾倖歌方�RequestImage,ApplicationID。
        public long m_lngSave(clsBUltrasonicCheckOrder p_objBUltraCheckOrder,
                              ImageRequest p_objImageRequest, ref string p_strApplicationID, bool p_bnlIsNew)

        {
            string m_strApplicationID = "";
            long   m_lngRe            = 0;

            clsBUltrasonicCheckOrderServ m_objServ =
                (clsBUltrasonicCheckOrderServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsBUltrasonicCheckOrderServ));

            if (p_objBUltraCheckOrder == null)
            {
                return(-1);
            }
            else
            if (p_bnlIsNew == false)
            {
                m_strApplicationID = p_objBUltraCheckOrder.m_strApplicationID;
            }


            try
            {
                string strOrderXML = m_strOrderXML(p_objBUltraCheckOrder);

                m_lngRe = m_objServ.m_lngAddNew(clsLoginContext.s_ObjLoginContext.m_ObjPrincial, strOrderXML,
                                                p_objImageRequest, ref m_strApplicationID, p_bnlIsNew);

                p_strApplicationID = m_strApplicationID;
            }
            finally
            {
                //m_objServ.Dispose();
            }
            return(m_lngRe);
        }
        /// <summary>
        /// 資函麼燕議佚連
        /// </summary>
        /// <param name="p_strInPatientID"></param>
        /// <param name="p_strInPatientDate"></param>
        /// <param name="p_strCreateDate"></param>
        /// <returns></returns>
        public clsBUltrasonicCheckOrder  m_objGetBUltrasonicCheckOrder(string p_strInPatientID, string p_strInPatientDate, string p_strCreateDate)
        {
            if (p_strInPatientID == null || p_strInPatientID == "" || p_strInPatientDate == null || p_strInPatientDate == "" || p_strCreateDate == null || p_strCreateDate == "")
            {
                return(null);
            }

            clsBUltrasonicCheckOrderServ m_objServ =
                (clsBUltrasonicCheckOrderServ)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsBUltrasonicCheckOrderServ));

            clsBUltrasonicCheckOrder objBUltrasonicCheckOrder = null;

            try
            {
                string strXml  = "";
                int    intRows = 0;

                long lngRes = m_objServ.GetBUltrasonicCheckOrder(clsLoginContext.s_ObjLoginContext.m_ObjPrincial, p_strInPatientID, p_strInPatientDate, p_strCreateDate, ref strXml, ref intRows);

                if (lngRes > 0 && intRows > 0)
                {
                    XmlTextReader objReader = new XmlTextReader(strXml, XmlNodeType.Element, m_objXmlParser);
                    objReader.WhitespaceHandling = WhitespaceHandling.None;

                    while (objReader.Read())
                    {
                        switch (objReader.NodeType)
                        {
                        case XmlNodeType.Element:
                            if (objReader.HasAttributes)
                            {
                                objBUltrasonicCheckOrder = new clsBUltrasonicCheckOrder();

                                objBUltrasonicCheckOrder.m_strInPatientID         = objReader.GetAttribute("INPATIENTID").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strInPatientDate       = objReader.GetAttribute("INPATIENTDATE").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strCreateDate          = objReader.GetAttribute("CREATEDATE").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strStatus              = objReader.GetAttribute("STATUS").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strIfConfirm           = objReader.GetAttribute("IFCONFIRM").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strDeActivedDate       = objReader.GetAttribute("DEACTIVEDDATE").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strDeActivedOperatorID = objReader.GetAttribute("DEACTIVEDOPERATORID").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strConfirmReason       = objReader.GetAttribute("CONFIRMREASON").ToString().Replace('き', '\'');;
                                objBUltrasonicCheckOrder.m_strConfirmReasonXML    = objReader.GetAttribute("CONFIRMREASONXML").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strCreateUserID        = objReader.GetAttribute("CREATEUSERID").ToString().Replace('き', '\'');

                                objBUltrasonicCheckOrder.m_strCheckNumber          = objReader.GetAttribute("CHECKNUMBER").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strHistory              = objReader.GetAttribute("HISTORY").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strBodyCheck            = objReader.GetAttribute("BODYCHECK").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strXRay                 = objReader.GetAttribute("XRAY").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strXRayDate             = objReader.GetAttribute("XRAYDATE").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strXRayNumber           = objReader.GetAttribute("XRAYNUMBER").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strLabCheck             = objReader.GetAttribute("LABCHECK").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strOtherCheck           = objReader.GetAttribute("OTHERCHECK").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strClinicalDisgonse     = objReader.GetAttribute("CLINICALDISGONSE").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strCheckPlace           = objReader.GetAttribute("CHECKPLACE").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strPatholyDisgonseDate  = objReader.GetAttribute("PATHOLYDISGONSEDATE").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strOperationDate        = objReader.GetAttribute("OPERATIONDATE").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strOperationInformation = objReader.GetAttribute("OPERATIONINFORMATION").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strCreateUserDeptID     = objReader.GetAttribute("CREATEUSERDEPTID").ToString().Replace('き', '\'');
                                objBUltrasonicCheckOrder.m_strApplicationID        = objReader.GetAttribute("APPLICATIONID").ToString().Replace('き', '\'');
                            }
                            break;
                        }
                    }
                }
            }
            finally
            {
                //m_objServ.Dispose();
            }
            return(objBUltrasonicCheckOrder);
        }
 /// <summary>
 /// 设置打印内容。当数据已经存在时使用。
 /// </summary>
 /// <param name="p_objPrintContent">打印内容</param>
 public void m_mthSetPrintContent(object p_objPrintContent)
 {
     m_objPrintInfo = (clsBUltrasonicCheckOrder)p_objPrintContent;
     m_blnWantInit  = false;
 }