using Newtonsoft.Json.Linq;
using PTMedicalInsurance.Helper;
using PTMedicalInsurance.Variables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PTMedicalInsurance.Business.Core.SelfServiceMachine.Process.OutPat
{
    class ShowOutPatRegisterForm : AbstractProcess
    {
        public override CallResult Process(JObject input)
        {
            string errMsg;
            //校验HIS姓名与医保姓名是否一致
            if (hBus.checkName(Global.pat.name, out errMsg) != 0)
            {
                outParam = JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
                return Exception(-1,"",outParam);
            }

            //显示登记面板
            if (hBus.showOutPatRegisterForm(out outParam) != 0)
            {
                outParam = JsonHelper.setExceptionJson(-1, "显示登记面板", outParam).ToString();
                return Exception(-1, "", outParam);
            }

            return Success();
        }
    }
}
