/// <summary>
        ///
        /// </summary>
        /// <param name="p_objInfo"></param>
        /// <returns>
        /// 操作结果。

        /// 0,失败。

        /// 1,成功。

        /// </returns>
        public long m_lngAddNew(clsThreeMeasureRecordInfo p_objInfo, clsThreeMeasureRecordContentInfo p_objContentInfo, clsThreeMeasureRecordContentAccessInfo[] p_objContentAccessInfoArr, clsThreeMeasureRecordContentEventInfo [] p_objContentEventInfoArr, bool p_blnIsAddNew)
        {
            clsThreeMeasureRecordService m_objThreeMeasureRecordServ =
                (clsThreeMeasureRecordService)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsThreeMeasureRecordService));

            long lngRes = 0;

            try
            {
                string    strMainXml             = m_strMakeNewMainXml(p_objInfo);
                string    strContentXml          = m_strMakeNewContentXml(p_objContentInfo);
                string [] strContentAccessXmlArr = m_strMakeNewContentAccessXmlArr(p_objContentAccessInfoArr);
                string [] strContentEventXmlArr  = m_strMakeNewContentEventXmlArr(p_objContentEventInfoArr);
                lngRes = m_objThreeMeasureRecordServ.m_lngAddNew(clsLoginContext.s_ObjLoginContext.m_ObjPrincial, strMainXml, strContentXml, strContentAccessXmlArr, strContentEventXmlArr, p_blnIsAddNew);
            }
            catch (Exception ex)
            {
                string strErrow = ex.Message;
            }
            finally
            {
                //m_objThreeMeasureRecordServ.Dispose();
            }
            return(lngRes);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="p_objInfo"></param>
        /// <returns>生成的XML</returns>
        private string m_strMakeNewMainXml(clsThreeMeasureRecordInfo p_objInfo)
        {
            m_objXmlMemStream.SetLength(0);

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

            m_objXmlWriter.WriteAttributeString("INPATIENTID", p_objInfo.m_strInPatientID);
            m_objXmlWriter.WriteAttributeString("INPATIENTDATE", p_objInfo.m_strInPatientDate);
            m_objXmlWriter.WriteAttributeString("OPENDATE", p_objInfo.m_strOpenDate);
            m_objXmlWriter.WriteAttributeString("CREATEDATE", p_objInfo.m_strCreateDate);
            if (p_objInfo.m_strCreateID != null)
            {
                m_objXmlWriter.WriteAttributeString("CREATEID", p_objInfo.m_strCreateID);
            }
            m_objXmlWriter.WriteAttributeString("SPECIALDATEXML", p_objInfo.m_objXmlValue.m_strSpecialDateXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("EVENTXML", p_objInfo.m_objXmlValue.m_strEventXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("BREATHXML", p_objInfo.m_objXmlValue.m_strBreathXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("INPUTXML", p_objInfo.m_objXmlValue.m_strInputXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("DEJECTAXML", p_objInfo.m_objXmlValue.m_strDejectaXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("PEEXML", p_objInfo.m_objXmlValue.m_strPeeXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("OUTSTREAMXML", p_objInfo.m_objXmlValue.m_strOutStreamXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("PRESSUREXML", p_objInfo.m_objXmlValue.m_strPressureXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("PRESSURE2XML", p_objInfo.m_objXmlValue.m_strPressureXml2.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("WEIGHTXML", p_objInfo.m_objXmlValue.m_strWeightXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("SKINTESTXML", p_objInfo.m_objXmlValue.m_strSkinTestXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("OTHERXML", p_objInfo.m_objXmlValue.m_strOtherXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("PULSEXML", p_objInfo.m_objXmlValue.m_strPulseXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("TEMPERATUREXML", p_objInfo.m_objXmlValue.m_strTemperatureXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("OTHERNAME", p_objInfo.m_objXmlValue.m_strOtherName.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("STAYOUTXML", p_objInfo.m_objXmlValue.m_strStayOutXml.Replace('\'', 'き'));
            m_objXmlWriter.WriteAttributeString("IFCONFIRM", "0");
            if (p_objInfo.m_strConfirmReason != null)
            {
                m_objXmlWriter.WriteAttributeString("CONFIRMREASON", p_objInfo.m_strConfirmReason.Replace('\'', 'き'));
            }
            if (p_objInfo.m_strConfirmReasonXMLString != null)
            {
                m_objXmlWriter.WriteAttributeString("CONFIRMREASONXMLSTRING", p_objInfo.m_strConfirmReasonXMLString.Replace('\'', 'き'));
            }
            m_objXmlWriter.WriteAttributeString("STATUS", "0");

            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));
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>
        /// </returns>
        public clsThreeMeasureRecordInfo [] m_objGetThreeMeasureRecordInfoArr(string p_strInPatientID, string p_strInPatientDate)
        {
            string strXML  = "";
            int    intRows = 0;

            clsThreeMeasureRecordService m_objThreeMeasureRecordServ =
                (clsThreeMeasureRecordService)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsThreeMeasureRecordService));

            long lngRes = 0;

            try
            {
                lngRes = m_objThreeMeasureRecordServ.m_lngGetPatientRecord(clsLoginContext.s_ObjLoginContext.m_ObjPrincial, p_strInPatientID, p_strInPatientDate, ref strXML, ref intRows);
            }
            finally
            {
                //m_objThreeMeasureRecordServ.Dispose();
            }

            clsThreeMeasureRecordInfo[] objInfoArr = null;

            if (lngRes > 0 && intRows > 0)
            {
                objInfoArr = new clsThreeMeasureRecordInfo[intRows];

                XmlTextReader objReader = new XmlTextReader(strXML, XmlNodeType.Element, m_objXmlParser);
                objReader.WhitespaceHandling = WhitespaceHandling.None;

                int intIndex = 0;
                while (objReader.Read())
                {
                    switch (objReader.NodeType)
                    {
                    case XmlNodeType.Element:
                        if (objReader.HasAttributes)
                        {
                            objInfoArr[intIndex] = new clsThreeMeasureRecordInfo();
                            objInfoArr[intIndex].m_strInPatientID   = objReader.GetAttribute("INPATIENTID");
                            objInfoArr[intIndex].m_strInPatientDate = objReader.GetAttribute("INPATIENTDATE");
                            objInfoArr[intIndex].m_strOpenDate      = objReader.GetAttribute("OPENDATE");
                            objInfoArr[intIndex].m_strCreateDate    = objReader.GetAttribute("CREATEDATE");
                            objInfoArr[intIndex].m_strCreateID      = objReader.GetAttribute("CREATEID");

                            objInfoArr[intIndex].m_objXmlValue = new clsThreeMeasureXmlValue();
                            objInfoArr[intIndex].m_objXmlValue.m_strRecordDate     = objInfoArr[intIndex].m_strCreateDate;
                            objInfoArr[intIndex].m_objXmlValue.m_strSpecialDateXml = objReader.GetAttribute("SPECIALDATEXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strEventXml       = objReader.GetAttribute("EVENTXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strBreathXml      = objReader.GetAttribute("BREATHXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strInputXml       = objReader.GetAttribute("INPUTXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strDejectaXml     = objReader.GetAttribute("DEJECTAXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strPeeXml         = objReader.GetAttribute("PEEXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strOutStreamXml   = objReader.GetAttribute("OUTSTREAMXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strPressureXml    = objReader.GetAttribute("PRESSUREXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strPressureXml2   = objReader.GetAttribute("PRESSURE2XML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strWeightXml      = objReader.GetAttribute("WEIGHTXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strSkinTestXml    = objReader.GetAttribute("SKINTESTXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strOtherXml       = objReader.GetAttribute("OTHERXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strPulseXml       = objReader.GetAttribute("PULSEXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strTemperatureXml = objReader.GetAttribute("TEMPERATUREXML").Replace('き', '\'');
                            objInfoArr[intIndex].m_objXmlValue.m_strOtherName      = objReader.GetAttribute("OTHERNAME").Replace('き', '\'');

                            objInfoArr[intIndex].m_strIfConfirm              = objReader.GetAttribute("IFCONFIRM");
                            objInfoArr[intIndex].m_strConfirmReason          = objReader.GetAttribute("CONFIRMREASON").Replace('き', '\'');
                            objInfoArr[intIndex].m_strConfirmReasonXMLString = objReader.GetAttribute("CONFIRMREASONXMLSTRING").Replace('き', '\'');
                            objInfoArr[intIndex].m_strStatus              = objReader.GetAttribute("STATUS");
                            objInfoArr[intIndex].m_strDeActivedDate       = objReader.GetAttribute("DEACTIVEDDATE");
                            objInfoArr[intIndex].m_strDeActivedOperatorID = objReader.GetAttribute("DEACTIVEDOPERATORID");
                            objInfoArr[intIndex].m_strFirstPrintDate      = objReader.GetAttribute("FIRSTPRINTDATE");

                            objInfoArr[intIndex].m_strModifyDate = objReader.GetAttribute("MODIFYDATE");

                            intIndex++;
                        }
                        break;
                    }
                }
            }
            else
            {
                objInfoArr = new clsThreeMeasureRecordInfo[0];
            }

            return(objInfoArr);
        }