|
@@ -1,5 +1,6 @@
|
|
|
package thyyxxk.webserver.service.zhuyuanyisheng.yizhuverify;
|
|
|
|
|
|
+import lombok.Getter;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
|
|
@@ -10,6 +11,7 @@ import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.YzZdOrderItemConfirm;
|
|
|
import thyyxxk.webserver.service.redislike.RedisLikeService;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
@@ -52,12 +54,14 @@ public class YiZhuCheckData {
|
|
|
List<String> warningMessage = new ArrayList<>();
|
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
|
private UserInfo userInfo;
|
|
|
+ @Getter
|
|
|
private Boolean passTheAudit = true;
|
|
|
private final List<String> groupList = Arrays.asList("71", "73");
|
|
|
|
|
|
/**
|
|
|
* 全排斥医嘱
|
|
|
*/
|
|
|
+ @Getter
|
|
|
private Repel repel = null;
|
|
|
private final String ONCE = "ONCE";
|
|
|
|
|
@@ -176,25 +180,32 @@ public class YiZhuCheckData {
|
|
|
}
|
|
|
|
|
|
private void drugCheck(XinZhenYzActOrder item) {
|
|
|
- String key = item.getOrderCode().trim() + item.getSerial().trim() + item.getGroupNo().trim();
|
|
|
- XinZhenYzActOrder detailsOfDrugs = getDrugData(key);
|
|
|
+
|
|
|
if (StringUtil.isBlank(item.getGroupNo())) {
|
|
|
errorMessage.add("没有药房请重新开。");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!groupList.contains(item.getGroupNo())) {
|
|
|
+ errorMessage.add("药房错误,请重新选择药房。");
|
|
|
}
|
|
|
|
|
|
+ String key = item.getOrderCode().trim() + item.getSerial().trim() + item.getGroupNo().trim();
|
|
|
+ XinZhenYzActOrder detailsOfDrugs = getDrugData(key, item.getSupplyCode());
|
|
|
+
|
|
|
if (BigUtils.bigXiaoYu(item.getDose(), 0)) {
|
|
|
errorMessage.add(String.format("医嘱:【%s】,计量不能开负数", item.getOrderName()));
|
|
|
}
|
|
|
|
|
|
- if (!groupList.contains(item.getGroupNo())) {
|
|
|
- errorMessage.add("药房错误,请重新选择药房。");
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
if (StringUtil.isBlank(item.getDrugSpecification())) {
|
|
|
errorMessage.add("药品规格不能为空");
|
|
|
}
|
|
|
if (StringUtil.isBlank(item.getSupplyCode())) {
|
|
|
errorMessage.add("给药方式不能为空");
|
|
|
+ } else if (detailsOfDrugs.getSupplyCode() == null || "1".equals(detailsOfDrugs.getSupplyCode())) {
|
|
|
+ errorMessage.add("给药方式已被停用。");
|
|
|
}
|
|
|
if (item.getDose() == null || BigUtils.dengYu(item.getDose(), 0)) {
|
|
|
errorMessage.add("一次计量不能为空");
|
|
@@ -307,7 +318,11 @@ public class YiZhuCheckData {
|
|
|
|
|
|
|
|
|
public XinZhenYzActOrder getDrugData(String code) {
|
|
|
- return drug.get(code, (temp) -> dao.drugDataOne(temp, patientInformation != null ? patientInformation.getZkWard() : ""));
|
|
|
+ return drug.get(code, (temp) -> dao.drugDataOne(temp, patientInformation != null ? patientInformation.getZkWard() : "", null));
|
|
|
+ }
|
|
|
+
|
|
|
+ public XinZhenYzActOrder getDrugData(String code, String supplyCode) {
|
|
|
+ return drug.get(code, (temp) -> dao.drugDataOne(temp, patientInformation != null ? patientInformation.getZkWard() : "", supplyCode));
|
|
|
}
|
|
|
|
|
|
public static void calculateDrugAmount(XinZhenYzActOrder item, XinZhenYzActOrder feiYongXinXi) {
|
|
@@ -356,18 +371,10 @@ public class YiZhuCheckData {
|
|
|
return returnMap;
|
|
|
}
|
|
|
|
|
|
- public Boolean getPassTheAudit() {
|
|
|
- return passTheAudit;
|
|
|
- }
|
|
|
-
|
|
|
public Boolean getFailed() {
|
|
|
return !passTheAudit;
|
|
|
}
|
|
|
|
|
|
- public Repel getRepel() {
|
|
|
- return repel;
|
|
|
- }
|
|
|
-
|
|
|
public Boolean multipleExclusions() {
|
|
|
if (repel == null) {
|
|
|
return false;
|