|
@@ -84,16 +84,12 @@ public class EmrServer {
|
|
|
@PostConstruct
|
|
|
@Scheduled(cron = "* * */12 * * ?")
|
|
|
public void token() {
|
|
|
- try {
|
|
|
- String URL = EMR_URL.replace("/emr/runtime/api/v1", "");
|
|
|
- String result = HttpRequest.post(URL + "/emr/runtime/api/v1/oauth/token")
|
|
|
- .header("Authorization", "Basic " + Base64.encode("user:dc71ccfec05b799ad52360c48d504019"))
|
|
|
- .form("grant_type", "client_credentials").execute().body();
|
|
|
- JSONObject data = JSONObject.parseObject(result);
|
|
|
- emrToken = data.getString("access_token");
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(e.getMessage(), e);
|
|
|
- }
|
|
|
+ String URL = EMR_URL.replace("/emr/runtime/api/v1", "");
|
|
|
+ String result = HttpRequest.post(URL + "/emr/runtime/api/v1/oauth/token")
|
|
|
+ .header("Authorization", "Basic " + Base64.encode("user:dc71ccfec05b799ad52360c48d504019"))
|
|
|
+ .form("grant_type", "client_credentials").execute().body();
|
|
|
+ JSONObject data = JSONObject.parseObject(result);
|
|
|
+ emrToken = data.getString("access_token");
|
|
|
}
|
|
|
|
|
|
public EmrServer(EmrPatientDao dao,
|
|
@@ -377,9 +373,14 @@ public class EmrServer {
|
|
|
if (patientData.getSignComplete()) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者完成电子签名无法删除。");
|
|
|
}
|
|
|
- if (!patientData.getCreateId().equals(TokenUtil.getInstance().getTokenUserId())) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "创建人不是你无法删除。");
|
|
|
+
|
|
|
+ // 如果没有医务部的权限的话就不能删除
|
|
|
+ if (!publicServer.needRule(38)) {
|
|
|
+ if (!patientData.getCreateId().equals(TokenUtil.getInstance().getTokenUserId())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "创建人不是你无法删除。");
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
EmrDataExtract emrDataExtract = dao.extractDataSource(patientData.getEmrCategoryCode());
|
|
|
List<String> strings = new ArrayList<>();
|
|
|
if (emrDataExtract != null) {
|