Exemple #1
0
        public ResultClass PrintInvoice(OutpatientClass sDll, string sIn)
        {
            string sMome = "";
            bool   bRet  = false;
            string sOut;

            sDll.PrintInvoice(sIn, out sOut);

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            CheckOutputState(xmlDoc, out bRet, out sMome);

            string detailreprintflag = "0";

            if (bRet)
            {
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "detailreprintflag");
                detailreprintflag = dataNode.InnerText;
            }

            xmlDoc = null;
            ResultClass resultClassTemp = new ResultClass();

            resultClassTemp.bSucess  = bRet;
            resultClassTemp.sRemarks = sMome;
            resultClassTemp.oResult  = detailreprintflag;
            return(resultClassTemp);
        }
 public override void BeginInitData(Hashtable param)
 {
     //根据ActionMapping.xml里面配置
     //string sValue = ActionMappingConfig.GetHospitalDataValue("GreatCommunicationLib.Server.CustomAction.广东梅州市.MeiZhouAction", Convert.ToString(param["HospitalID"]), "YBUserName");
     //string sHosValue = ActionMappingConfig.GetHospitalDataValue("GreatCommunicationLib.Server.CustomAction.广东梅州市.MeiZhouAction", Convert.ToString(param["HospitalID"]), "HospitalAttribute");
     OutpatientClass hObj = new OutpatientClass();
 }
Exemple #3
0
        /// <summary>
        /// 调用交易确认接口
        /// </summary>
        /// <param name="hObj"></param>
        /// <returns></returns>
        private bool Trade(OutpatientClass hObj)
        {
            string sOut;

            AddLog("调用交易确认接口");
            AddLog("输入参数:");

            hObj.Trade(out sOut);

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

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            bool bRet = CheckOutputState(xmlDoc);

            if (bRet)
            {
                string  sPersonCountAfterSub;
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "output");
                sPersonCountAfterSub = dataNode.SelectNodes("personcountaftersub")[0].InnerText;
                AddLog("解析XML结果:\r\n本次结算后个人账户余额:" + sPersonCountAfterSub);
            }

            xmlDoc = null;

            AddLog("\r\n");

            return(bRet);
        }
Exemple #4
0
        /// <summary>
        /// 调用费用退费分解接口
        /// </summary>
        /// <param name="hObj"></param>
        /// <returns></returns>
        private bool RefundmentDivide(OutpatientClass hObj)
        {
            string sOut;
            string sDealID = "011100030A090115000017";

            AddLog("调用费用退费分解接口");
            AddLog("输入参数:");
            AddLog("交易流水号:" + sDealID);

            hObj.RefundmentDivide(sDealID, out sOut);

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

            XmlDocument xmlDoc = GetXmlDoc(sOut);
            bool        bRet   = CheckOutputState(xmlDoc);

            if (bRet)
            {
                string  sTradeNO, sIC_NO;
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "output/tradeinfo");
                sTradeNO = dataNode.SelectNodes("tradeno")[0].InnerText;
                sIC_NO   = dataNode.SelectNodes("icno")[0].InnerText;
                AddLog("解析XML结果:\r\n交易流水号:" + sTradeNO + "\r\n医保应用号:" + sIC_NO);
            }

            xmlDoc = null;

            AddLog("\r\n");
            return(bRet);
        }
        /// <summary>
        /// 确认交易
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public ResultClass MZ_CommitTrade(OutpatientClass sDll)
        {
            ResultClass resultClass = new ResultClass();

            try
            {
                resultClass = iface.OpenDevice(sDll);
                if (resultClass.bSucess)
                {
                    resultClass = iface.Trade(sDll);
                    iface.CloseDevice(sDll);
                }
                else
                {
                    resultClass.oResult = null;
                }
                sDll = null;
            }
            catch (Exception e)
            {
                resultClass.bSucess  = false;
                resultClass.sRemarks = e.Message;
                resultClass.oResult  = null;
            }
            return(resultClass);
        }
