|
@@ -844,7 +844,7 @@ public class SiQueryService {
|
|
|
return ResultVoUtil.success(dao.selectInsuplcAdmdvsByMdtrtId(mdtrtId));
|
|
|
}
|
|
|
|
|
|
- public ResultVo querySiSetlList(SetlIndex index) {
|
|
|
+ public ResultVo<InptntSetlmtLst> queryInpatientSetlList(SetlIndex index) {
|
|
|
if (null == index.getTimes() && StringUtil.isBlank(index.getLabel())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算条目不能为空!");
|
|
|
}
|
|
@@ -852,11 +852,7 @@ public class SiQueryService {
|
|
|
String[] arr = index.getLabel().split("_");
|
|
|
index.setSetlId(arr[0]);
|
|
|
index.setTimes(Integer.parseInt(arr[1]));
|
|
|
- if (index.getType() == SetlType.INPATIENT.getCode()) {
|
|
|
- index.setLedgerSn(Integer.parseInt(arr[2]));
|
|
|
- } else {
|
|
|
- index.setLedgerSn(0);
|
|
|
- }
|
|
|
+ index.setLedgerSn(Integer.parseInt(arr[2]));
|
|
|
} else {
|
|
|
index.setLedgerSn(0);
|
|
|
index.setSetlId(dao.selectSetlId(index.getPatNo(), index.getTimes(), index.getLedgerSn()));
|
|
@@ -869,77 +865,97 @@ public class SiQueryService {
|
|
|
if (cuminfo.getCode() != ExceptionEnum.SUCCESS.getCode()) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, cuminfo.getMessage());
|
|
|
}
|
|
|
- if (index.getType() == SetlType.INPATIENT.getCode()) {
|
|
|
- InptntSetlmtLst lst = dao.selectZySetlinfo(index.getSetlId(), "zy_inactpatient");
|
|
|
+ InptntSetlmtLst lst = dao.selectZySetlinfo(index.getSetlId(), "zy_inactpatient");
|
|
|
+ if (null == lst) {
|
|
|
+ lst = dao.selectZySetlinfo(index.getSetlId(), "zy_actpatient");
|
|
|
if (null == lst) {
|
|
|
- lst = dao.selectZySetlinfo(index.getSetlId(), "zy_actpatient");
|
|
|
- if (null == lst) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到此患者的结算信息!");
|
|
|
- }
|
|
|
- }
|
|
|
- lst.setInHospdays(DateUtil.daysBetween(lst.getEndtime(), lst.getBegntime()));
|
|
|
- PsnIdetType psnIdetType = PsnIdetType.get(lst.getPsnIdetType());
|
|
|
- if (null != psnIdetType) {
|
|
|
- lst.setPsnIdetTypeName(psnIdetType.getName());
|
|
|
- }
|
|
|
- Admdvs admdvs = Admdvs.get(lst.getInsuplcAdmdvs());
|
|
|
- if (null == admdvs) {
|
|
|
- lst.setInsuplcAdmdvsName(redis.getRegionName(lst.getInsuplcAdmdvs()));
|
|
|
- } else {
|
|
|
- lst.setInsuplcAdmdvsName(admdvs.getName());
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到此患者的结算信息!");
|
|
|
}
|
|
|
- lst.setFixmedinsName(SiUtil.INSTITUTION_NAME);
|
|
|
- lst.setGendName(Gend.get(lst.getGend()).getName());
|
|
|
- SiEnumReflectUtil.inptntSetlmtLstReflect(lst);
|
|
|
+ }
|
|
|
+ lst.setInHospdays(DateUtil.daysBetween(lst.getEndtime(), lst.getBegntime()));
|
|
|
+ PsnIdetType psnIdetType = PsnIdetType.get(lst.getPsnIdetType());
|
|
|
+ if (null != psnIdetType) {
|
|
|
+ lst.setPsnIdetTypeName(psnIdetType.getName());
|
|
|
+ }
|
|
|
+ Admdvs admdvs = Admdvs.get(lst.getInsuplcAdmdvs());
|
|
|
+ if (null == admdvs) {
|
|
|
+ lst.setInsuplcAdmdvsName(redis.getRegionName(lst.getInsuplcAdmdvs()));
|
|
|
+ } else {
|
|
|
+ lst.setInsuplcAdmdvsName(admdvs.getName());
|
|
|
+ }
|
|
|
+ lst.setFixmedinsName(SiUtil.INSTITUTION_NAME);
|
|
|
+ lst.setGendName(Gend.get(lst.getGend()).getName());
|
|
|
+ SiEnumReflectUtil.inptntSetlmtLstReflect(lst);
|
|
|
+ ResultVo<List<SiSetlFeeDetl>> chrgrsvo = getChrgitems(lst.getPsnNo(), lst.getSetlId(), lst.getMdtrtId(), lst.getInsuplcAdmdvs());
|
|
|
+ if (!chrgrsvo.getCode().equals(ExceptionEnum.SUCCESS.getCode())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, chrgrsvo.getMessage());
|
|
|
+ }
|
|
|
+ ChrgItemLvInfo chrgItemLvInfo = analyzeParticularChrgitmLv(chrgrsvo.getData());
|
|
|
+ lst.setChrgItemLvInfo(chrgItemLvInfo);
|
|
|
+ lst.setCuminfo(cuminfo);
|
|
|
+ ResultVo<PolItemInfo> polItemRes = listPolItemCodePayInfo(lst.getPsnNo(), lst.getMdtrtId(), lst.getSetlId(), lst.getInsuplcAdmdvs());
|
|
|
+ if (polItemRes.getCode() != ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, polItemRes.getMessage());
|
|
|
+ }
|
|
|
+ lst.setPolItemInfo(polItemRes.getData());
|
|
|
+ return ResultVoUtil.success(lst);
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<OtptntSetlmtLst> queryOutpatientSetlList(SetlIndex index) {
|
|
|
+ if (null == index.getTimes() && StringUtil.isBlank(index.getLabel())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算条目不能为空!");
|
|
|
+ }
|
|
|
+ if (StringUtil.notBlank(index.getLabel())) {
|
|
|
+ String[] arr = index.getLabel().split("_");
|
|
|
+ index.setSetlId(arr[0]);
|
|
|
+ index.setTimes(Integer.parseInt(arr[1]));
|
|
|
+ index.setLedgerSn(0);
|
|
|
+ } else {
|
|
|
+ index.setLedgerSn(0);
|
|
|
+ index.setSetlId(dao.selectSetlId(index.getPatNo(), index.getTimes(), index.getLedgerSn()));
|
|
|
+ }
|
|
|
+ SiPatInfo siPatInfo = dao.selectSiPatInfo(index.getPatNo(), index.getTimes(), index.getLedgerSn());
|
|
|
+ if (null == siPatInfo) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到此患者的结算信息!");
|
|
|
+ }
|
|
|
+ CuminfoInYear cuminfo = getYearCuminfo(siPatInfo.getPsnNo(), siPatInfo.getInsuplcAdmdvs());
|
|
|
+ if (cuminfo.getCode() != ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, cuminfo.getMessage());
|
|
|
+ }
|
|
|
+ index.setLedgerSn(0);
|
|
|
+ OtptntSetlmtLst lst = dao.selectMzSetlifo(index.getPatNo(), index.getTimes());
|
|
|
+ if (null == lst) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到此患者的结算信息!");
|
|
|
+ }
|
|
|
+ lst.setPsnCertTypeName(PsnCertType.get(lst.getPsnCertType()).getName());
|
|
|
+ lst.setPsnIdetTypeName(PsnIdetType.getName(lst.getPsnIdetType()));
|
|
|
+ Admdvs admdvs = Admdvs.get(lst.getInsuplcAdmdvs());
|
|
|
+ if (null == admdvs) {
|
|
|
+ lst.setInsuplcAdmdvsName(redis.getRegionName(lst.getInsuplcAdmdvs()));
|
|
|
+ } else {
|
|
|
+ lst.setInsuplcAdmdvsName(admdvs.getName());
|
|
|
+ }
|
|
|
+ SiEnumReflectUtil.outptntSetlmtLstReflect(lst);
|
|
|
+ List<BrfChrgitm> chrgitms = dao.selectMzBrfChrgitms(index.getPatNo(), index.getTimes());
|
|
|
+ lst.setCuminfo(cuminfo);
|
|
|
+ lst.setFixmedinsName(SiUtil.INSTITUTION_NAME);
|
|
|
+ Insutype insutype = Insutype.get(lst.getInsutype());
|
|
|
+ if (insutype == Insutype.BASIC_MEDICAL_INSURANCE_FOR_EMPLOYEES) {
|
|
|
ResultVo<List<SiSetlFeeDetl>> chrgrsvo = getChrgitems(lst.getPsnNo(), lst.getSetlId(), lst.getMdtrtId(), lst.getInsuplcAdmdvs());
|
|
|
if (!chrgrsvo.getCode().equals(ExceptionEnum.SUCCESS.getCode())) {
|
|
|
- return chrgrsvo;
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, chrgrsvo.getMessage());
|
|
|
}
|
|
|
ChrgItemLvInfo chrgItemLvInfo = analyzeParticularChrgitmLv(chrgrsvo.getData());
|
|
|
lst.setChrgItemLvInfo(chrgItemLvInfo);
|
|
|
- lst.setCuminfo(cuminfo);
|
|
|
ResultVo<PolItemInfo> polItemRes = listPolItemCodePayInfo(lst.getPsnNo(), lst.getMdtrtId(), lst.getSetlId(), lst.getInsuplcAdmdvs());
|
|
|
if (polItemRes.getCode() != ExceptionEnum.SUCCESS.getCode()) {
|
|
|
- return polItemRes;
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, polItemRes.getMessage());
|
|
|
}
|
|
|
lst.setPolItemInfo(polItemRes.getData());
|
|
|
- return ResultVoUtil.success(lst);
|
|
|
} else {
|
|
|
- index.setLedgerSn(0);
|
|
|
- OtptntSetlmtLst lst = dao.selectMzSetlifo(index.getPatNo(), index.getTimes());
|
|
|
- if (null == lst) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到此患者的结算信息!");
|
|
|
- }
|
|
|
- lst.setPsnCertTypeName(PsnCertType.get(lst.getPsnCertType()).getName());
|
|
|
- lst.setPsnIdetTypeName(PsnIdetType.getName(lst.getPsnIdetType()));
|
|
|
- Admdvs admdvs = Admdvs.get(lst.getInsuplcAdmdvs());
|
|
|
- if (null == admdvs) {
|
|
|
- lst.setInsuplcAdmdvsName(redis.getRegionName(lst.getInsuplcAdmdvs()));
|
|
|
- } else {
|
|
|
- lst.setInsuplcAdmdvsName(admdvs.getName());
|
|
|
- }
|
|
|
- SiEnumReflectUtil.outptntSetlmtLstReflect(lst);
|
|
|
- List<BrfChrgitm> chrgitms = dao.selectMzBrfChrgitms(index.getPatNo(), index.getTimes());
|
|
|
- lst.setCuminfo(cuminfo);
|
|
|
- lst.setFixmedinsName(SiUtil.INSTITUTION_NAME);
|
|
|
- Insutype insutype = Insutype.get(lst.getInsutype());
|
|
|
- if (insutype == Insutype.BASIC_MEDICAL_INSURANCE_FOR_EMPLOYEES) {
|
|
|
- ResultVo<List<SiSetlFeeDetl>> chrgrsvo = getChrgitems(lst.getPsnNo(), lst.getSetlId(), lst.getMdtrtId(), lst.getInsuplcAdmdvs());
|
|
|
- if (!chrgrsvo.getCode().equals(ExceptionEnum.SUCCESS.getCode())) {
|
|
|
- return chrgrsvo;
|
|
|
- }
|
|
|
- ChrgItemLvInfo chrgItemLvInfo = analyzeParticularChrgitmLv(chrgrsvo.getData());
|
|
|
- lst.setChrgItemLvInfo(chrgItemLvInfo);
|
|
|
- ResultVo<PolItemInfo> polItemRes = listPolItemCodePayInfo(lst.getPsnNo(), lst.getMdtrtId(), lst.getSetlId(), lst.getInsuplcAdmdvs());
|
|
|
- if (polItemRes.getCode() != ExceptionEnum.SUCCESS.getCode()) {
|
|
|
- return polItemRes;
|
|
|
- }
|
|
|
- lst.setPolItemInfo(polItemRes.getData());
|
|
|
- } else {
|
|
|
- analyzeMzChrgitm(lst, chrgitms);
|
|
|
- }
|
|
|
- return ResultVoUtil.success(lst);
|
|
|
+ analyzeMzChrgitm(lst, chrgitms);
|
|
|
}
|
|
|
+ return ResultVoUtil.success(lst);
|
|
|
}
|
|
|
|
|
|
private ResultVo<PolItemInfo> listPolItemCodePayInfo(String psnNo, String mdtrtId, String setlId, String insuplc) {
|