Exemplo n.º 1
0
        public ResultClass Divide(OutpatientClass sDll, string sRoot)
        {
            string sMome = "";
            bool   bRet  = false;
            string sOut;

            sDll.Divide(sRoot, out sOut);

            AddLog("分解输出数据:");
            AddLog(sOut);
            DivideResult.root divideResult = (DivideResult.root)(XmlUtil.DeserializeFromXml(sOut, typeof(DivideResult.root)));
            XmlDocument       xmlDoc       = GetXmlDoc(sOut);

            CheckOutputState(xmlDoc, out bRet, out sMome);

            ResultClass resultClassTemp = new ResultClass();

            resultClassTemp.bSucess  = bRet;
            resultClassTemp.sRemarks = sMome;

            resultClassTemp.oResult = divideResult;
            return(resultClassTemp);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 分解费用
        /// </summary>
        /// <param name="hObj"></param>
        /// <returns></returns>
        private bool Divide(OutpatientClass hObj)
        {
            string sOut;
            string sIn;

            //此处写的XML仅供测试接口使用,具体格式应以接口文档为准,且在生成此XML文档时应使用XML DOM对象生成,自行拼串需要处理特殊的XML字符转义
            sIn = "";
            sIn = sIn + "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\" ?>";
            sIn = sIn + " <root version=\"2.003\" sender=\"Test His 1.0\">";
            sIn = sIn + " <input>";
            sIn = sIn + "   <tradeinfo>";
            sIn = sIn + "     <curetype>11</curetype>";
            sIn = sIn + "     <illtype>0</illtype>";
            sIn = sIn + "     <feeno>xxxxx</feeno>";
            sIn = sIn + "   </tradeinfo>";
            sIn = sIn + "   <recipearray>";
            sIn = sIn + "     <recipe>";
            sIn = sIn + "       <diagnoseno>1</diagnoseno>";
            sIn = sIn + "       <recipeno>1</recipeno>";
            sIn = sIn + "       <recipedate>20080808</recipedate>";
            sIn = sIn + "       <diagnosename>啊</diagnosename>";
            sIn = sIn + "       <diagnosecode>01</diagnosecode>";
            sIn = sIn + "       <medicalrecord>阿斯顿</medicalrecord>";
            sIn = sIn + "       <sectioncode>01</sectioncode>";
            sIn = sIn + "       <sectionname>内科</sectionname>";
            sIn = sIn + "       <hissectionname>内科2</hissectionname>";
            sIn = sIn + "       <drid>0999</drid>";
            sIn = sIn + "       <drname>甲乙</drname>";
            sIn = sIn + "       <recipetype>1</recipetype>";
            sIn = sIn + "     </recipe>";
            sIn = sIn + "   </recipearray>";
            sIn = sIn + "   <feeitemarray>";
            sIn = sIn +
                  "<feeitem  itemno=\"0\" recipeno=\"123\" hiscode=\"7117\" itemname=\"罗红霉素片\" itemtype=\"1\" unitprice=\"111.00\" count=\"6\" fee=\"666.00\" dose=\"010100\" specification=\"规格\"  unit=\"单位\" howtouse=\"01\" dosage=\"单次用量\" packaging=\"包装单位\"  minpackage=\"最小包装\" conversion=\"1\" days=\"1\"/>";
            sIn = sIn + "   </feeitemarray>";
            sIn = sIn + " </input>";
            sIn = sIn + " ";
            sIn = sIn + "</root>";

            AddLog("调用费用分解接口");
            AddLog("输入参数:");
            AddLog(sIn);

            hObj.Divide(sIn, out sOut);

            AddLog("输出数据:");
            AddLog(sOut);

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            bool bRet = CheckOutputState(xmlDoc);

            if (bRet)
            {
                string  sTradeNO, sFeeNO, sRecipeNO;
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "output/tradeinfo");
                sTradeNO = dataNode.SelectNodes("tradeno")[0].InnerText;
                sFeeNO   = dataNode.SelectNodes("feeno")[0].InnerText;

                dataNode  = GetNodeFromPath(xmlDoc.DocumentElement, "output/feeitemarray");
                sRecipeNO = dataNode.SelectNodes("feeitem")[0].Attributes["recipeno"].InnerText;

                AddLog("解析XML结果:\r\n交易流水号:" + sTradeNO + "\r\n收费单据号:" + sFeeNO + "\r\n处方号:" + sRecipeNO);
            }

            xmlDoc = null;

            AddLog("\r\n");
            return(bRet);
        }