示例#1
0
        public void SendResultTest()
        {
            //住院:201608928,bz,湖南省妇幼医院_广州邦弘
            //门诊:10152376,bz,湖南省妇幼医院_广州邦弘
            var            args     = "201702996,bz,湖南省妇幼医院_广州邦弘";
            var            values   = args.Split(',');
            var            hospName = values[2]; //医院名称
            var            pathoNo  = values[0]; //病理号
            ISendPisResult sender   = PisResultSenderFactory.GerResultSender(hospName);

            sender.SendResult(pathoNo);
        }
示例#2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            IniFiles f = new IniFiles("sz.ini");

            //Application.Run(new Form1());


            try
            {
                //检测如参是否合法,args[0]应为:病理号,bz
                if (args.Length < 1)
                {
                    var errMessage = "没有接到参数!";
                    throw new Exception(errMessage);
                }
            }
            catch (Exception e)
            {
                log.WriteMyLog("病理结果回传调用失败,因为参数错误:" + e.Message);
                MessageBox.Show("病理结果回传调用失败,因为参数错误:" + e.Message);
                return;
            }

            try
            {
                if (args[0].Contains(","))//简单接口
                {
                    ValidateSimpleArgs(args);
                    var values   = args[0].Split(',');
                    var hospName = values[2]; //医院名称
                    var pathoNo  = values[0]; //病理号
                    ISendPisResult.ISendPisResult sender = PisResultSenderFactory.GerResultSender(hospName);
                    sender.SendResult(pathoNo);
                }
                else//复杂接口
                {
                    //复杂接口,打印时上传
                    //args1[0] = 病理号^cg/bd/bc^bgxh^new/old^save/qxsh
                    if (CallSendResultPlus(args[0]))
                    {
                        return;
                    }
                }
            }
            catch (Exception e)
            {
                log.WriteMyLog("病理结果回传调用失败,因为:" + e.Message);
                MessageBox.Show("病理结果回传调用失败,因为:" + e.Message);
                return;
            }
        }
示例#3
0
 public void SendResultTest()
 {
     //住院:201608928,bz,湖南省妇幼医院_广州邦弘
     //门诊:10152376,bz,湖南省妇幼医院_广州邦弘
     var                args                = "172280,bz,广州中山附一_上海岱嘉";
     var                argsAdv             = "172280^cg^1^old^save";
     var                values              = args.Split(',');
     var                hospName            = values[2]; //医院名称
     var                pathoNo             = values[0]; //病理号
     ISendPisResult     sender              = PisResultSenderFactory.GerResultSender(hospName);
     ISendPisResultPlus senderPisResultPlus = PisResultSenderFactory.GerResultSenderPlus(hospName);
     //sender.SendResult(pathoNo);
     //senderPisResultPlus.SendResult(argsAdv);
 }
示例#4
0
        public void  CallSendResultPlus()
        {
            var args = "201700005^cg^1^old^save";

            if (args.IndexOf("^") > -1)
            {
                try
                {
                    string[] aa  = args.Split('^');
                    var      blh = aa[0].ToString();
                    blh = aa[0].ToString();
                    var bglx         = aa[1].ToString().ToLower(); //cg/bd/bc
                    var reportNumber = aa[2].ToString();
                    var czlb         = aa[3].ToString().ToLower(); //new/old
                    var dz           = aa[4].ToString().ToLower(); //save/qxsh/dy/qxdy

                    var reportType = ReportType.常规报告;
                    switch (bglx)
                    {
                    case "cg":
                    default:
                        reportType = ReportType.常规报告;
                        break;

                    case "bd":
                        reportType = ReportType.冰冻报告;
                        break;

                    case "bc":
                        reportType = ReportType.补充报告;
                        break;
                    }
                    EditType  editType = czlb == "new" ? EditType.新建 : EditType.修改;
                    PisAction pisAction;
                    switch (dz)
                    {
                    case "save":
                        pisAction = PisAction.新登记;
                        break;

                    case "qxsh":
                        pisAction = PisAction.取消审核;
                        break;

                    case "dy":
                        pisAction = PisAction.打印;
                        break;

                    case "qxdy":
                        pisAction = PisAction.取消打印;
                        break;

                    default:
                        pisAction = PisAction.未知;
                        break;
                    }

                    var hospName = "广州中山附一_上海岱嘉";

                    ISendPisResultPlus sender = PisResultSenderFactory.GerResultSenderPlus(hospName);
                    sender.SendResult(blh, reportType, reportNumber, editType, pisAction, hospName);
                }
                catch
                {
                    throw;
                }
            }
        }
示例#5
0
        public static bool CallSendResultPlus(string args)
        {
            log.WriteMyLog("EXE被调用,入参:" + args);

            if (args.IndexOf("^") > -1)
            {
                log.WriteMyLog("开始复杂接口处理,入参:" + args);

                var        blh  = "";
                var        bglx = ""; //cg/bd/bc
                var        bgxh = "";
                var        czlb = ""; //new/old
                var        dz   = ""; //save/qxsh/dy/qxdy
                EditType   editType;
                PisAction  pisAction;
                string     hospName;
                ReportType reportType;

                try
                {
                    string[] aa = args.Split('^');
                    blh  = aa[0].ToString();
                    bglx = aa[1].ToString().ToLower(); //cg/bd/bc
                    bgxh = aa[2].ToString();           //bgxh
                    czlb = aa[3].ToString().ToLower(); //new/old
                    dz   = aa[4].ToString().ToLower(); //save/qxsh/dy/qxdy

                    reportType = ReportType.常规报告;
                    switch (bglx)
                    {
                    case "cg":
                    default:
                        reportType = ReportType.常规报告;
                        break;

                    case "bd":
                        reportType = ReportType.冰冻报告;
                        break;

                    case "bc":
                        reportType = ReportType.补充报告;
                        break;
                    }
                    editType = czlb == "new" ? EditType.新建 : EditType.修改;
                    switch (dz)
                    {
                    case "save":
                        pisAction = PisAction.新登记;
                        break;

                    case "qxsh":
                        pisAction = PisAction.取消审核;
                        break;

                    case "dy":
                        pisAction = PisAction.打印;
                        break;

                    case "qxdy":
                        pisAction = PisAction.取消打印;
                        break;

                    default:
                        pisAction = PisAction.未知;
                        break;
                    }

                    hospName = IniFiles.GetInstant("sz.ini").ReadString("savetohis", "yymc", "123").Replace("\0", "");
                }
                catch
                {
                    log.WriteMyLog("传入参数解析出错");
                    return(true);
                }

                try
                {
                    ISendPisResultPlus sender = PisResultSenderFactory.GerResultSenderPlus();
                    sender.SendResult(blh, reportType, bgxh, editType, pisAction, hospName);
                }
                catch (Exception e)
                {
                    log.WriteMyLog("接口调用时出错,入参=:" + args + "\r\n" +
                                   "异常信息:+\r\n" + e);
                    return(true);
                }
            }
            return(false);
        }