123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- package com.lemon.lifecenter.controller;
- import java.util.ArrayList;
- import java.util.List;
- import javax.servlet.http.HttpServletRequest;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.ResponseBody;
- import org.springframework.web.servlet.ModelAndView;
- import com.lemon.lifecenter.common.LifeCenterController;
- import com.lemon.lifecenter.common.LifeCenterSessionController;
- import com.lemon.lifecenter.dto.PatientPHRHistoryDTO;
- import com.lemon.lifecenter.dto.PatientPHRLatestDTO;
- import com.lemon.lifecenter.service.ClinicService;
- import com.lemon.lifecenter.service.PHRService;
- import com.lemon.lifecenter.service.PatientService;
- @Controller
- @RequestMapping("/clinic")
- public class ClinicController extends LifeCenterController {
-
- @Autowired
- private ClinicService clinicService;
-
- @Autowired
- private PHRService phrService;
-
- @Autowired
- private PatientService patientService;
- @RequestMapping("/state")
- public ModelAndView clinicState(
- HttpServletRequest request,
- @RequestParam(value="page", required=true, defaultValue="1") int page,
- @RequestParam(value="wardNumber", required=false, defaultValue="") String wardNumber,
- @RequestParam(value="patientName", required=false, defaultValue="") String patientName) {
-
- System.err.println( "page : " + page );
-
- final int pageSize = 18;
- String centerCode = "0000";//LifeCenterSessionController.getSession( request, "sesCenterCode" );
-
- PatientPHRLatestDTO dto = new PatientPHRLatestDTO();
- dto.setLimit( ( Integer.valueOf( page ) - 1 ) * pageSize );
- dto.setLimitMax( pageSize );
- dto.setCenterCode(centerCode);
- dto.setWardNumber(wardNumber);
- dto.setPatientName(patientName);
-
- int total = clinicService.selectPHRLatestCount(dto);
- List<PatientPHRLatestDTO> result = new ArrayList<PatientPHRLatestDTO>();
- if (total > 0) {
- result = clinicService.selectPHRLatestList(dto);
- }
- ModelAndView mv = setMV("clinic/state");
-
- mv.addObject("total", 18);
- mv.addObject("items", result);
-
- return mv;
- }
-
- @RequestMapping("/info")
- public ModelAndView patientInfo(
- @RequestParam(value="patientIdx", required=true, defaultValue="") int patientIdx,
- @RequestParam(value="phrType", required=true, defaultValue="temperature") String phrType) {
-
- String centerCode = "0000";//LifeCenterSessionController.getSession( request, "sesCenterCode" );
-
- PatientPHRHistoryDTO dto = new PatientPHRHistoryDTO();
- dto.setPhrType(phrType);
- dto.setPatientIdx(patientIdx);
-
- int total = phrService.selectPHRHistoryCount(dto);
- List<PatientPHRHistoryDTO> result = new ArrayList<PatientPHRHistoryDTO>();
- if (total > 0) {
- result = phrService.selectPHRHistoryList(dto);
- }
-
-
- ModelAndView mv = setMV("clinic/info");
-
- mv.addObject("patientIdx", patientIdx);
- mv.addObject("phrType", phrType);
- mv.addObject("phrTotal", total);
- mv.addObject("phrItems", result);
- return mv;
- }
-
- @RequestMapping("/api/phrDatas")
- public @ResponseBody List<PatientPHRHistoryDTO> phrDatas(
- @RequestParam(value="patientIdx", required=true, defaultValue="") int patientIdx,
- @RequestParam(value="phrType", required=true, defaultValue="temperature") String phrType) {
-
- PatientPHRHistoryDTO dto = new PatientPHRHistoryDTO();
- dto.setPatientIdx(patientIdx);
- dto.setPhrType(phrType);
-
- return phrService.selectPHRHistoryList(dto);
-
- }
- }
|