using Newtonsoft.Json.Linq;
using PTMedicalInsurance.Business.Core.SelfServiceMachine.Process.InPat;
using PTMedicalInsurance.Business.Core.SelfServiceMachine.Process.ReadCard;
using PTMedicalInsurance.Variables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PTMedicalInsurance.Business.Core.SelfServiceMachine.ProcessScheduler
{
    class IPSettlementService
    {
        public IPSettlementService()
        {
            Global.pat.ecBusinessType = "01301";
        }
        /// <summary>
        /// 收费业务
        /// </summary>
        public string Charge( JObject joInput)
        {
            //joInput 包括( data、mdtrtinfo、diseinfo、settlement)
            ProcessManager pManager = new ProcessManager()
            ////重定向
            //.Add(new RedirectProcess())
            //物理读卡 + 1101
            .Add(new ReadCardProcess())
            // 根据返回的信息过滤无效信息，保留有效信息
            .Add(new FilterPatInfo())
            ////展示患者信息界面
            //.Add(new ShowPatInfo())
            // 设置患者信息全局变量
            .Add(new SetGlobalVariablesAfaterShowPatInfo())
            // 费用上传[2301] 
            .Add(new UploadFee())
            ////展示登记界面
            //.Add(new ShowOutPatRegisterForm())
            //验密
            .Add(new VerifyCardPassword())
            //自助机自动组织参数
            .Add(new OrganizeIPPatientInparam())
            // 出院登记[2402] 
            .Add(new DischargeRegistration())
            //// 事中业务
            //.Add(new InProcessHandler())
            // 住院预结算[2303]
            .Add(new PreSettlement())
            // 正式结算[2304]
            .Add(new Settlement());
            // 执行
            return pManager.Run(joInput);
        }
    }
}