Exemple #6
0
        /// <summary>
        /// 调用读取卡片信息接口
        /// </summary>
        /// <param name="hObj"></param>
        /// <returns></returns>
        private bool GetCardInfo(OutpatientClass hObj)
        {
            String sOut;

            AddLog("调用读取卡片信息接口");
            AddLog("输入参数:无");

            hObj.GetCardInfo(out sOut);

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

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            bool bRet = CheckOutputState(xmlDoc);

            if (bRet)
            {
                string  sIC_NO, sPersonName;
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "output/ic");
                sIC_NO      = dataNode.SelectNodes("ic_no")[0].InnerText;
                sPersonName = dataNode.SelectNodes("personname")[0].InnerText;
                AddLog("解析XML结果:\r\n医保应用号:" + sIC_NO + "\r\n姓名:" + sPersonName);
            }

            xmlDoc = null;

            AddLog("\r\n");

            return(bRet);
        }
        /// <summary>
        /// 取消门诊结算
        /// </summary>
        /// <returns></returns>
        public ResultClass MZ_CancelCharge(OutpatientClass sDll, string tradeNo, string invoiceNo)
        {
            ResultClass resultClass = new ResultClass();

            try
            {
                resultClass = iface.OpenDevice(sDll);

                if (resultClass.bSucess)
                {
                    resultClass = iface.GetPersonInfo(sDll, _cardNo);
                    resultClass = iface.RefundmentDivide(sDll, tradeNo, invoiceNo);
                    //resultClass1=iface.Trade(sDll);
                    iface.CloseDevice(sDll);
                }
                else
                {
                    resultClass.oResult = null;
                }
                sDll = null;
            }
            catch (Exception e)
            {
                resultClass.bSucess  = false;
                resultClass.sRemarks = e.Message;
                resultClass.oResult  = null;
            }


            return(resultClass);
        }
        public ResultClass RePrintInvoice(OutpatientClass sDll, string tradeNo, string invoiceNo)
        {
            ResultClass resultClass = new ResultClass();

            try
            {
                resultClass = iface.OpenDevice(sDll);
                if (resultClass.bSucess)
                {
                    resultClass = iface.RePrintInvoice(sDll, tradeNo, invoiceNo);
                    iface.CloseDevice(sDll);
                }
                else
                {
                    resultClass.oResult = null;
                }
                sDll = null;
            }
            catch (Exception e)
            {
                resultClass.bSucess  = false;
                resultClass.sRemarks = e.Message;
                resultClass.oResult  = null;
            }
            return(resultClass);
        }
        /// <summary>
        /// 调用读取卡片信息接口
        /// </summary>
        /// <param name="b"></param>
        /// <param name="s"></param>
        /// <param name="dt"></param>
        public ResultClass Mz_GetCardInfo(OutpatientClass sDll, string cardNo)
        {
            if (cardNo != String.Empty)
            {
                _cardNo = cardNo;
            }
            ResultClass resultClass = new ResultClass();

            try
            {
                resultClass = iface.OpenDevice(sDll);
                if (resultClass.bSucess)
                {
                    resultClass = iface.GetCardInfo(sDll, cardNo);
                    iface.CloseDevice(sDll);
                }
                else
                {
                    resultClass.oResult = null;
                }
                sDll = null;
            }
            catch (Exception e)
            {
                resultClass.bSucess  = false;
                resultClass.sRemarks = "无法读取医保卡信息!请确保医保网络正常!";//e.Message;
                resultClass.oResult  = null;
            }
            return(resultClass);
        }
 /// <summary>
 /// 结算
 /// </summary>
 /// <returns></returns>
 public ResultClass MZ_Charge(OutpatientClass sDll)
 {
     //ResultClass resultClass = new ResultClass();
     //try
     //{
     //    resultClass = iface.OpenDevice(sDll);
     //    if (resultClass.bSucess)
     //    {
     //        resultClass = iface.Trade(sDll);
     //        iface.CloseDevice(sDll);
     //    }
     //    else
     //    {
     //        resultClass.oResult = null;
     //    }
     //    sDll = null;
     //}
     //catch (Exception e)
     //{
     //    resultClass.bSucess = false;
     //    resultClass.sRemarks = e.Message;
     //    resultClass.oResult = null;
     //}
     //return resultClass;
     return(MZ_CommitTrade(sDll));
 }
        /// <summary>
        /// 预算
        /// </summary>
        /// <param name="b"></param>
        /// <param name="s"></param>
        /// <param name="dt"></param>
        public ResultClass MZ_PreviewCharge(OutpatientClass sDll, Reg.root root)
        {
            ResultClass resultClass = new ResultClass();

            try
            {
                resultClass = iface.OpenDevice(sDll);
                if (resultClass.bSucess)
                {
                    //resultClass = iface.GetPersonInfo(sDll, _cardNo);
                    resultClass = iface.Divide(sDll, root);
                    iface.CloseDevice(sDll);
                }
                else
                {
                    resultClass.oResult = null;
                }
                sDll = null;
            }
            catch (Exception e)
            {
                resultClass.bSucess  = false;
                resultClass.sRemarks = e.Message;
                resultClass.oResult  = null;
            }
            return(resultClass);
        }
