|
@@ -313,17 +313,15 @@ public class EmrServer {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public ResultVo<Map<String, Object>> insertEmrData(EmrPatientData param) {
|
|
|
EmrPatientData patientData = dao.getCategoryCodeByDocumentId(param.getEmrDocumentId());
|
|
|
- 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, "病历已删除。");
|
|
|
+ // TM的新增病历也是用的这个方法,所以要考虑没有id的病历
|
|
|
+ if (patientData != null) {
|
|
|
+ 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 {
|