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

namespace PTMedicalInsurance.Business.Core.SelfServiceMachine.Process.InPat
{
    class DischargeRegistration : AbstractProcess
    {
        public override CallResult Process(JObject input)
        {
            JObject jo2402Inpar = JObject.Parse(JsonHelper.getDestValue(input, "DischargeRegister"));

            //昆明出院登记放再预结算之前
            JObject jo2402Rtn = invoker.invokeCenterService("2402", JsonHelper.setCenterInpar("2402", jo2402Inpar));
            if (JsonHelper.parseCenterRtnValue(jo2402Rtn, out errMsg) != 0)
            {
                outParam = JsonHelper.setExceptionJson(-1, "预结算失败：出院登记失败", errMsg).ToString();
                return Exception(outParam);
            }

            outParam = input.ToString();
            return Success();
        }
    }
}
