|
@@ -42,7 +42,8 @@ public class MedicalViewApiController {
|
|
|
private ZdUnitCodeService zdUnitCodeService;
|
|
|
@Autowired
|
|
|
private MzBillItemService mzBillItemService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private APatientMiService aPatientMiService;
|
|
|
//海慈身份证类型
|
|
|
private static final String ID_CARD_TYPE = "11";
|
|
|
//海慈参数男性
|
|
@@ -89,7 +90,7 @@ public class MedicalViewApiController {
|
|
|
return results;
|
|
|
}
|
|
|
results.put("resultCode", 0);
|
|
|
- MzPatientMi mzPatientMi = mzPatientMis.get(0);
|
|
|
+ MzPatientMi mzPatientMi=mzPatientMis.get(0);
|
|
|
results.put("patName", mzPatientMi.getName());
|
|
|
results.put("patSex", YesNoEnum.YES.code.equals(mzPatientMi.getSex()) ? MAN : WONMAN);
|
|
|
results.put("patAge", mzPatientMi.getAge());
|
|
@@ -100,6 +101,13 @@ public class MedicalViewApiController {
|
|
|
results.put("patIdNo", mzPatientMi.getSocialNo());
|
|
|
results.put("patCardType", YesNoEnum.YES.code);
|
|
|
results.put("patCardNo", mzPatientMi.getIcCardNo());
|
|
|
+ results.put("patHisNo", mzPatientMi.getPatientId());
|
|
|
+ List<String> inPatientNos=aPatientMiService.queryInPatientNoByMzNo(mzPatientMi.getPatientId());
|
|
|
+ if(inPatientNos!=null && inPatientNos.size()>0){
|
|
|
+ results.put("inPatientNo", inPatientNos.get(0));
|
|
|
+ }else {
|
|
|
+ results.put("inPatientNo", "");
|
|
|
+ }
|
|
|
return results;
|
|
|
}
|
|
|
|
|
@@ -449,6 +457,7 @@ public class MedicalViewApiController {
|
|
|
MzPatientMi mzPatientMi = mzPatientMiService.queryByIcCardNo(haicipat.getPatCardNo());
|
|
|
if (mzPatientMi == null) {
|
|
|
results.put("resultCode", -1);
|
|
|
+ log.warn("海慈传入的病人卡号查询不到对应的患者信息,卡号信息:" + haicipat.getPatCardNo());
|
|
|
results.put("resultMessage", "患者诊疗卡号查询不到对应的患者信息");
|
|
|
return results;
|
|
|
}
|
|
@@ -471,7 +480,7 @@ public class MedicalViewApiController {
|
|
|
map.put("totalAmt", totalAmount);
|
|
|
map.put("medInsAmt", BigDecimal.ZERO);
|
|
|
map.put("selfAmt", totalAmount);
|
|
|
- map.put("priceTime", DateUtil.fomart(mzChargeDetail.getPriceTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ map.put("priceTime", DateUtil.fomart(mzChargeDetail.getPriceTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
returnList.add(map);
|
|
|
}
|
|
|
results.put("resultCode", 0);
|
|
@@ -529,14 +538,14 @@ public class MedicalViewApiController {
|
|
|
}
|
|
|
mzChargeDetailList = mzChargeDetailService.getMzChargeDetails(mzChargeDetailList);
|
|
|
List<Map<String, Object>> returnList = new ArrayList<>();
|
|
|
- Map<String,ZdUnitCode> unitCodeMap = new HashMap<>();
|
|
|
- List<MzBillItem> mzBillItems= mzBillItemService.queryMzBillItem();
|
|
|
+ Map<String, ZdUnitCode> unitCodeMap = new HashMap<>();
|
|
|
+ List<MzBillItem> mzBillItems = mzBillItemService.queryMzBillItem();
|
|
|
Map<String, String> mzBillItemMap = null;
|
|
|
if (mzBillItems != null) {
|
|
|
mzBillItemMap = mzBillItems.stream().collect(Collectors.toMap(MzBillItem::getCode, MzBillItem::getName));
|
|
|
}
|
|
|
for (MzChargeDetail mz : mzChargeDetailList) {
|
|
|
- if(Arrays.asList(Constants.TC,Constants.SSWRF).contains(mz.getBillItemCode())){
|
|
|
+ if (Arrays.asList(Constants.TC, Constants.SSWRF).contains(mz.getBillItemCode())) {
|
|
|
continue;
|
|
|
}
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
@@ -547,6 +556,7 @@ public class MedicalViewApiController {
|
|
|
if (BigDecimal.ZERO.equals(unitPrice)) {
|
|
|
unitPrice = BigDecimal.valueOf(0.01D);
|
|
|
}
|
|
|
+
|
|
|
unitPrice = unitPrice.multiply(BigDecimal.valueOf(100));
|
|
|
map.put("itemPrice", unitPrice);
|
|
|
map.put("itemSpec", "");
|
|
@@ -554,16 +564,16 @@ public class MedicalViewApiController {
|
|
|
BigDecimal drugWin = mz.getDrugWin() == null ? BigDecimal.ONE : BigDecimal.valueOf(mz.getDrugWin());
|
|
|
map.put("itemNumber", quantity.multiply(drugWin));
|
|
|
map.put("itemTotalFee", unitPrice.multiply(quantity).multiply(drugWin));
|
|
|
- ZdUnitCode unitCode=unitCodeMap.get(mz.getExecDept());
|
|
|
- if(unitCode==null && StringUtils.isNotBlank(mz.getExecDept())){
|
|
|
- unitCode=zdUnitCodeService.queryByCode(mz.getExecDept());
|
|
|
- unitCodeMap.put(mz.getExecDept(),unitCode);
|
|
|
+ ZdUnitCode unitCode = unitCodeMap.get(mz.getExecDept());
|
|
|
+ if (unitCode == null && StringUtils.isNotBlank(mz.getExecDept())) {
|
|
|
+ unitCode = zdUnitCodeService.queryByCode(mz.getExecDept());
|
|
|
+ unitCodeMap.put(mz.getExecDept(), unitCode);
|
|
|
}
|
|
|
- if(mzBillItemMap!=null){
|
|
|
+ if (mzBillItemMap != null) {
|
|
|
map.put("itemType", mzBillItemMap.get(mz.getBillItemCode()));
|
|
|
}
|
|
|
- map.put("execDeptName", unitCode==null?"":unitCode.getName());
|
|
|
- map.put("execDeptAddress", (unitCode==null || unitCode.getOfficePos()==null)?"":unitCode.getOfficePos());
|
|
|
+ map.put("execDeptName", unitCode == null ? "" : unitCode.getName());
|
|
|
+ map.put("execDeptAddress", (unitCode == null || unitCode.getOfficePos() == null) ? "" : unitCode.getOfficePos());
|
|
|
returnList.add(map);
|
|
|
}
|
|
|
results.put("resultCode", 0);
|
|
@@ -879,7 +889,6 @@ public class MedicalViewApiController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 门诊已缴费记录明细查询 医患通已收费记录查询
|
|
|
*
|
|
@@ -898,7 +907,7 @@ public class MedicalViewApiController {
|
|
|
String[] arr = djh.split("_");
|
|
|
MzChargeDetail mzChargeDetail = new MzChargeDetail(arr[0], Integer.valueOf(arr[1]));
|
|
|
mzChargeDetail.setReceiptNo(Integer.valueOf(arr[2]));
|
|
|
- List<MzChargeDetail> mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(),mzChargeDetail.getReceiptNo(), PayMarkEnum.CHARGED.code, "2", Arrays.asList("TC"));
|
|
|
+ List<MzChargeDetail> mzChargeDetailList = mzChargeDetailService.queryMzChargeDetailByBillItemCode(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), mzChargeDetail.getReceiptNo(), PayMarkEnum.CHARGED.code, "2", Arrays.asList("TC"));
|
|
|
if (mzChargeDetailList == null || mzChargeDetailList.size() == 0) {
|
|
|
results.put("resultCode", -1);
|
|
|
results.put("resultMessage", "未查询到待缴费明细记录");
|
|
@@ -909,26 +918,26 @@ public class MedicalViewApiController {
|
|
|
SfjkMzbrmxVo sfjkMzbrmxVo = new SfjkMzbrmxVo();
|
|
|
sfjkMzbrmxVo.setMzbh(djh);
|
|
|
sfjkMzbrmxVo.setXmmc(mz.getTcName());
|
|
|
- if(StringUtils.isNotBlank(mz.getSupplyCode())){
|
|
|
- MzZdSupplyType mzZdSupplyType=zdSupplyTypeService.selectMzZdSupplyTypeByCode(mz.getSupplyCode());
|
|
|
- if(mzZdSupplyType!=null){
|
|
|
+ if (StringUtils.isNotBlank(mz.getSupplyCode())) {
|
|
|
+ MzZdSupplyType mzZdSupplyType = zdSupplyTypeService.selectMzZdSupplyTypeByCode(mz.getSupplyCode());
|
|
|
+ if (mzZdSupplyType != null) {
|
|
|
sfjkMzbrmxVo.setYpyf(mzZdSupplyType.getSupplyName());
|
|
|
}
|
|
|
}
|
|
|
sfjkMzbrmxVo.setJcjg("");
|
|
|
- BigDecimal zsl=BigDecimal.ZERO;
|
|
|
- if(mz.getDrugWin()!=null){
|
|
|
- zsl=BigDecimal.valueOf(mz.getDrugWin());
|
|
|
+ BigDecimal zsl = BigDecimal.ZERO;
|
|
|
+ if (mz.getDrugWin() != null) {
|
|
|
+ zsl = BigDecimal.valueOf(mz.getDrugWin());
|
|
|
}
|
|
|
- if(mz.getQuantity()==null){
|
|
|
- zsl=BigDecimal.ZERO;
|
|
|
- }else {
|
|
|
- zsl=zsl.multiply(BigDecimal.valueOf(mz.getQuantity()));
|
|
|
+ if (mz.getQuantity() == null) {
|
|
|
+ zsl = BigDecimal.ZERO;
|
|
|
+ } else {
|
|
|
+ zsl = zsl.multiply(BigDecimal.valueOf(mz.getQuantity()));
|
|
|
}
|
|
|
sfjkMzbrmxVo.setZsl(zsl.toString());
|
|
|
- if(mz.getUnitPrice()==null){
|
|
|
+ if (mz.getUnitPrice() == null) {
|
|
|
sfjkMzbrmxVo.setZfy(BigDecimal.ZERO);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
sfjkMzbrmxVo.setZfy(zsl.multiply(mz.getUnitPrice()));
|
|
|
}
|
|
|
returnList.add(sfjkMzbrmxVo);
|