示例#1
0
        public void Init()
        {
            _process = A.Fake<IProcessWrapper>();
            _processManager = A.Fake<IProcessManager>();
            A.CallTo(() => _processManager.GetProcess(Executable, Parameters)).Returns(_process);
            A.CallTo(() => _process.Start()).Invokes(x => InitStartInternalUpdates()).Returns(true);

            _command = new Command(_processManager, Name, Executable, Parameters, KillChildren);
        }
        public void Handle(ProcessInternalStateChangedEvent eventData)
        {
            if (eventData.Process.Channel == Metadata.Channel.< %= classify(name) % > &&
                                                                   eventData.Process.Type == ProcessType.Refund)
            {
                var chargeProcess = _processManager.GetProcess(eventData.Process.ChargeProcessId.Value);

                var patient      = chargeProcess.GetDataStoreItem(nameof(PreSettleAction.Patient));
                var hisData      = chargeProcess.GetDataStoreItem(nameof(PreSettleAction.HisData));
                var settleResult = chargeProcess.GetDataStoreItem(nameof(SettleAction.SettleResult));
                eventData.Process.SetDataStoreItem("patient", patient);
                eventData.Process.SetDataStoreItem("hisData", hisData);
                eventData.Process.SetDataStoreItem("settleResult", settleResult);
            }
        }
示例#3
0
        public void Handle(ProcessInternalStateChangedEvent eventData)
        {
            try
            {
                // his data;
                var chargeReceipt = _processManager.GetProcess(eventData.Process.ChargeProcessId.Value).Receipt;
                var refundReceipt = _receiptProvider.GenerateRefundReceipt(chargeReceipt);

                eventData.Process.Receipt = refundReceipt;
                eventData.Process.Action(new GenerateReceiptAction());
            }
            catch (Exception ex)
            {
                Logger.Error($"处理收据时报错:processId:{eventData.Process.Id}, error:{ex}");

                eventData.Process.Action(new SettleFailAction
                {
                    Error = "医保已结算,但生成收据失败。请手动检查此单"
                });
            }
        }