|
@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
+import thyyxxk.webserver.constants.Capacity;
|
|
|
import thyyxxk.webserver.constants.EmrType;
|
|
|
import thyyxxk.webserver.dao.his.LoginDao;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.EmrPatientDao;
|
|
@@ -78,14 +79,20 @@ 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());
|
|
|
+ public ResultVo<Map<String, List<JSONObject>>> getEmrTree(String type) {
|
|
|
+ Map<String, List<JSONObject>> map = new HashMap<>(Capacity.TWO);
|
|
|
+ if ("all".equals(type)) {
|
|
|
+ map.put("all", wholeHospitalTemplate());
|
|
|
+ map.put("dept", getDeptTemplate());
|
|
|
+ } else if ("dept".equals(type)) {
|
|
|
+ map.put("dept", getDeptTemplate());
|
|
|
+ } else if ("hosp".equals(type)) {
|
|
|
+ map.put("all", wholeHospitalTemplate());
|
|
|
+ }
|
|
|
return ResultVoUtil.success(map);
|
|
|
}
|
|
|
|
|
|
- public List<JSONObject> getDeptTemplate() {
|
|
|
+ private List<JSONObject> getDeptTemplate() {
|
|
|
UserInfo user = redisLikeService.getUserInfoByToken();
|
|
|
JSONArray data = new JSONArray();
|
|
|
if (ListUtil.notBlank(user.getPartTimeDept())) {
|
|
@@ -99,9 +106,8 @@ public class EmrServer {
|
|
|
|
|
|
/**
|
|
|
* 获取 整个医院模板
|
|
|
- *
|
|
|
*/
|
|
|
- public List<JSONObject> wholeHospitalTemplate() {
|
|
|
+ private List<JSONObject> wholeHospitalTemplate() {
|
|
|
JSONArray data = emr.getEmrTree();
|
|
|
return emrToTree(data);
|
|
|
}
|