|
@@ -5,17 +5,20 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.sun.org.apache.bcel.internal.generic.NEW;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import thyyxxk.webserver.config.exception.BizException;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
+import thyyxxk.webserver.constants.sidicts.ChargeStatus;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.RoleCode;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
import thyyxxk.webserver.entity.datamodify.YzActOrder;
|
|
|
+import thyyxxk.webserver.entity.zhuyuanyisheng.DoctorSOrderFee;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.ZyOrderZk;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;
|
|
|
import thyyxxk.webserver.service.PublicServer;
|
|
@@ -82,7 +85,6 @@ public class YiZhuLuRuServer {
|
|
|
* @param param 查询条件
|
|
|
* @return 返回分页数据,同时做了树状图,这样会有一个问题,那就是开了套餐的数据查询不出来
|
|
|
*/
|
|
|
- @StringTrim
|
|
|
public ResultVo<IPage<YzActOrder>> huoQuYiZhuShuJu(YiZhuFeiYongChaXunTiaoJian param) {
|
|
|
QueryWrapper<?> qw = new QueryWrapper<>();
|
|
|
qw.eq("inpatient_no", param.getPatNo())
|
|
@@ -94,6 +96,9 @@ public class YiZhuLuRuServer {
|
|
|
qw.ge("order_time", param.getStartTime())
|
|
|
.le("order_time", param.getEndTime());
|
|
|
}
|
|
|
+ if (StringUtil.notBlank(param.getActOrderNo())) {
|
|
|
+ qw.eq("act_order_no", param.getActOrderNo());
|
|
|
+ }
|
|
|
|
|
|
if (StringUtil.notBlank(param.getFrequCode())) {
|
|
|
qw.eq("frequ_code", param.getFrequCode());
|
|
@@ -421,7 +426,7 @@ public class YiZhuLuRuServer {
|
|
|
* @param needRule 需要的权限
|
|
|
* @param yaoPingXinXi 药品信息
|
|
|
* @param xiangMuXinXi 项目信息
|
|
|
- * @param yiShenDengJi 医生登记
|
|
|
+ * @param yiShenDengJi 医生等级
|
|
|
* @param index 当前下标
|
|
|
* @param listSize 数据大小
|
|
|
* @param item 当前数据
|
|
@@ -477,10 +482,15 @@ public class YiZhuLuRuServer {
|
|
|
}
|
|
|
// 插入模板就不需要 填写时间 这里为什么不要使用 插入医嘱 这个判断就是因为还需要校验数据
|
|
|
if (!param.getChaRuMuBan()) {
|
|
|
+ Date adminDate = dao.patientAdmissionTime(param.getInpatientNo());
|
|
|
if (item.getOrderTime() == null) {
|
|
|
cuoWuXinXi.append(getCuoWuXinXi("医嘱时间不能为空", listSize, index));
|
|
|
} else if (item.getStartTime() == null) {
|
|
|
cuoWuXinXi.append(getCuoWuXinXi("开始时间不能为空", listSize, index));
|
|
|
+ } else if (adminDate == null) {
|
|
|
+ cuoWuXinXi.append(getCuoWuXinXi("没有查询到患者的入院时间", listSize, index));
|
|
|
+ } else if (DateUtil.shiJianDaXiao(item.getStartTime(), adminDate, "<")) {
|
|
|
+ cuoWuXinXi.append(getCuoWuXinXi("开始时间不能在患者入院之前,患者入院时间" + DateUtil.formatDatetime(adminDate), listSize, index));
|
|
|
} else if (DateUtil.shiJianDaXiao(item.getStartTime(), item.getOrderTime(), "<")) {
|
|
|
cuoWuXinXi.append(getCuoWuXinXi("开始时间不能在开医嘱之前", listSize, index));
|
|
|
}
|
|
@@ -503,7 +513,7 @@ public class YiZhuLuRuServer {
|
|
|
cuoWuXinXi.append(getCuoWuXinXi("您没有开此药品的权限", listSize, index));
|
|
|
}
|
|
|
if (feiYongXinXi.getDelFlag() == 1) {
|
|
|
- cuoWuXinXi.append(getCuoWuXinXi("已被物价科停用,请联系物价科。", listSize, index));
|
|
|
+ cuoWuXinXi.append(getCuoWuXinXi("药品已经被停用了,请联系药剂科。", listSize, index));
|
|
|
}
|
|
|
} else {
|
|
|
feiYongXinXi = xiangMuXinXi.get(item.getOrderCode().trim());
|
|
@@ -1004,4 +1014,74 @@ public class YiZhuLuRuServer {
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<Map<String, Object>> expensesForGettingADoctorSOrder(String patNo, Integer times) {
|
|
|
+ List<DoctorSOrderFee> feeDate = dao.expensesForGettingADoctorSOrder(patNo, times);
|
|
|
+// Map<String, String> chargeStatus = new HashMap<>(4);
|
|
|
+// chargeStatus.put("1", "录入");
|
|
|
+// chargeStatus.put("2", "上账");
|
|
|
+// chargeStatus.put("3", "结算");
|
|
|
+// chargeStatus.put("5", "未确认药单");
|
|
|
+// chargeStatus.put("6", "未接收");
|
|
|
+// chargeStatus.put("7", "拒绝确认");
|
|
|
+// chargeStatus.put("8", "医技科室");
|
|
|
+// chargeStatus.put("9", "未提交药单");
|
|
|
+ List<String> problem = Arrays.asList("5", "6", "7", "9");
|
|
|
+
|
|
|
+ Map<String, String> problemDoctorSOrder = new HashMap<>();
|
|
|
+ Map<String, FeeSum> totalCost = new HashMap<>();
|
|
|
+
|
|
|
+ Map<String, List<DoctorSOrderFee>> map = new HashMap<>(feeDate.size());
|
|
|
+ for (DoctorSOrderFee fee : feeDate) {
|
|
|
+ // 如果这个没有就代表没有产生费用
|
|
|
+ if (fee.getOrderNoStr() == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String chargeStatusName = ChargeStatus.getValue(fee.getChargeStatus());
|
|
|
+ log.info("医嘱号:{},费用类型:{},名称:{}", fee.getOrderNoStr(), fee.getChargeStatus(), chargeStatusName);
|
|
|
+
|
|
|
+ String amount = fee.getChargeAmount().abs().stripTrailingZeros().toPlainString();
|
|
|
+ String money = fee.getChargeFee().stripTrailingZeros().toPlainString();
|
|
|
+
|
|
|
+ // 计算费用总和
|
|
|
+ if (totalCost.containsKey(fee.getOrderNoStr())) {
|
|
|
+ FeeSum sum = totalCost.get(fee.getOrderNoStr());
|
|
|
+ sum.setSum(DecimalUtil.add(money, sum.getSum()));
|
|
|
+ sum.setAmount(DecimalUtil.add(amount, sum.getAmount()));
|
|
|
+ totalCost.replace(fee.getOrderNoStr(), sum);
|
|
|
+ } else {
|
|
|
+ FeeSum sum = new FeeSum();
|
|
|
+ sum.setAmount(amount);
|
|
|
+ sum.setSum(money);
|
|
|
+ totalCost.put(fee.getOrderNoStr(), sum);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (problem.contains(fee.getChargeStatus())) {
|
|
|
+
|
|
|
+ problemDoctorSOrder.put(fee.getOrderNoStr(), chargeStatusName);
|
|
|
+ }
|
|
|
+
|
|
|
+ fee.setChargeStatusName(chargeStatusName);
|
|
|
+
|
|
|
+ if (map.containsKey(fee.getOrderNoStr())) {
|
|
|
+ map.get(fee.getOrderNoStr()).add(fee);
|
|
|
+ } else {
|
|
|
+ List<DoctorSOrderFee> list = new ArrayList<>();
|
|
|
+ list.add(fee);
|
|
|
+ map.put(fee.getOrderNoStr(), list);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> feeData = new HashMap<>(3);
|
|
|
+ feeData.put("data", map);
|
|
|
+ feeData.put("problem", problemDoctorSOrder);
|
|
|
+ feeData.put("totalCost", totalCost);
|
|
|
+
|
|
|
+ return ResultVoUtil.success(feeData);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ BigDecimal a = new BigDecimal("-12.323231");
|
|
|
+ System.out.println(a.abs());
|
|
|
+ }
|
|
|
+
|
|
|
}
|