|
@@ -303,7 +303,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
returnMzChargeDetail.setDiscountAmount(returnMzChargeDetail.getNotDiscountAmount().subtract(returnMzChargeDetail.getAmount()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
|
|
Map<String, Object> insuinfoMap = tsmzService.queryInsuinfo(Constants.BRZZJF_CODE, mzChargeDetail.getPatientId());
|
|
|
if (insuinfoMap != null && insuinfoMap.size() > 0) {
|
|
|
- if(Integer.valueOf(0).equals(insuinfoMap.get("code"))){
|
|
|
+ if (Integer.valueOf(0).equals(insuinfoMap.get("code"))) {
|
|
|
returnMzChargeDetail.setCountYbZf(1);
|
|
|
}
|
|
|
}
|
|
@@ -325,7 +325,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
}
|
|
|
List<MzYjReq> mzYjReqs = mzYjReqService.queryNotPayMzYjReq(new MzYjReq(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes()));
|
|
|
List<MzChargeDetail> mzChargeDetailList = mzChargeDetailMapper.selectMzChargeDetailByPatientId("mz_charge_detail", mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(), null, PayMarkEnum.NO_CHARGE.code);
|
|
|
- return getMzChargeDetails(mzChargeDetail, yesNo, receiptNo, mzYjReqs, mzChargeDetailList,null);
|
|
|
+ return getMzChargeDetails(mzChargeDetail, yesNo, receiptNo, mzYjReqs, mzChargeDetailList, null);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -336,11 +336,11 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
* @param receiptNo 缴费次数
|
|
|
* @param mzYjReqs 医技申请记录
|
|
|
* @param mzChargeDetailList 药品记录明细
|
|
|
- * @param zgmztczf 是否使用职工统筹支付 1是 0否 空不做判断
|
|
|
+ * @param zgmztczf 是否使用职工统筹支付 1是 0否 空不做判断
|
|
|
* @return
|
|
|
* @throws MzException
|
|
|
*/
|
|
|
- private List<MzChargeDetail> getMzChargeDetails(MzChargeDetail mzChargeDetail, YesNoEnum yesNo, Integer receiptNo, List<MzYjReq> mzYjReqs, List<MzChargeDetail> mzChargeDetailList,Integer zgmztczf) throws MzException {
|
|
|
+ private List<MzChargeDetail> getMzChargeDetails(MzChargeDetail mzChargeDetail, YesNoEnum yesNo, Integer receiptNo, List<MzYjReq> mzYjReqs, List<MzChargeDetail> mzChargeDetailList, Integer zgmztczf) throws MzException {
|
|
|
List<MzChargeDetail> mzChargeDetails = new ArrayList<>();
|
|
|
MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(mzChargeDetail.getPatientId());
|
|
|
Integer maxOrderNo = 0;
|
|
@@ -383,8 +383,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
if (zdChargeItemList != null && zdChargeItemList.size() > 0) {
|
|
|
BigDecimal amount = BigDecimal.ZERO;
|
|
|
for (ZdChargeItem zd : zdChargeItemList) {
|
|
|
- if(YesNoEnum.YES.code.equals(zgmztczf)&&(zd.getNationalCode()==null || StringUtils.isBlank(zd.getNationalCode()))){
|
|
|
- throw new MzException("保存处方失败,您本次处方是门诊统筹支付,项目【" + mzYjReq.getOrderName() + "】的子项目【"+zd.getName()+"】没有医保赋码,请待患者本次处方缴费完成后以自费处方开立保存!!");
|
|
|
+ if (YesNoEnum.YES.code.equals(zgmztczf) && (zd.getNationalCode() == null || StringUtils.isBlank(zd.getNationalCode()))) {
|
|
|
+ throw new MzException("保存处方失败,您本次处方是门诊统筹支付,项目【" + mzYjReq.getOrderName() + "】的子项目【" + zd.getName() + "】没有医保赋码,请待患者本次处方缴费完成后以自费处方开立保存!!");
|
|
|
}
|
|
|
amount = amount.add(zd.getChargeAmount());
|
|
|
}
|
|
@@ -658,6 +658,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
//按时间倒序排序
|
|
|
Collections.sort(returnMzChargeDetails, new Comparator() {
|
|
|
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
@Override
|
|
|
public int compare(Object o1, Object o2) {
|
|
|
MzChargeDetail i1 = (MzChargeDetail) o1;
|
|
@@ -898,8 +899,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
|
|
|
@Override
|
|
|
public List<Map<String, Object>> queryChargeListByPatient(String patientId, String name, String serialNo, Date beginDate, Date endDate, String warnDept) {
|
|
|
- if(StringUtils.isBlank(warnDept)){
|
|
|
- warnDept=null;
|
|
|
+ if (StringUtils.isBlank(warnDept)) {
|
|
|
+ warnDept = null;
|
|
|
}
|
|
|
List<Map<String, Object>> chargeListByPatient = mzChargeDetailMapper.selectChargeListByPatient(patientId, name, serialNo, beginDate, endDate, warnDept);
|
|
|
// if (YesNoEnum.YES.equals(hisDate)) {
|
|
@@ -1111,8 +1112,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
mzYjReq.setReqNo(mzYshConfigService.getReqNo());
|
|
|
mzYjReq.setPageNo(mzYshConfigService.getReqPageNo());
|
|
|
mzYjReq.setReqDate(now);
|
|
|
- mzYjReq.setGroupName(Tools.splitString(mzYjReq.getGroupName(),200,""));
|
|
|
- mzYjReq.setOrderName(Tools.splitString(mzYjReq.getOrderName(),60,""));
|
|
|
+ mzYjReq.setGroupName(Tools.splitString(mzYjReq.getGroupName(), 200, ""));
|
|
|
+ mzYjReq.setOrderName(Tools.splitString(mzYjReq.getOrderName(), 60, ""));
|
|
|
mzYjReqMapper.insertMzYjReq(mzYjReq);
|
|
|
}
|
|
|
}
|
|
@@ -1125,7 +1126,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
updateMzfzPatientOrder.setStatusFlag(MzfzStatusEnum.CLINIC.code);
|
|
|
mzfzPatientOrderMapper.updateMzfzPatientOrder(updateMzfzPatientOrder);
|
|
|
MzfzPatientOrder mzfzPatientOrder = mzfzPatientOrderMapper.selectBySerialNo(mzPrescriptionVo.getSerialNo());
|
|
|
- dbClinic=clinicMapper.selectByPatientIdAndTimesAndReceiptNo(mzfzPatientOrder.getPatientId(),mzfzPatientOrder.getTimes(),0);
|
|
|
+ dbClinic = clinicMapper.selectByPatientIdAndTimesAndReceiptNo(mzfzPatientOrder.getPatientId(), mzfzPatientOrder.getTimes(), 0);
|
|
|
}
|
|
|
Clinic clinic = new Clinic();
|
|
|
clinic.setPatientId(mzPatientMi.getPatientId());
|
|
@@ -1134,13 +1135,13 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
clinic.setReceiptNo(newMzVisitTable.getReceiptNo());
|
|
|
clinic.setDeptCode(mzPrescriptionVo.getVisitDeptCode());
|
|
|
clinic.setDoctorCode(mzPrescriptionVo.getDoctorCode());
|
|
|
- String opId =mzPrescriptionVo.getDoctorCode();
|
|
|
+ String opId = mzPrescriptionVo.getDoctorCode();
|
|
|
//互联网医院处方保存是用互联网收费员名义保存
|
|
|
- if(StringUtils.isNotBlank(mzPrescriptionVo.getOpId())){
|
|
|
- opId=mzPrescriptionVo.getOpId();
|
|
|
- }else if(dbClinic!=null && Constants.HLWYY_CODE.equals(dbClinic.getOpId())){
|
|
|
+ if (StringUtils.isNotBlank(mzPrescriptionVo.getOpId())) {
|
|
|
+ opId = mzPrescriptionVo.getOpId();
|
|
|
+ } else if (dbClinic != null && Constants.HLWYY_CODE.equals(dbClinic.getOpId())) {
|
|
|
//如果是当前患者的号子来源是互联网医院的话,处方都算互联网医院
|
|
|
- opId=dbClinic.getOpId();
|
|
|
+ opId = dbClinic.getOpId();
|
|
|
}
|
|
|
clinic.setOpId(opId);
|
|
|
clinic.setOpDay(new Date());
|
|
@@ -1149,8 +1150,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
clinic.setClinicStatus(ClinicStatusEnum.HAD_CLINIC.code);
|
|
|
clinic.setJzFlag(JzFlag);
|
|
|
clinicMapper.insertClinic(clinic);
|
|
|
- if(mzPrescriptionVo.getZgmztczf()!=null && YesNoEnum.YES.code.equals(mzPrescriptionVo.getZgmztczf())){
|
|
|
- tsmzService.directRegistrationAsync(opId,mzPatientMi.getPatientId(),times,mzPrescriptionVo.getReadCardResult(),mzPrescriptionVo.getGrzhzf(),mzPrescriptionVo.getReadCardType());
|
|
|
+ if (mzPrescriptionVo.getZgmztczf() != null && YesNoEnum.YES.code.equals(mzPrescriptionVo.getZgmztczf())) {
|
|
|
+ tsmzService.directRegistrationAsync(opId, mzPatientMi.getPatientId(), times, mzPrescriptionVo.getReadCardResult(), mzPrescriptionVo.getGrzhzf(), mzPrescriptionVo.getReadCardType());
|
|
|
}
|
|
|
return clinic;
|
|
|
}
|
|
@@ -1425,11 +1426,11 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
zlDetail.put("index", index);
|
|
|
zlDetail.put("orderCode", mzChargeDetail.getChargeItemCode());
|
|
|
zlDetail.put("name", mzChargeDetail.getTcName());
|
|
|
- zlDetail.put("drugQuan",mzChargeDetail.getDrugQuan());
|
|
|
- zlDetail.put("drugUnit",mzChargeDetail.getDrugUnit());
|
|
|
- zlDetail.put("orderDays",mzChargeDetail.getOrderDays());
|
|
|
- zlDetail.put("frequency",mzChargeDetail.getFrequency());
|
|
|
- zlDetail.put("quantity",mzChargeDetail.getQuantity());
|
|
|
+ zlDetail.put("drugQuan", mzChargeDetail.getDrugQuan());
|
|
|
+ zlDetail.put("drugUnit", mzChargeDetail.getDrugUnit());
|
|
|
+ zlDetail.put("orderDays", mzChargeDetail.getOrderDays());
|
|
|
+ zlDetail.put("frequency", mzChargeDetail.getFrequency());
|
|
|
+ zlDetail.put("quantity", mzChargeDetail.getQuantity());
|
|
|
if (StringUtils.isNotBlank(mzChargeDetail.getInstructionText())) {
|
|
|
zlDetail.put("instructionCode", mzChargeDetail.getInstructionCode());
|
|
|
zlDetail.put("instructionText", mzChargeDetail.getInstructionText());
|
|
@@ -1475,7 +1476,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
if (mzChargeDetail.getGroupOrder() == null) {
|
|
|
mzChargeDetail.setGroupOrder(1);
|
|
|
}
|
|
|
- xyDetail.put("orderCode", mzChargeDetail.getChargeItemCode() + "_" + mzChargeDetail.getSerial()+"_"+mzChargeDetail.getGroupOrder());
|
|
|
+ xyDetail.put("orderCode", mzChargeDetail.getChargeItemCode() + "_" + mzChargeDetail.getSerial() + "_" + mzChargeDetail.getGroupOrder());
|
|
|
xyDetail.put("groupOrder", mzChargeDetail.getGroupOrder());
|
|
|
if (StringUtils.isNotBlank(ypZdDict.getManuCode())) {
|
|
|
String manufactoryName = ypZdManufactoryService.queryYpZdManufactoryByCode(ypZdDict.getManuCode());
|
|
@@ -1961,7 +1962,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
mzYjReq.setReqComment("主诉:" + mzPrescriptionVo.getMzBlRecord().getEmrChiefComplaint() + " 现病史:" + mzPrescriptionVo.getMzBlRecord().getEmrHpi() + " 既往史:" + mzPrescriptionVo.getMzBlRecord().getEmrPs());
|
|
|
JcZdItem jcZdItem = jcZdItemMapper.selectJcZdItemByCode(mzYjReq.getOrderCode());
|
|
|
if (jcZdItem != null) {
|
|
|
- if (YesNoEnum.YES.code.equals(jcZdItem.getDelFlag())||YesNoEnum.YES.code.equals(jcZdItem.getMzFlag())){
|
|
|
+ if (YesNoEnum.YES.code.equals(jcZdItem.getDelFlag()) || YesNoEnum.YES.code.equals(jcZdItem.getMzFlag())) {
|
|
|
throw new MzException("保存处方失败,辅助检查【" + jcZdItem.getName() + "】已经停用,无法继续使用!");
|
|
|
}
|
|
|
mzYjReq.setOrderName(jcZdItem.getName());
|
|
@@ -1977,7 +1978,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
if (jyZdItem == null) {
|
|
|
throw new MzException("没有找到医技编码【" + mzYjReq.getOrderCode() + "】对应的医技项目,请确认参数是否正确!");
|
|
|
}
|
|
|
- if (YesNoEnum.YES.code.equals(jyZdItem.getDelFlag())||YesNoEnum.YES.code.equals(jyZdItem.getMzFlag())){
|
|
|
+ if (YesNoEnum.YES.code.equals(jyZdItem.getDelFlag()) || YesNoEnum.YES.code.equals(jyZdItem.getMzFlag())) {
|
|
|
throw new MzException("保存处方失败,检验项目【" + jyZdItem.getName() + "】已经停用,无法继续使用!");
|
|
|
}
|
|
|
mzYjReq.setOrderName(jyZdItem.getName());
|
|
@@ -2066,7 +2067,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
}
|
|
|
YpZdDict ypZdDict = ypZdDictService.queryYpZdDictByCodeAndSerial(mzChargeDetail.getChargeItemCode(), mzChargeDetail.getSerial());
|
|
|
if (ypZdDict != null) {
|
|
|
- if(YesNoEnum.YES.code.equals(mzPrescriptionVo.getZgmztczf())&&(ypZdDict.getNationalCode()==null || StringUtils.isBlank(ypZdDict.getNationalCode()))){
|
|
|
+ if (YesNoEnum.YES.code.equals(mzPrescriptionVo.getZgmztczf()) && (ypZdDict.getNationalCode() == null || StringUtils.isBlank(ypZdDict.getNationalCode()))) {
|
|
|
throw new MzException("保存处方失败,您本次处方是门诊统筹支付,药品【" + ypZdDict.getName() + "】没有医保赋码,请待患者本次处方缴费完成后以自费处方开立保存!!");
|
|
|
}
|
|
|
//当前处方购药量
|
|
@@ -2153,13 +2154,13 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
if (zdChargeItem == null) {
|
|
|
continue;
|
|
|
}
|
|
|
- if(YesNoEnum.YES.code.equals(zdChargeItem.getDelFlag())){
|
|
|
+ if (YesNoEnum.YES.code.equals(zdChargeItem.getDelFlag())) {
|
|
|
throw new MzException("保存处方失败,诊疗项目【" + zdChargeItem.getName() + "】已经停用,无法继续使用!");
|
|
|
}
|
|
|
- if(YesNoEnum.YES.code.equals(mzPrescriptionVo.getZgmztczf())&&(zdChargeItem.getNationalCode()==null || StringUtils.isBlank(zdChargeItem.getNationalCode()))){
|
|
|
+ if (YesNoEnum.YES.code.equals(mzPrescriptionVo.getZgmztczf()) && (zdChargeItem.getNationalCode() == null || StringUtils.isBlank(zdChargeItem.getNationalCode()))) {
|
|
|
throw new MzException("保存处方失败,您本次处方是门诊统筹支付,诊疗项目【" + zdChargeItem.getName() + "】没有医保赋码,请待患者本次处方缴费完成后以自费处方开立保存!!");
|
|
|
}
|
|
|
- mzChargeDetail.setChargeBillCode(Constants.BILL_ITEM_CODE_prev +zdChargeItem.getBillItemMz().substring(1));
|
|
|
+ mzChargeDetail.setChargeBillCode(Constants.BILL_ITEM_CODE_prev + zdChargeItem.getBillItemMz().substring(1));
|
|
|
mzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount());
|
|
|
mzChargeDetail.setOrigPrice(zdChargeItem.getChargeAmount());
|
|
|
mzChargeDetail.setCountryFlag("");
|
|
@@ -2308,25 +2309,26 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Clinic nucleicAcidApplication(String patientId,String opId) throws MzException {
|
|
|
- return getNucleicAcidApplication(patientId, opId,Constants.NUCLEIC_ORDER_CODE);
|
|
|
+ public Clinic nucleicAcidApplication(String patientId, String opId) throws MzException {
|
|
|
+ return getNucleicAcidApplication(patientId, opId, Constants.NUCLEIC_ORDER_CODE);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 核酸单人单管申请
|
|
|
+ *
|
|
|
* @param patientId
|
|
|
* @param opId
|
|
|
* @param orderCode
|
|
|
* @return
|
|
|
* @throws MzException
|
|
|
*/
|
|
|
- private Clinic getNucleicAcidApplication(String patientId, String opId,String orderCode) throws MzException {
|
|
|
+ private Clinic getNucleicAcidApplication(String patientId, String opId, String orderCode) throws MzException {
|
|
|
MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(patientId);
|
|
|
if (mzPatientMi == null) {
|
|
|
throw new MzException("当前挂号的病人信息不存在,请先保存病人信息!");
|
|
|
}
|
|
|
- int num=mzYjReqMapper.select24HourReqByCode(patientId,orderCode);
|
|
|
- if(num>0){
|
|
|
+ int num = mzYjReqMapper.select24HourReqByCode(patientId, orderCode);
|
|
|
+ if (num > 0) {
|
|
|
throw new MzException("您在今天已经采过样了,请不要重复申请!");
|
|
|
}
|
|
|
//自助开核酸的时候更新病人年龄
|
|
@@ -2373,13 +2375,13 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Clinic hybridTestApplication(String patientId,String opId) throws MzException {
|
|
|
+ public Clinic hybridTestApplication(String patientId, String opId) throws MzException {
|
|
|
MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(patientId);
|
|
|
if (mzPatientMi == null) {
|
|
|
throw new MzException("当前挂号的病人信息不存在,请先保存病人信息!");
|
|
|
}
|
|
|
- int num=mzChargeDetailMapper.select24HourReqByCode(patientId,Constants.HYBRID_TEST_CHARGE_CODE);
|
|
|
- if(num>0){
|
|
|
+ int num = mzChargeDetailMapper.select24HourReqByCode(patientId, Constants.HYBRID_TEST_CHARGE_CODE);
|
|
|
+ if (num > 0) {
|
|
|
throw new MzException("您在今天已经采过样了,请不要重复申请!");
|
|
|
}
|
|
|
//自助开核酸的时候更新病人年龄
|
|
@@ -2442,7 +2444,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
|
|
|
@Override
|
|
|
public Clinic nucleicOnlyYellowAcidApplication(String patientId, String opId) throws MzException {
|
|
|
- return getNucleicAcidApplication(patientId, opId,Constants.NUCLEIC_ORDER_ONLY_YELLOW_CODE);
|
|
|
+ return getNucleicAcidApplication(patientId, opId, Constants.NUCLEIC_ORDER_ONLY_YELLOW_CODE);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -2577,7 +2579,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
Integer receiptNo = 1;
|
|
|
YesNoEnum yesNo = YesNoEnum.YES;
|
|
|
|
|
|
- List<MzChargeDetail> mzChargeDetails = getMzChargeDetails(mzChargeDetail, yesNo, receiptNo, mzYjReqs, mzChargeDetailList,mzPrescriptionVo.getZgmztczf());
|
|
|
+ List<MzChargeDetail> mzChargeDetails = getMzChargeDetails(mzChargeDetail, yesNo, receiptNo, mzYjReqs, mzChargeDetailList, mzPrescriptionVo.getZgmztczf());
|
|
|
//总金额
|
|
|
BigDecimal amount = BigDecimal.ZERO;
|
|
|
//统计的原始总金额 未做优惠前
|
|
@@ -2652,8 +2654,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
mzPrescriptionVo.setFirstOrNot(mzVisitTable.getFirstOrNot());
|
|
|
mzPrescriptionVo.setIcdCode(mzVisitTable.getIcdCode());
|
|
|
String icdText = StringUtils.isBlank(mzBlRecord.getTentativeDiagnosis()) ? "" : mzBlRecord.getTentativeDiagnosis();
|
|
|
- if (mzVisitTable != null && mzVisitTable.getIcdText() != null && StringUtils.isNotBlank(mzVisitTable.getIcdText())) {
|
|
|
- icdText += mzVisitTable.getIcdText();
|
|
|
+ if ((icdText == null || StringUtils.isBlank(icdText)) && mzVisitTable != null && mzVisitTable.getIcdText() != null && StringUtils.isNotBlank(mzVisitTable.getIcdText())) {
|
|
|
+ icdText = mzVisitTable.getIcdText();
|
|
|
}
|
|
|
//诊断太长导致处方分页
|
|
|
if (icdText.length() > 60) {
|
|
@@ -2668,20 +2670,20 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
if (mzBlRecord.getEmrProcess() != null && mzBlRecord.getEmrProcess().indexOf("收住院") >= 0) {
|
|
|
List<MzZyReq> mzZyReqs = mzZyReqMapper.selectMzZyReqByPatientId(patientId);
|
|
|
if (mzZyReqs != null && mzZyReqs.size() > 0) {
|
|
|
- MzZyReq mzZyReq=mzZyReqs.get(0);
|
|
|
- if(mzZyReq.getDeptCode()!=null && StringUtils.isNotBlank(mzZyReq.getDeptCode())){
|
|
|
+ MzZyReq mzZyReq = mzZyReqs.get(0);
|
|
|
+ if (mzZyReq.getDeptCode() != null && StringUtils.isNotBlank(mzZyReq.getDeptCode())) {
|
|
|
mzZyReq.setDeptName(zdUnitCodeService.queryDeptNameByIdInCache(mzZyReq.getDeptCode()));
|
|
|
}
|
|
|
- if(mzZyReq.getReqDept()!=null && StringUtils.isNotBlank(mzZyReq.getReqDept())){
|
|
|
+ if (mzZyReq.getReqDept() != null && StringUtils.isNotBlank(mzZyReq.getReqDept())) {
|
|
|
mzZyReq.setReqDeptName(zdUnitCodeService.queryDeptNameByIdInCache(mzZyReq.getReqDept()));
|
|
|
mzZyReq.setReqWardName(mzZyReq.getReqDeptName());
|
|
|
}
|
|
|
- if(mzZyReq.getSmallDept()!=null && StringUtils.isNotBlank(mzZyReq.getSmallDept())){
|
|
|
+ if (mzZyReq.getSmallDept() != null && StringUtils.isNotBlank(mzZyReq.getSmallDept())) {
|
|
|
mzZyReq.setSmallDeptName(zdUnitCodeService.queryDeptNameByIdInCache(mzZyReq.getSmallDept()));
|
|
|
}
|
|
|
- if(mzZyReq.getDoctorCode()!=null && StringUtils.isNotBlank(mzZyReq.getDoctorCode())){
|
|
|
- Employee employee= employeeService.queryByUserCode(mzZyReq.getDoctorCode());
|
|
|
- mzZyReq.setDoctorName(employee!=null?employee.getEmployeeName():"");
|
|
|
+ if (mzZyReq.getDoctorCode() != null && StringUtils.isNotBlank(mzZyReq.getDoctorCode())) {
|
|
|
+ Employee employee = employeeService.queryByUserCode(mzZyReq.getDoctorCode());
|
|
|
+ mzZyReq.setDoctorName(employee != null ? employee.getEmployeeName() : "");
|
|
|
}
|
|
|
// if(mzZyReq.getAdmissStatus()!=null && StringUtils.isNotBlank(mzZyReq.getAdmissStatus())){
|
|
|
// CodeNameEntity codeNameEntity= mzZdCommonService.queryAdmissStatusByCode(mzZyReq.getAdmissStatus());
|
|
@@ -2910,9 +2912,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
}
|
|
|
resultMap.put("mzBlRecord", mzBlRecord);
|
|
|
String icdText = StringUtils.isBlank(mzBlRecord.getTentativeDiagnosis()) ? "" : mzBlRecord.getTentativeDiagnosis();
|
|
|
- if (mzVisitTable != null && mzVisitTable.getIcdText() != null && StringUtils.isNotBlank(mzVisitTable.getIcdText())) {
|
|
|
- icdText = mzVisitTable.getIcdText() + icdText;
|
|
|
- //results.put("icdText", StringUtils.isBlank(mzBlRecord.getTentativeDiagnosis())?mzVisitTable.getIcdText():mzVisitTable.getIcdText()+" "+mzBlRecord.getTentativeDiagnosis());
|
|
|
+ if ((icdText == null || StringUtils.isBlank(icdText)) && mzVisitTable != null && mzVisitTable.getIcdText() != null && StringUtils.isNotBlank(mzVisitTable.getIcdText())) {
|
|
|
+ icdText = mzVisitTable.getIcdText();
|
|
|
}
|
|
|
resultMap.put("icdText", icdText);
|
|
|
return resultMap;
|
|
@@ -2961,7 +2962,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
m.setPayMark(PayMarkEnum.CHARGED.code);
|
|
|
setChargeDetail(mzDrugWinMap, yffyNoMap, orderNoMap, m);
|
|
|
mzChargeDetailMapper.updateMzChargeDetail(m);
|
|
|
- itemNoMap.put(m.getItemNo()+"_"+m.getChargeItemCode().trim(), m.getItemNo());
|
|
|
+ itemNoMap.put(m.getItemNo() + "_" + m.getChargeItemCode().trim(), m.getItemNo());
|
|
|
}
|
|
|
//收费时药品库存操作
|
|
|
if (refundTimes == null) {
|
|
@@ -3015,7 +3016,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
ypMzFytj.setReceiptNo(1);
|
|
|
ypMzFytj.setSerialNo(serialNo);
|
|
|
ypMzFytj.setRealNo(serialNo);
|
|
|
- ypMzFytj.setItemNo(itemNoMap.get(ypMzFytj.getItemNo()+"_"+ypMzFytj.getChargeItemCode().trim()));
|
|
|
+ ypMzFytj.setItemNo(itemNoMap.get(ypMzFytj.getItemNo() + "_" + ypMzFytj.getChargeItemCode().trim()));
|
|
|
ypMzFytjMapper.insertYpMzFytj(ypMzFytj);
|
|
|
}
|
|
|
}
|
|
@@ -3023,7 +3024,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
ypMzFytjList = ypMzFytjMapper.selectXyTyYpMzFytj(patientId, refundTimes);
|
|
|
if (ypMzFytjList != null && ypMzFytjList.size() > 0) {
|
|
|
for (YpMzFytj ypMzFytj : ypMzFytjList) {
|
|
|
- List<MzChargeDetail> mzChargeDetails = mzChargeDetailMapper.selectMzChargeDetailByChargeItemCode(ypMzFytj.getPatientId(), ypMzFytj.getTimes(), ypMzFytj.getChargeItemCode(), ypMzFytj.getOrderNo(),ypMzFytj.getItemNo());
|
|
|
+ List<MzChargeDetail> mzChargeDetails = mzChargeDetailMapper.selectMzChargeDetailByChargeItemCode(ypMzFytj.getPatientId(), ypMzFytj.getTimes(), ypMzFytj.getChargeItemCode(), ypMzFytj.getOrderNo(), ypMzFytj.getItemNo());
|
|
|
if (mzChargeDetails == null || mzChargeDetails.size() == 0) {
|
|
|
continue;
|
|
|
}
|
|
@@ -3052,7 +3053,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
ypMzFytj.setSerialNo(serialNo);
|
|
|
ypMzFytj.setConfirmFlag(ConfirmFlagEnum.CONFIRM.code);
|
|
|
ypMzFytj.setRealNo(serialNo);
|
|
|
- ypMzFytj.setItemNo(itemNoMap.get(ypMzFytj.getItemNo()+"_"+ypMzFytj.getChargeItemCode().trim()));
|
|
|
+ ypMzFytj.setItemNo(itemNoMap.get(ypMzFytj.getItemNo() + "_" + ypMzFytj.getChargeItemCode().trim()));
|
|
|
ypMzFytjMapper.insertYpMzFytj(ypMzFytj);
|
|
|
}
|
|
|
}
|
|
@@ -3104,7 +3105,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
if (!allRefund) {
|
|
|
mzBlRecord = mzBlRecordMapper.selectMzBlRecordByPatientIdAndTimes(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes());
|
|
|
}
|
|
|
- int count = mzPatientMiMapper.countYbZf(mzDepositFileVo.getPatientId(),mzDepositFileVo.getTimes());
|
|
|
+ int count = mzPatientMiMapper.countYbZf(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes());
|
|
|
if (count > 0 && !allRefund) {
|
|
|
throw new MzException("退费失败,此处方有门诊报销支付,必须全退!");
|
|
|
}
|
|
@@ -3561,7 +3562,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
// }
|
|
|
temp.setTimes(times);
|
|
|
temp.setReceiptNo(receiptNo);
|
|
|
- // temp.setItemNo(itemNo++);
|
|
|
+ // temp.setItemNo(itemNo++);
|
|
|
temp.setSerialNo(null);
|
|
|
temp.setPayMark(PayMarkEnum.NO_CHARGE.code);
|
|
|
temp.setChargeDate(null);
|
|
@@ -3578,8 +3579,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
temp.setPrintFlagYj(null);
|
|
|
temp.setConfirmFlagQx(null);
|
|
|
newMzChargeDetailList.add(temp);
|
|
|
- if(itemNo==0 || itemNo<temp.getItemNo()){
|
|
|
- itemNo=temp.getItemNo();
|
|
|
+ if (itemNo == 0 || itemNo < temp.getItemNo()) {
|
|
|
+ itemNo = temp.getItemNo();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -3863,7 +3864,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
BigDecimal ybjzje = BigDecimal.ZERO;
|
|
|
for (MzDepositFile m : mzDepositFileVo.getMzDepositFiles()) {
|
|
|
if (BigDecimal.ZERO.compareTo(m.getAmount()) == 0) {
|
|
|
- if(!Constants.NUCLEIC_ONLY_YELLOW_ACID_APPLICATION.equals(m.getResponceType())){
|
|
|
+ if (!Constants.NUCLEIC_ONLY_YELLOW_ACID_APPLICATION.equals(m.getResponceType())) {
|
|
|
throw new MzException("存在收款金额为0的支付方式,请重新确认!");
|
|
|
}
|
|
|
m.setResponceType(null);
|