|
@@ -313,9 +313,17 @@ public class EmrServer {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public ResultVo<Map<String, Object>> insertEmrData(EmrPatientData param) {
|
|
|
EmrPatientData patientData = dao.getCategoryCodeByDocumentId(param.getEmrDocumentId());
|
|
|
- if (patientData != null && !SignCompleteEnum.INIT.getCode().equals(patientData.getSignComplete())) {
|
|
|
+ if (patientData == null) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "病历不存在。");
|
|
|
+ }
|
|
|
+ if (!SignCompleteEnum.INIT.getCode().equals(patientData.getSignComplete())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "患者完成电子签名无法修改。");
|
|
|
}
|
|
|
+
|
|
|
+ if (patientData.getDelFlag() == 1) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "病历已删除。");
|
|
|
+ }
|
|
|
+
|
|
|
JSONObject saveJson = new JSONObject();
|
|
|
saveJson.put("document", param.getDocumentData());
|
|
|
try {
|
|
@@ -402,12 +410,6 @@ public class EmrServer {
|
|
|
}
|
|
|
// 删除病历
|
|
|
dao.deletePatientEmrByDocumentId(documentId, TokenUtil.getInstance().getTokenUserId());
|
|
|
-
|
|
|
- try {
|
|
|
- emr.deleteEmr(documentId);
|
|
|
- } catch (Exception e) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "删除电子病历失败,请重试!" + e.getMessage());
|
|
|
- }
|
|
|
return ResultVoUtil.success(strings);
|
|
|
}
|
|
|
|
|
@@ -684,16 +686,7 @@ public class EmrServer {
|
|
|
if (times == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "出院患者无法恢复病历,如果要恢复请先召回在院。");
|
|
|
}
|
|
|
- JSONObject param = new JSONObject();
|
|
|
- param.put("_id", documentId);
|
|
|
- param.put("valid", 1);
|
|
|
- JSONObject json = emr.resumeMedicalRecords(documentId, param);
|
|
|
- if (json.getInteger("ok") == 1) {
|
|
|
- dao.updateDeleteFlag(data.getId());
|
|
|
- return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "病历恢复成功。");
|
|
|
- } else {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "病历恢复失败,请重试!");
|
|
|
- }
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_MESSAGE, "病历恢复成功。");
|
|
|
}
|
|
|
|
|
|
/**
|