|
@@ -1,6 +1,5 @@
|
|
|
package thyyxxk.webserver.service.zhuyuanyisheng;
|
|
|
|
|
|
-import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -18,12 +17,14 @@ import thyyxxk.webserver.dao.his.zhuyuanyisheng.EmrPatientDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.dictionary.CodeName;
|
|
|
import thyyxxk.webserver.entity.drg.AuxiliaryFillingOfDiagnosis;
|
|
|
+import thyyxxk.webserver.entity.login.UserInfo;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.DischargedEmrModifyApply;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrDataElement;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrDataExtract;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrPatientData;
|
|
|
import thyyxxk.webserver.service.PublicServer;
|
|
|
import thyyxxk.webserver.service.externalhttp.emr.EmrEditor;
|
|
|
+import thyyxxk.webserver.service.redislike.RedisLikeService;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
import java.util.*;
|
|
@@ -39,12 +40,14 @@ public class EmrServer {
|
|
|
private final EmrEditor emr;
|
|
|
private final PublicServer publicServer;
|
|
|
private final LoginDao loginDao;
|
|
|
+ private final RedisLikeService realtimeService;
|
|
|
|
|
|
- public EmrServer(EmrPatientDao dao, EmrEditor emr, PublicServer publicServer, LoginDao loginDao) {
|
|
|
+ public EmrServer(EmrPatientDao dao, EmrEditor emr, PublicServer publicServer, LoginDao loginDao, RedisLikeService realtimeService) {
|
|
|
this.dao = dao;
|
|
|
this.emr = emr;
|
|
|
this.publicServer = publicServer;
|
|
|
this.loginDao = loginDao;
|
|
|
+ this.realtimeService = realtimeService;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -75,15 +78,31 @@ public class EmrServer {
|
|
|
return ResultVoUtil.success(data);
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<Map<String, List<JSONObject>>> getEmrTree() {
|
|
|
+ Map<String, List<JSONObject>> map = new HashMap<>();
|
|
|
+ map.put("all", wholeHospitalTemplate());
|
|
|
+ map.put("dept", getDeptTemplate());
|
|
|
+ return ResultVoUtil.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<JSONObject> getDeptTemplate() {
|
|
|
+ UserInfo user = realtimeService.getUserInfoByToken();
|
|
|
+ JSONArray data = emr.getDeptList(user.getDeptCode());
|
|
|
+ return emrToTree(data);
|
|
|
+ }
|
|
|
|
|
|
- public ResultVo<List<JSONObject>> getEmrTree() {
|
|
|
+ public List<JSONObject> wholeHospitalTemplate() {
|
|
|
JSONArray data = emr.getEmrTree();
|
|
|
+ return emrToTree(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<JSONObject> emrToTree(JSONArray data) {
|
|
|
List<JSONObject> tree = new ArrayList<>();
|
|
|
if (data.isEmpty()) {
|
|
|
- return ResultVoUtil.success(tree);
|
|
|
+ return tree;
|
|
|
}
|
|
|
emrArrToTree(data, tree);
|
|
|
- return ResultVoUtil.success(tree);
|
|
|
+ return tree;
|
|
|
}
|
|
|
|
|
|
private static void emrArrToTree(JSONArray data, List<JSONObject> tree) {
|
|
@@ -578,4 +597,9 @@ public class EmrServer {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<Object> getHistory(String documentId) {
|
|
|
+ return ResultVoUtil.success(emr.getHistory(documentId));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|