Browse Source

居民端

trick9191 7 năm trước cách đây
mục cha
commit
2b2d23739c

+ 13 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -80,17 +80,20 @@ public class PrescriptionInfoService extends BaseService {
     * @param type
     * @return
     */
    public JSONArray getPrescriptionInfos(String type,String state,String startDate,String endDate,String patient){
    public JSONArray getPrescriptionInfos(String type,String startDate,String endDate,String patient,String isRenewal){
        if(StringUtils.isNotBlank(type)){
            if("1".equals(type)){
                //基卫接口
            }else{
                StringBuffer sqlBuffer = new StringBuffer("SELECT p.code,p.create_time AS date,p.status,p.hospital_name As hospital FROM wlyy_prescription p " +
                        "WHERE p.status =? AND p.patient=?");
                StringBuffer sqlBuffer = new StringBuffer("SELECT p.code,p.create_time AS date,p.status,p.hospital_name As hospitalName FROM wlyy_prescription p " +
                        "WHERE p.patient=?");
                List<Object> params = new ArrayList<>();
                params.add(state);
                params.add(patient);
                //查询已经审核通过的,否则查询所有
                if("2".equals(type)){
                    sqlBuffer.append(" AND p.status >=10 ");
                }
                if(StringUtils.isNotBlank(startDate)){
                    sqlBuffer.append(" AND p.create_time >= ?");
                    params.add(startDate+" 00:00:00");
@ -101,6 +104,12 @@ public class PrescriptionInfoService extends BaseService {
                }
                //本地库
                List<Map<String,Object>> rs =jdbcTemplate.queryForList(sqlBuffer.toString(),params.toArray());
                for(Map<String,Object> map :rs){
                    String code = (String)map.get("code");
                    map.put("prescriptionInfo",prescriptionDiagnosisService.getPrescriptionInfo(code));
                    map.put("prescriptionDt", prescriptionDiagnosisService.getPrescriptionDiagnosis(code));
                }
                return new JSONArray(rs);
            }
        }

+ 10 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionInfoController.java

@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@ -29,22 +30,22 @@ public class PatientPrescriptionInfoController extends BaseController {
     * @param type
     * @return
     */
    @RequestMapping(value = "/getPrescriptionInfos")
    @RequestMapping(value = "/getPrescriptionInfos" , method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取长处方信息列表")
    public String getPrescriptionInfos(@RequestParam(required = true)@ApiParam(name="type",value="1:查询处方;2我的续方;3:续方记录")String type,
                                       @RequestParam(required = true)@ApiParam(name="state",value="状态")String state,
                                       @RequestParam(required = true)@ApiParam(name="startDate",value="开始时间")String startDate,
                                       @RequestParam(required = true)@ApiParam(name="endDate",value="结束时间")String endDate){
                                       @RequestParam(required = false)@ApiParam(name="isRenewal",value="处方是否可续方:1.是;2.无过滤")String isRenewal,
                                       @RequestParam(required = false)@ApiParam(name="startDate",value="开始时间")String startDate,
                                       @RequestParam(required = false)@ApiParam(name="endDate",value="结束时间")String endDate){
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionInfos(type,state,startDate,endDate,getRepUID()));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionInfos(type,startDate,endDate,getRepUID(),isRenewal));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescription")
    @RequestMapping(value = "/getPrescription" ,method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取长处方详细信息")
    public String getPrescription(@RequestParam(required = true)@ApiParam(name="code",value="处方CODE")String code){
@ -57,7 +58,7 @@ public class PatientPrescriptionInfoController extends BaseController {
        }
    }
    @RequestMapping(value = "/getContinuedPrescription")
    @RequestMapping(value = "/getContinuedPrescription", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取续方详细信息")
    public String getContinuedPrescription(@RequestParam(required = true)@ApiParam(name="code",value="续方CODE")String code){
@ -69,7 +70,7 @@ public class PatientPrescriptionInfoController extends BaseController {
        }
    }
    @RequestMapping(value = "/getPrescriptionProcess")
    @RequestMapping(value = "/getPrescriptionProcess" ,method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取续方记录详细信息")
    public String getPrescriptionProcess(@RequestParam(required = true)@ApiParam(name="code",value="续方CODE")String code){
@ -81,7 +82,7 @@ public class PatientPrescriptionInfoController extends BaseController {
        }
    }
    @RequestMapping(value = "/cancelPrescriotion")
    @RequestMapping(value = "/cancelPrescriotion" , method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "取消续方")
    public String cancelPrescriotion(@RequestParam(required = true)@ApiParam(name="code",value="续方CODE")String code){