|
@@ -2,6 +2,7 @@ package thyyxxk.webserver.service.zhuyuanyisheng.emr;
|
|
|
|
|
|
import cn.hutool.core.codec.Base64;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -22,6 +23,8 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
+import thyyxxk.webserver.config.envionment.ApiUrl;
|
|
|
+import thyyxxk.webserver.config.envionment.SystemConfig;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
import thyyxxk.webserver.constants.EmrType;
|
|
@@ -63,13 +66,14 @@ public class EmrServer {
|
|
|
private final LoginDao loginDao;
|
|
|
private final ExtraCache extraCache;
|
|
|
private final UserCache userCache;
|
|
|
- private final RestTemplate template;
|
|
|
|
|
|
private static String emrToken = null;
|
|
|
private static String EMR_URL;
|
|
|
|
|
|
public static final String THIS_IS_DIR = "This is Dir";
|
|
|
private final DrgWebApi drgWebApi;
|
|
|
+ private final ApiUrl apiUrl;
|
|
|
+ private final SystemConfig systemConfig;
|
|
|
|
|
|
@Value("${forest.variables.emrUrl}")
|
|
|
public void setUrl(String key) {
|
|
@@ -188,7 +192,12 @@ public class EmrServer {
|
|
|
* 获取 整个医院模板
|
|
|
*/
|
|
|
private List<JSONObject> wholeHospitalTemplate() {
|
|
|
- JSONArray data = emr.getEmrTree();
|
|
|
+ JSONArray data;
|
|
|
+ if (StrUtil.isBlank(systemConfig.getEmrZyDeptCode())) {
|
|
|
+ data = emr.getEmrTree();
|
|
|
+ } else {
|
|
|
+ data = emr.getDeptList(systemConfig.getEmrZyDeptCode());
|
|
|
+ }
|
|
|
return emrToTree(data);
|
|
|
}
|
|
|
|
|
@@ -551,6 +560,10 @@ public class EmrServer {
|
|
|
|
|
|
|
|
|
public ResultVo<String> getDrgIntelligentGrouping(String patNo, Integer times) {
|
|
|
+ if (StrUtil.isBlank(apiUrl.getDrgWebApi())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未找到DRG服务");
|
|
|
+ }
|
|
|
+
|
|
|
// 获取诊断
|
|
|
JSONArray diagnosis = getEmrData(patNo, times, EmrType.DIAGNOSIS);
|
|
|
// 获取手术
|