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 IPAdmRegService
    {
        public IPAdmRegService()
        {
            Global.pat.ecBusinessType = "01103";
        }
        
        /// <summary>
        /// 登记业务
        /// </summary>
        public string Register(string operationType, Newtonsoft.Json.Linq.JObject joInput)
        {
            //joInput 包括( data、mdtrtinfo、diseinfo、settlement)
            ProcessManager pManager = new ProcessManager()
            ////重定向
            //.Add(new RedirectProcess())
            //物理读卡 + 1101
            .Add(new ReadCardProcess())
            // 根据返回的信息过滤无效信息，保留有效信息
            .Add(new FilterPatInfo())
            // 设置患者信息全局变量
            .Add(new SetGlobalVariablesAfaterShowPatInfo())
            // 判断姓名是否一致
            .Add(new VerifyNameConsistency())
            ////自助机自动组织参数
            //.Add(new OrganizePatientRegistrationInfo())
            // 获取入院登记相关条件
            .Add(new GetAdmissionRequirements())
            // 入院登记[2401]
            .Add(new AdmissionRegistration());
            // 执行
            return pManager.Run(joInput);

        }

        /// <summary>
        /// 登记业务
        /// </summary>
        public string CancelRegister(string operationType, Newtonsoft.Json.Linq.JObject joInput)
        {
            //joInput 包括( data、mdtrtinfo、diseinfo、settlement)
            ProcessManager pManager = new ProcessManager()
            // 入院登记[2401]
            .Add(new CancelAdmissionRegistration());
            // 执行
            return pManager.Run(joInput);

        }
    }
}
