|
@@ -36,10 +36,12 @@ import java.util.stream.Collectors;
|
|
|
@Slf4j
|
|
|
public class YiZhuLuRuServer {
|
|
|
|
|
|
+
|
|
|
private final YiZhuLuRuDao dao;
|
|
|
private final PatientService patientService;
|
|
|
private final PublicServer publicServer;
|
|
|
|
|
|
+
|
|
|
public YiZhuLuRuServer(YiZhuLuRuDao dao, PatientService service, PublicServer publicServer) {
|
|
|
this.dao = dao;
|
|
|
this.patientService = service;
|
|
@@ -504,16 +506,22 @@ public class YiZhuLuRuServer {
|
|
|
if (huanZheXinXi == null) {
|
|
|
throw new BizException(ExceptionEnum.LOGICAL_ERROR, "没有查询到患者的在院信息。");
|
|
|
}
|
|
|
+
|
|
|
huanZheXinXi.setInfantFlag(publicServer.getInfantFlag(huanZheXinXi.getInpatientNo()));
|
|
|
publicServer.huanZheJieSuan(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
if (ListUtil.notBlank(kssList)) {
|
|
|
dao.shanChuYuanKuangJunYaoWu(kssList);
|
|
|
dao.chaRuKuangJunYaoWuXinXi(huanZheXinXi.getInpatientNo(), huanZheXinXi.getAdmissTimes(), inputCode, kssList);
|
|
|
}
|
|
|
+ List<String> content = new ArrayList<>();
|
|
|
dao.chaRuYiZhu(huanZheXinXi.getInpatientNo(), huanZheXinXi.getAdmissTimes(), inputCode, huanZheXinXi.getInfantFlag(), publicServer.getGroupNo(),
|
|
|
- huanZheXinXi.getWardCode(), huanZheXinXi.getWardCode(), huanZheXinXi.getReferPhysician(), param.getList());
|
|
|
-
|
|
|
-
|
|
|
+ huanZheXinXi.getDeptCode(), huanZheXinXi.getDeptCode(), huanZheXinXi.getReferPhysician(), param.getList());
|
|
|
+ for (XinZhenYzActOrder item : param.getList()) {
|
|
|
+ content.add(String.format("医嘱名:<span style='color:#409eff'>【%s】</span><br>医嘱时间:<span style='color:#409eff'>【%tF %<tT】</span><br>患者姓名:<span style='color:#409eff'>【%s】</span><br>床位:<span style='color:#409eff'>【%s】</span><br>频次:<span style='color:#409eff'>【%s】</span>",
|
|
|
+ item.getOrderName(), item.getOrderTime(), huanZheXinXi.getName(), huanZheXinXi.getBedNo(), item.getFrequCode()));
|
|
|
+ }
|
|
|
+ FaSongXiaoXi faSongXiaoXi = new FaSongXiaoXi(content, huanZheXinXi, inputCode);
|
|
|
+ new Thread(faSongXiaoXi).start();
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "医嘱保存成功。");
|
|
|
}
|
|
|
|
|
@@ -709,7 +717,6 @@ public class YiZhuLuRuServer {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "你想干什么?");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public ResultVo<String> sheZhiJinJi(YzActOrder yz) {
|
|
|
String emergencyFlag = null;
|
|
|
if (yz.getEmergencyFlag() == null || !yz.getEmergencyFlag().trim().equals("1")) {
|
|
@@ -807,5 +814,22 @@ public class YiZhuLuRuServer {
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
}
|
|
|
|
|
|
+ class FaSongXiaoXi implements Runnable {
|
|
|
+ private final List<String> content;
|
|
|
+ private final XinZhenYiZhu yiZhu;
|
|
|
+ private final String userCode;
|
|
|
+
|
|
|
+ public FaSongXiaoXi(List<String> content, XinZhenYiZhu yiZhu, String userCode) {
|
|
|
+ this.content = content;
|
|
|
+ this.yiZhu = yiZhu;
|
|
|
+ this.userCode = userCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ publicServer.faSongXiaoXi(yiZhu.getDeptCode(), content, "新增医嘱", yiZhu.getInpatientNo() + "_" + yiZhu.getAdmissTimes(), userCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|