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

namespace PTMedicalInsurance.Business
{
    class LocalOPSettleService : IChargeService
    {
        public string Charge(string operationType, JObject joInput)
        {
            //joInput 包括( data、mdtrtinfo、diseinfo、settlement)
            ProcessManager pManager = new ProcessManager()
            .Add(new ReadPatientProcess())
            // 挂号[2201] 
            .Add(new OPRegFakeProcess())
            // 门诊预结算[2206]
            .Add(new OPPreSettlementProcess())
            // 正式结算[2207]
            .Add(new OPSettlementProcess());
            // 执行
            return pManager.Run(joInput);
        }

        public string DisCharge(JObject joParam)
        {
            ProcessManager pManager = new ProcessManager()
                // 查询结算信息
                .Add(new OPQuerySettlementProcess())
                // 门诊结算撤销 [2208]
                .Add(new OPSettlementCancelProcess())
                // 退HIS结算
                .Add(new OPSettlementCancelHisProcess(true));

            // 执行
            return pManager.Run(joParam);
        }
    }
}
