/// <summary> /// 门诊结算查询 /// </summary> /// <param name="param"></param> /// <returns></returns> public QueryOutpatientDepartmentCostjsonDto QueryOutpatientDepartmentCost(UiBaseDataParam param) { var resultData = new QueryOutpatientDepartmentCostjsonDto(); var userBase = _serviceBasicService.GetUserBaseInfo(param.UserId); userBase.TransKey = param.TransKey; var outpatientSettlementNo = _serviceBasicService.GetOutpatientSettlementNo(new GetOutpatientSettlementNoParam() { BusinessId = param.BusinessId, User = userBase }); //获取医保病人信息 var queryResidentParam = new QueryMedicalInsuranceResidentInfoParam() { BusinessId = param.BusinessId, OrganizationCode = userBase.OrganizationCode, SettlementNo = outpatientSettlementNo }; var outpatient = _hisSqlRepository.QueryOutpatient(new QueryOutpatientParam() { BusinessId = param.BusinessId }); if (outpatient == null) { throw new Exception("当前病人查找失败!!!"); } var residentData = _medicalInsuranceSqlRepository.QueryMedicalInsuranceResidentInfo(queryResidentParam); if (residentData == null) { throw new Exception("当前病人未结算,无结算数据!!!"); } if (residentData.MedicalInsuranceState != MedicalInsuranceState.HisSettlement) { throw new Exception("当前病人无结算数据!!!"); } resultData.ReimbursementExpensesAmount = residentData.ReimbursementExpensesAmount; resultData.SelfPayFeeAmount = residentData.SelfPayFeeAmount; resultData.AllAmount = residentData.MedicalInsuranceAllAmount; return(resultData); }