|
|
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.EmrType;
|
|
|
@@ -369,4 +370,41 @@ public class EmrServer {
|
|
|
return ResultVoUtil.success(loginDao.getAllWards());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取患者已经被删除的病历
|
|
|
+ *
|
|
|
+ * @param patNo 住院号
|
|
|
+ * @return 返回
|
|
|
+ */
|
|
|
+ public ResultVo<List<EmrPatientData>> getDeleteMedicalRecord(String patNo) {
|
|
|
+ Integer times = dao.getAdmissTimes(patNo);
|
|
|
+ if (times == null) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "出院患者无法恢复病历,如果要恢复请先召回在院。");
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success(dao.selectEmrDeteles(patNo, times, TokenUtil.getTokenUserId()));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 恢复电子病历
|
|
|
+ *
|
|
|
+ * @param documentId 电子病历文档
|
|
|
+ * @return 返回提示
|
|
|
+ */
|
|
|
+ public ResultVo<String> resumeMedicalRecords(String documentId) {
|
|
|
+ EmrPatientData data = dao.selectemPatientDataOne(documentId);
|
|
|
+ if (data.getDelFlag() == 0) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "病历已经被恢复了请勿重复点击");
|
|
|
+ }
|
|
|
+ Integer times = dao.getAdmissTimes(data.getPatNo());
|
|
|
+ if (times == null) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "出院患者无法恢复病历,如果要恢复请先召回在院。");
|
|
|
+ }
|
|
|
+ JSONObject json = emr.resumeMedicalRecords(documentId, 1);
|
|
|
+ dao.updateDeleteFlag(data.getId());
|
|
|
+ log.info("恢复:{}", json);
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
+ }
|
|
|
+
|
|
|
}
|