|
|
@@ -5,9 +5,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.web.client.RestTemplate;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.EmrControlDao;
|
|
|
@@ -18,7 +16,6 @@ import thyyxxk.webserver.entity.zhuyuanyisheng.emrcontrolrule.RuleAdd;
|
|
|
import thyyxxk.webserver.service.wxapi.SendWxInfoService;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
-import javax.annotation.PostConstruct;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
@@ -43,12 +40,12 @@ public class EmrControlRuleSever {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "病历模板编码不能为空。");
|
|
|
}
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- for (Map.Entry<String, Object> item : data.getMedicalRecord().entrySet()) {
|
|
|
- JSONObject js = JSONObject.parseObject(JSON.toJSONString(item.getValue()));
|
|
|
- if (dao.getEmrRuleCount(js.getString("code"), data.getType()) > 0) {
|
|
|
- sb.append("病历规则重复添加:病历名称:").append(js.getString("name")).append("<br/>");
|
|
|
+ for (String s : data.getMedicalRecordCode()) {
|
|
|
+ if (dao.getEmrRuleCount(s, data.getType()) > 0) {
|
|
|
+ sb.append("病历规则重复添加");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (StringUtil.notBlank(sb.toString())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_HTML_ERROR, sb.toString());
|
|
|
}
|
|
|
@@ -80,16 +77,22 @@ public class EmrControlRuleSever {
|
|
|
|
|
|
|
|
|
public List<EmrRule> getRuleList() {
|
|
|
- List<EmrRule> list = dao.selectedRules();
|
|
|
+ List<EmrRule> list = dao.selectRules();
|
|
|
if (ListUtil.isBlank(list)) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
+ list.forEach(item -> {
|
|
|
+ item.setMedicalRecordCode(dao.selectEmrCodeByRuleId(item.getId()));
|
|
|
+ });
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
private List<QualityControlAnalysisOfMedicalRecords> getPatientsAdmittedAtTheSpecifiedTime(List<QualityControlAnalysisOfMedicalRecords> patientList, boolean whetherToSendTheMessage) {
|
|
|
Map<String, QualityControlAnalysisOfMedicalRecords> retainPatientInformation = new HashMap<>(patientList.size());
|
|
|
- List<EmrRule> ruleList = getRuleList();
|
|
|
+ List<EmrRule> ruleList = dao.selectRulesOpen();
|
|
|
+ if (ListUtil.isBlank(ruleList)) {
|
|
|
+ return patientList;
|
|
|
+ }
|
|
|
Map<String, Map<String, Integer>> messageBody = new LinkedHashMap<>(ruleList.size());
|
|
|
|
|
|
for (EmrRule rule : ruleList) {
|
|
|
@@ -208,4 +211,15 @@ public class EmrControlRuleSever {
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<String> deleteRuleById(String id) {
|
|
|
+ dao.deleteRuleById(id);
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> modifyQualityControl(RuleAdd data) {
|
|
|
+ dao.deleteRuleById(data.getId());
|
|
|
+ addTimeRule(data);
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
+ }
|
|
|
+
|
|
|
}
|