|
|
@@ -4,6 +4,8 @@ import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.modules.medical.common.bo.before.MedicalHistoryRecord;
|
|
|
@@ -20,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
+import org.jeecg.modules.message.websocket.WebSocket;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
@@ -30,176 +33,175 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
/**
|
|
|
* @Description: advance_warning_audit
|
|
|
* @Author: jeecg-boot
|
|
|
- * @Date: 2023-05-09 14:37:15
|
|
|
+ * @Date: 2023-05-09 14:37:15
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
-@Api(tags="事前模块api")
|
|
|
+@Api(tags = "事前模块api")
|
|
|
@RestController
|
|
|
@RequestMapping("/notify/medical/advanceWarningAudit")
|
|
|
@Slf4j
|
|
|
public class AdvanceWarningAuditController extends JeecgController<AdvanceWarningAudit, IAdvanceWarningAuditService> {
|
|
|
- @Autowired
|
|
|
- private IAdvanceWarningAuditService advanceWarningAuditService;
|
|
|
- @Autowired
|
|
|
- private IAdvanceWarningAuditDetailService iAdvanceWarningAuditDetailService;
|
|
|
-
|
|
|
-
|
|
|
- @ApiOperation(value = "事前工单-根据事前工单查询患者信息", notes = "根据事前工单查询患者信息")
|
|
|
- @GetMapping(value = "/patient/info")
|
|
|
- public Result<PatientInformationResponse> loadPatientInfoById(@RequestParam(name = "id", required = true) String id) {
|
|
|
- PatientInformationResponse patientInfoResponse = advanceWarningAuditService
|
|
|
- .loadPatientInfoById(id, iAdvanceWarningAuditDetailService);
|
|
|
- return Result.OK(patientInfoResponse);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "事前工单-查询就诊历史记录", notes = "根据事前工单查询患者的就诊历史记录")
|
|
|
- @GetMapping(value = "/patient/medicalHistory")
|
|
|
- public Result<IPage<MedicalHistoryRecord>> queryMedicalHistoryRecords(
|
|
|
- @RequestParam(name = "id", required = true) String id,
|
|
|
- @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
- @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
- if (pageSize > 100) {
|
|
|
- pageSize = 100;
|
|
|
- }
|
|
|
- Page<MedicalHistoryRecord> page = new Page<>(pageNo, pageSize);
|
|
|
- IPage<MedicalHistoryRecord> medicalHistoryRecords = advanceWarningAuditService
|
|
|
- .queryMedicalHistoryRecords(page, id, iAdvanceWarningAuditDetailService);
|
|
|
- return Result.OK("查询成功", medicalHistoryRecords);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @ApiOperation(value = "事前工单-查询诊断信息", notes = "根据就诊历史记录,查询诊断信息")
|
|
|
- @GetMapping(value = "/patient/diagnosis/info")
|
|
|
- public Result<List<PatientDiagnosisInfo>> loadPatientDiagnosisInfo(@RequestParam(name = "id", required = true) String id,
|
|
|
- @RequestParam(name = "treatmentType", required = true) String treatmentType) {
|
|
|
- List<PatientDiagnosisInfo> result = advanceWarningAuditService.loadPatientDiagnosisInfo(id, treatmentType);
|
|
|
- return Result.OK(result);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "事前工单-根据病例查询开药信息", notes = "根据病例查询开药信息")
|
|
|
- @GetMapping(value = "/case/prescriptions")
|
|
|
- public Result<IPage<PrescriptionDetail>> getPrescriptionsByCase(
|
|
|
- @RequestParam(name = "id", required = true) Integer id,
|
|
|
- @RequestParam(name = "treatmentType", required = true) String treatmentType,
|
|
|
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
|
|
-
|
|
|
- if (pageSize >= 100) {
|
|
|
- pageSize = 100;
|
|
|
- }
|
|
|
- Page<MedicalHistoryRecord> page = new Page<>(pageNo, pageSize);
|
|
|
- IPage<PrescriptionDetail> prescriptions = advanceWarningAuditService.loadPrescriptionsByCase(page, id, treatmentType);
|
|
|
- return Result.OK(prescriptions);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 分页列表查询
|
|
|
- *
|
|
|
- * @param advanceWarningAudit
|
|
|
- * @param pageNo
|
|
|
- * @param pageSize
|
|
|
- * @param req
|
|
|
- * @return
|
|
|
- */
|
|
|
- //@AutoLog(value = "advance_warning_audit-分页列表查询")
|
|
|
- @ApiOperation(value="advance_warning_audit-分页列表查询", notes="advance_warning_audit-分页列表查询")
|
|
|
- @GetMapping(value = "/list")
|
|
|
- public Result<IPage<AdvanceWarningAudit>> queryPageList(AdvanceWarningAudit advanceWarningAudit,
|
|
|
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
- HttpServletRequest req) {
|
|
|
- QueryWrapper<AdvanceWarningAudit> queryWrapper = QueryGenerator.initQueryWrapper(advanceWarningAudit, req.getParameterMap());
|
|
|
- Page<AdvanceWarningAudit> page = new Page<AdvanceWarningAudit>(pageNo, pageSize);
|
|
|
- IPage<AdvanceWarningAudit> pageList = advanceWarningAuditService.page(page, queryWrapper);
|
|
|
- return Result.OK(pageList);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加
|
|
|
- *
|
|
|
- * @param advanceWarningAudit
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "advance_warning_audit-添加")
|
|
|
- @ApiOperation(value="advance_warning_audit-添加", notes="advance_warning_audit-添加")
|
|
|
+ @Autowired
|
|
|
+ private IAdvanceWarningAuditService advanceWarningAuditService;
|
|
|
+ @Autowired
|
|
|
+ private IAdvanceWarningAuditDetailService iAdvanceWarningAuditDetailService;
|
|
|
+ @Autowired
|
|
|
+ private WebSocket webSocket;
|
|
|
+
|
|
|
+ @ApiOperation(value = "事前工单-根据事前工单查询患者信息", notes = "根据事前工单查询患者信息")
|
|
|
+ @GetMapping(value = "/patient/info")
|
|
|
+ public Result<PatientInformationResponse> loadPatientInfoById(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ PatientInformationResponse patientInfoResponse = advanceWarningAuditService
|
|
|
+ .loadPatientInfoById(id, iAdvanceWarningAuditDetailService);
|
|
|
+ return Result.OK(patientInfoResponse);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "事前工单-查询就诊历史记录", notes = "根据事前工单查询患者的就诊历史记录")
|
|
|
+ @GetMapping(value = "/patient/medicalHistory")
|
|
|
+ public Result<IPage<MedicalHistoryRecord>> queryMedicalHistoryRecords(
|
|
|
+ @RequestParam(name = "id", required = true) String id,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
+ if (pageSize > 100) {
|
|
|
+ pageSize = 100;
|
|
|
+ }
|
|
|
+ Page<MedicalHistoryRecord> page = new Page<>(pageNo, pageSize);
|
|
|
+ IPage<MedicalHistoryRecord> medicalHistoryRecords = advanceWarningAuditService
|
|
|
+ .queryMedicalHistoryRecords(page, id, iAdvanceWarningAuditDetailService);
|
|
|
+ return Result.OK("查询成功", medicalHistoryRecords);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "事前工单-查询诊断信息", notes = "根据就诊历史记录,查询诊断信息")
|
|
|
+ @GetMapping(value = "/patient/diagnosis/info")
|
|
|
+ public Result<List<PatientDiagnosisInfo>> loadPatientDiagnosisInfo(@RequestParam(name = "id", required = true) String id,
|
|
|
+ @RequestParam(name = "treatmentType", required = true) String treatmentType) {
|
|
|
+ List<PatientDiagnosisInfo> result = advanceWarningAuditService.loadPatientDiagnosisInfo(id, treatmentType);
|
|
|
+ return Result.OK(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "事前工单-根据病例查询开药信息", notes = "根据病例查询开药信息")
|
|
|
+ @GetMapping(value = "/case/prescriptions")
|
|
|
+ public Result<IPage<PrescriptionDetail>> getPrescriptionsByCase(
|
|
|
+ @RequestParam(name = "id", required = true) Integer id,
|
|
|
+ @RequestParam(name = "treatmentType", required = true) String treatmentType,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
+
|
|
|
+ if (pageSize >= 100) {
|
|
|
+ pageSize = 100;
|
|
|
+ }
|
|
|
+ Page<MedicalHistoryRecord> page = new Page<>(pageNo, pageSize);
|
|
|
+ IPage<PrescriptionDetail> prescriptions = advanceWarningAuditService.loadPrescriptionsByCase(page, id, treatmentType);
|
|
|
+ return Result.OK(prescriptions);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页列表查询
|
|
|
+ *
|
|
|
+ * @param advanceWarningAudit
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "advance_warning_audit-分页列表查询")
|
|
|
+ @ApiOperation(value = "advance_warning_audit-分页列表查询", notes = "advance_warning_audit-分页列表查询")
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ public Result<IPage<AdvanceWarningAudit>> queryPageList(AdvanceWarningAudit advanceWarningAudit,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ QueryWrapper<AdvanceWarningAudit> queryWrapper = QueryGenerator.initQueryWrapper(advanceWarningAudit, req.getParameterMap());
|
|
|
+ Page<AdvanceWarningAudit> page = new Page<AdvanceWarningAudit>(pageNo, pageSize);
|
|
|
+ IPage<AdvanceWarningAudit> pageList = advanceWarningAuditService.page(page, queryWrapper);
|
|
|
+ return Result.OK(pageList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param advanceWarningAudit
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "advance_warning_audit-添加")
|
|
|
+ @ApiOperation(value = "advance_warning_audit-添加", notes = "advance_warning_audit-添加")
|
|
|
// @RequiresPermissions("medical:advance_warning_audit:add")
|
|
|
- @PostMapping(value = "/add")
|
|
|
- public Result<String> add(@RequestBody AdvanceWarningAudit advanceWarningAudit) {
|
|
|
- advanceWarningAuditService.save(advanceWarningAudit);
|
|
|
- return Result.OK("添加成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 编辑
|
|
|
- *
|
|
|
- * @param advanceWarningAudit
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "advance_warning_audit-编辑")
|
|
|
- @ApiOperation(value="advance_warning_audit-编辑", notes="advance_warning_audit-编辑")
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ public Result<String> add(@RequestBody AdvanceWarningAudit advanceWarningAudit) {
|
|
|
+ advanceWarningAuditService.save(advanceWarningAudit);
|
|
|
+ return Result.OK("添加成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑
|
|
|
+ *
|
|
|
+ * @param advanceWarningAudit
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "advance_warning_audit-编辑")
|
|
|
+ @ApiOperation(value = "advance_warning_audit-编辑", notes = "advance_warning_audit-编辑")
|
|
|
// @RequiresPermissions("medical:advance_warning_audit:edit")
|
|
|
- @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
- public Result<String> edit(@RequestBody AdvanceWarningAudit advanceWarningAudit) {
|
|
|
- advanceWarningAuditService.updateById(advanceWarningAudit);
|
|
|
- return Result.OK("编辑成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id删除
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "advance_warning_audit-通过id删除")
|
|
|
- @ApiOperation(value="advance_warning_audit-通过id删除", notes="advance_warning_audit-通过id删除")
|
|
|
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
|
+ public Result<String> edit(@RequestBody AdvanceWarningAudit advanceWarningAudit) {
|
|
|
+ advanceWarningAuditService.updateById(advanceWarningAudit);
|
|
|
+ return Result.OK("编辑成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id删除
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "advance_warning_audit-通过id删除")
|
|
|
+ @ApiOperation(value = "advance_warning_audit-通过id删除", notes = "advance_warning_audit-通过id删除")
|
|
|
// @RequiresPermissions("medical:advance_warning_audit:delete")
|
|
|
- @DeleteMapping(value = "/delete")
|
|
|
- public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
- advanceWarningAuditService.removeById(id);
|
|
|
- return Result.OK("删除成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量删除
|
|
|
- *
|
|
|
- * @param ids
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "advance_warning_audit-批量删除")
|
|
|
- @ApiOperation(value="advance_warning_audit-批量删除", notes="advance_warning_audit-批量删除")
|
|
|
+ @DeleteMapping(value = "/delete")
|
|
|
+ public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ advanceWarningAuditService.removeById(id);
|
|
|
+ return Result.OK("删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "advance_warning_audit-批量删除")
|
|
|
+ @ApiOperation(value = "advance_warning_audit-批量删除", notes = "advance_warning_audit-批量删除")
|
|
|
// @RequiresPermissions("medical:advance_warning_audit:deleteBatch")
|
|
|
- @DeleteMapping(value = "/deleteBatch")
|
|
|
- public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
- this.advanceWarningAuditService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
- return Result.OK("批量删除成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id查询
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- //@AutoLog(value = "advance_warning_audit-通过id查询")
|
|
|
- @ApiOperation(value="advance_warning_audit-通过id查询", notes="advance_warning_audit-通过id查询")
|
|
|
- @GetMapping(value = "/queryById")
|
|
|
- public Result<AdvanceWarningAudit> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
- AdvanceWarningAudit advanceWarningAudit = advanceWarningAuditService.getById(id);
|
|
|
- if(advanceWarningAudit==null) {
|
|
|
- return Result.error("未找到对应数据");
|
|
|
- }
|
|
|
- return Result.OK(advanceWarningAudit);
|
|
|
- }
|
|
|
+ @DeleteMapping(value = "/deleteBatch")
|
|
|
+ public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
+ this.advanceWarningAuditService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ return Result.OK("批量删除成功!");
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
- * 导出excel
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param advanceWarningAudit
|
|
|
- */
|
|
|
+ * 通过id查询
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "advance_warning_audit-通过id查询")
|
|
|
+ @ApiOperation(value = "advance_warning_audit-通过id查询", notes = "advance_warning_audit-通过id查询")
|
|
|
+ @GetMapping(value = "/queryById")
|
|
|
+ public Result<AdvanceWarningAudit> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ AdvanceWarningAudit advanceWarningAudit = advanceWarningAuditService.getById(id);
|
|
|
+ if (advanceWarningAudit == null) {
|
|
|
+ return Result.error("未找到对应数据");
|
|
|
+ }
|
|
|
+ return Result.OK(advanceWarningAudit);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param advanceWarningAudit
|
|
|
+ */
|
|
|
// @RequiresPermissions("medical:advance_warning_audit:exportXls")
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
public ModelAndView exportXls(HttpServletRequest request, AdvanceWarningAudit advanceWarningAudit) {
|
|
|
@@ -207,16 +209,25 @@ public class AdvanceWarningAuditController extends JeecgController<AdvanceWarnin
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 通过excel导入数据
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param response
|
|
|
- * @return
|
|
|
- */
|
|
|
+ * 通过excel导入数据
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
// @RequiresPermissions("medical:advance_warning_audit:importExcel")
|
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
return super.importExcel(request, response, AdvanceWarningAudit.class);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "socket", notes = "socket")
|
|
|
+ @GetMapping(value = "/socket")
|
|
|
+ public Result<?> socket(@RequestParam(name = "ip") String ip, @RequestParam(name = "id") Integer id, @RequestParam(name = "type") String type, HttpServletRequest req) {
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ obj.put("type", type);
|
|
|
+ obj.put("id", id);
|
|
|
+ webSocket.sendMessage(ip, obj.toJSONString());
|
|
|
+ return Result.OK();
|
|
|
+ }
|
|
|
}
|