Exemple #12
0
        /// <summary>
        /// 调用费用退费分解接口
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public ResultClass RefundmentDivide(OutpatientClass sDll, string tradeNo, string serialNO)
        {
            string      sMome           = "";
            ResultClass resultClassTemp = new ResultClass();
            bool        bRet            = false;
            string      sOut;

            sDll.RefundmentDivide(tradeNo, "2323", out sOut);

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            CheckOutputState(xmlDoc, out bRet, out sMome);
            if (bRet)
            {
                string  sTradeNO, sIC_NO;
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "output/tradeinfo");
                sTradeNO = dataNode.SelectNodes("tradeno")[0].InnerText;
                resultClassTemp.sRemarks = sTradeNO;

                //RePrintInvoice(sDll, sTradeNO, serialNO);
                DivideResult.root divideResult = (DivideResult.root)(XmlUtil.DeserializeFromXml(sOut, typeof(DivideResult.root)));
                resultClassTemp.oResult = divideResult;
                xmlDoc = null;
            }
            else
            {
                resultClassTemp.sRemarks = sMome;
            }

            resultClassTemp.bSucess = bRet;
            return(resultClassTemp);
        }
Exemple #13
0
        /// <summary>
        /// 调用交易状态查询及回退接口
        /// </summary>
        /// <param name="hObj"></param>
        /// <returns></returns>
        private bool CommitTradeState(OutpatientClass hObj)
        {
            string sOut;
            string sDealID = "011100030A090308000007";

            AddLog("调用交易状态查询及回退接口");
            AddLog("输入参数:");
            AddLog("交易流水号:" + sDealID);

            hObj.CommitTradeState(sDealID, out sOut);

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

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            bool bRet = CheckOutputState(xmlDoc);

            if (bRet)
            {
                string  sTradeState;
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "output");
                sTradeState = dataNode.SelectNodes("tradestate")[0].InnerText;
                AddLog("解析XML结果:\r\n交易状态:" + sTradeState);
            }

            xmlDoc = null;

            AddLog("\r\n");

            return(bRet);
        }
Exemple #14
0
        /// <summary>
        /// 调用收据重打接口
        /// </summary>
        /// <param name="hObj"></param>
        /// <returns></returns>
        private bool RePrintInvoice(OutpatientClass hObj)
        {
            string sOut;
            string sDealID, sFeeNO;

            sDealID = "011100030A090115000014";
            sFeeNO  = "xxxxxx";

            AddLog("调用收据重打接口");
            AddLog("输入参数:");
            AddLog("交易流水号:" + sDealID);
            AddLog("收费单据号:" + sFeeNO);

            hObj.RePrintInvoice(sDealID, sFeeNO, out sOut);

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

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            bool bRet = CheckOutputState(xmlDoc);

            xmlDoc = null;

            AddLog("\r\n");
            return(bRet);
        }
Exemple #15
0
        private void cmdTrade_Click(object sender, EventArgs e)
        {
            AddLogLine();
            AddLog("交易确认接口测试");
            try
            {
                OutpatientClass hObj = new OutpatientClass();

                OpenDevice(hObj);

                GetPersonInfo(hObj);

                Divide(hObj);

                Trade(hObj);

                CloseDevice(hObj);

                hObj = null;
                MessageBox.Show("操作成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "发生错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #16
0
        /// <summary>
        /// 调用交易状态查询及回退接口
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public ResultClass CommitTradeState(OutpatientClass sDll, string tradeNo)
        {
            string sOut;
            string sMome = "";
            bool   bRet  = false;

            sDll.CommitTradeState(tradeNo, out sOut);

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            CheckOutputState(xmlDoc, out bRet, out sMome);
            if (bRet)
            {
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "output");
                sMome = dataNode.SelectNodes("tradestate")[0].InnerText;
            }

            xmlDoc = null;

            ResultClass resultClassTemp = new ResultClass();

            resultClassTemp.bSucess  = bRet;
            resultClassTemp.sRemarks = sMome;
            resultClassTemp.oResult  = null;
            return(resultClassTemp);
        }
Exemple #17
0
        private void cmdOpenCloseDevice_Click(object sender, EventArgs e)
        {
            AddLogLine();
            AddLog("打开读卡设备接口测试");
            try
            {
                OutpatientClass hObj = new OutpatientClass();

                if (!OpenDevice(hObj))
                {
                    return;
                }

                if (!CloseDevice(hObj))
                {
                    return;
                }

                hObj = null;
                MessageBox.Show("操作成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "发生错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #18
0
        /// <summary>
        /// 调用关闭读卡设备接口
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public ResultClass CloseDevice(OutpatientClass sDll)
        {
            string sMome = "";
            bool   bRet  = false;
            String sOut;

            sDll.Close(out sOut);
            XmlDocument xmlDoc = GetXmlDoc(sOut);

            CheckOutputState(xmlDoc, out bRet, out sMome);
            xmlDoc = null;
            ResultClass resultClassTemp = new ResultClass();

            resultClassTemp.bSucess  = bRet;
            resultClassTemp.sRemarks = sMome;
            resultClassTemp.oResult  = null;
            return(resultClassTemp);
        }
Exemple #19
0
        private void cmdMedicareQuery_Click(object sender, EventArgs e)
        {
            AddLogLine();
            AddLog("医保查询接口测试");
            try
            {
                OutpatientClass hObj = new OutpatientClass();

                MedicareQuery(hObj);

                hObj = null;
                MessageBox.Show("操作成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "发生错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #20
0
        /// <summary>
        /// 调用读取卡片信息接口
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public ResultClass GetCardInfo(OutpatientClass sDll, string cardNo)
        {
            string    sMome = "";
            bool      bRet  = false;
            DataTable dt    = new DataTable();
            String    sOut;

            _sColumns.Clear();
            _sColumns.Add("card_no");
            _sColumns.Add("ic_no");
            _sColumns.Add("id_no");
            _sColumns.Add("personname");
            _sColumns.Add("sex");
            _sColumns.Add("birthday");
            dt = CreatDataTable(_sColumns);

            sDll.GetCardInfo(out sOut);

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            CheckOutputState(xmlDoc, out bRet, out sMome);
            if (bRet)
            {
                DataRow dr       = dt.NewRow();
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "output/ic");
                foreach (string s in _sColumns)
                {
                    dr[s] = dataNode.SelectNodes(s)[0].InnerText;
                }
                dt.Rows.Add(dr);
                AddLog("解析读取卡片信息完成");
            }
            _sColumns.Clear();
            xmlDoc = null;

            ResultClass resultClassTemp = new ResultClass();

            resultClassTemp.bSucess  = bRet;
            resultClassTemp.sRemarks = sMome;
            resultClassTemp.oResult  = dt;
            return(resultClassTemp);
        }
Exemple #21
0
        /// <summary>
        /// 调用收据重打接口
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public ResultClass RePrintInvoice(OutpatientClass sDll, string tradeNo, string invoiceNo)
        {
            string sMome = "";
            bool   bRet  = false;
            string sOut;

            sDll.RePrintInvoice(tradeNo, invoiceNo, out sOut);

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            CheckOutputState(xmlDoc, out bRet, out sMome);
            xmlDoc = null;
            AddLog("\r\n");
            ResultClass resultClassTemp = new ResultClass();

            resultClassTemp.bSucess  = bRet;
            resultClassTemp.sRemarks = sMome;
            resultClassTemp.oResult  = null;
            return(resultClassTemp);
        }
Exemple #22
0
        /// <summary>
        /// 调用打开读卡设备接口
        /// </summary>
        /// <param name="hObj"></param>
        /// <returns></returns>
        private bool OpenDevice(OutpatientClass hObj)
        {
            String sOut;

            AddLog("调用打开读卡设备接口");
            AddLog("输入参数:无");

            hObj.Open(out sOut);

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

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            bool bRet = CheckOutputState(xmlDoc);

            xmlDoc = null;

            AddLog("\r\n");
            return(bRet);
        }
Exemple #23
0
        private void cndCommitTradeState_Click(object sender, EventArgs e)
        {
            AddLogLine();
            AddLog("交易状态查询及回退接口测试");
            try
            {
                OutpatientClass hObj = new OutpatientClass();

                OpenDevice(hObj);

                CommitTradeState(hObj);

                CloseDevice(hObj);

                hObj = null;
                MessageBox.Show("操作成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "发生错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #24
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);
        }
Exemple #25
0
        /// <summary>
        /// 调用医保查询接口
        /// </summary>
        /// <param name="hObj"></param>
        private void MedicareQuery(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=\"\">";
            sIn = sIn + "  </input>";
            sIn = sIn + "</root>";

            AddLog("调用医保查询接口");
            AddLog("输入参数:");
            AddLog(sIn);

            hObj.MedicareQuery(sIn, out sOut);

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

            AddLog("\r\n");
        }
Exemple #26
0
        /// <summary>
        /// 调用交易确认接口
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public ResultClass Trade(OutpatientClass sDll)
        {
            string sOut;
            string sMome = "";
            bool   bRet  = false;

            AddLog("调用交易确认接口");
            AddLog("输入参数:");

            sDll.Trade(out sOut);

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

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            string sPersonCountAfterSub = "0";

            CheckOutputState(xmlDoc, out bRet, out sMome);
            if (bRet)
            {
                XmlNode dataNode = GetNodeFromPath(xmlDoc.DocumentElement, "output");
                sPersonCountAfterSub = dataNode.SelectNodes("personcountaftersub")[0].InnerText;
                AddLog("解析XML结果:\r\n本次结算后个人账户余额:" + sPersonCountAfterSub);
            }

            xmlDoc = null;

            AddLog("\r\n");
            ResultClass resultClassTemp = new ResultClass();

            resultClassTemp.bSucess  = bRet;
            resultClassTemp.sRemarks = sMome;
            resultClassTemp.oResult  = sPersonCountAfterSub;
            return(resultClassTemp);
        }
Exemple #27
0
        /// <summary>
        /// 调用获取个人信息接口
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public ResultClass GetPersonInfo(OutpatientClass sDll, string cardNo)
        {
            ResultClass resultClassTemp = new ResultClass();

            string    sMome = "";
            bool      bRet  = false;
            string    sOut  = "";
            DataTable dt    = new DataTable();

            _sColumns.Clear();
            //ic卡
            _sColumns.Add("card_no");   //社保卡卡号
            _sColumns.Add("ic_no");
            _sColumns.Add("id_no");
            _sColumns.Add("personname");
            _sColumns.Add("sex");
            _sColumns.Add("birthday");
            _sColumns.Add("fromhosp");
            _sColumns.Add("fromhospdate");
            _sColumns.Add("fundtype");
            _sColumns.Add("isyt");
            _sColumns.Add("jclevel");
            _sColumns.Add("hospflag");
            //网络信息
            _sColumns.Add("persontype");
            _sColumns.Add("isinredlist");
            _sColumns.Add("isspecifiedhosp");
            _sColumns.Add("ischronichosp");
            _sColumns.Add("personcount");
            _sColumns.Add("chroniccode");
            dt = CreatDataTable(_sColumns);

            AddLog("调用获取个人信息接口");
            AddLog("输入参数:无");

            sDll.GetPersonInfo(out sOut);

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

            XmlDocument xmlDoc = GetXmlDoc(sOut);

            CheckOutputState(xmlDoc, out bRet, out sMome);

            if (bRet)
            {
                DataRow dr          = dt.NewRow();
                XmlNode dataNode    = GetNodeFromPath(xmlDoc.DocumentElement, "output/ic");
                XmlNode dataNodeNet = GetNodeFromPath(xmlDoc.DocumentElement, "output/net");
                foreach (string s in _sColumns)
                {
                    XmlNodeList xNodeList = dataNode.SelectNodes(s);
                    if (xNodeList.Count > 0)
                    {
                        dr[s] = xNodeList[0].InnerText;
                    }
                    else
                    {
                        dr[s] = dataNodeNet.SelectNodes(s)[0].InnerText;
                    }
                }
                dt.Rows.Add(dr);
                AddLog("解析获取个人信息接口完成");

                List <PatientInfo> patientInfoList = new List <PatientInfo>();
                foreach (DataRow drI in dt.Rows)
                {
                    PatientInfo patientInfo = new PatientInfo();
                    patientInfo.CardNo          = drI["card_no"].ToString();
                    patientInfo.IcNo            = drI["ic_no"].ToString();
                    patientInfo.IdNo            = drI["id_no"].ToString();
                    patientInfo.PersonName      = drI["personname"].ToString();
                    patientInfo.Sex             = drI["sex"].ToString();
                    patientInfo.Birthday        = drI["birthday"].ToString();
                    patientInfo.FromHosp        = drI["fromhosp"].ToString();
                    patientInfo.FromHospDate    = drI["fromhospdate"].ToString();
                    patientInfo.FundType        = drI["fundtype"].ToString();
                    patientInfo.IsYT            = drI["isyt"].ToString();
                    patientInfo.JcLevel         = drI["jclevel"].ToString();
                    patientInfo.HospFlag        = drI["hospflag"].ToString();
                    patientInfo.PersonType      = drI["persontype"].ToString();
                    patientInfo.IsInredList     = drI["isinredlist"].ToString();
                    patientInfo.IsSpecifiedHosp = drI["isspecifiedhosp"].ToString();
                    patientInfo.IsChronicHosp   = drI["ischronichosp"].ToString();
                    patientInfo.PersonCount     = drI["personcount"].ToString();
                    patientInfo.ChronIcCode     = drI["chroniccode"].ToString();
                    patientInfoList.Add(patientInfo);
                }

                resultClassTemp.oResult = patientInfoList;
            }
            xmlDoc = null;

            resultClassTemp.bSucess  = bRet;
            resultClassTemp.sRemarks = sMome;
            return(resultClassTemp);
        }
Exemple #28
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);
        }