Przeglądaj źródła

处方查询新增

wangjun 4 lat temu
rodzic
commit
0064162a77

+ 60 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -8735,4 +8735,64 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
       }
       return envelop;
    }
    //应声开具处方管理
    public MixEnvelop prescriptionManage(String keyWord,String startTime,String endTime,String checkStatus,Integer page,Integer pageSize){
        String sql = " select p.create_time as \"createTime\"," +
                " p.patient_name as \"patientName\"," +
                " p.idcard as \"idcard\"," +
                " o.card_no as \"cardNo\"," +
                " p.check_status as \"checkStatus\"," +
                " p.check_reason as \"checkReason\" " +
                " from wlyy_prescription p left join wlyy_outpatient o on p.outpatient_id  = o.id" +
                " where  1=1";
        if (StringUtils.isNotBlank(keyWord)){
            sql+=" and (p.patient_name like '%"+keyWord+"%' or p.idcard = '"+keyWord+"'" +
                    " or o.card_no = '"+keyWord+"')";
        }
        if(StringUtils.isNotBlank(checkStatus)){
            sql+=" and p.check_status ="+checkStatus;
        }
        wechatId = "12";
        if(StringUtils.isNotBlank(startTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and p.create_time > '" + startTime + " 00:00:00'";
                }else {
                    sql+=" and p.create_time > to_date('" + startTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and p.create_time > '" + startTime + " 00:00:00' ";
            }
        }
        if(StringUtils.isNotBlank(endTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+="  and p.create_time<'" + endTime + " 23:59:59'";
                }else {
                    sql+=" and p.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                }
            }else{
                sql+="  and p.create_time<'" + endTime + " 23:59:59'";
            }
        }
        sql+=" order by p.create_time desc";
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlcount);
        if(total!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        }
        List<Map<String,Object>> resultList = hibenateUtils.createSQLQuery(sql,page,pageSize);
        for (Map<String,Object> map:resultList){
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            map.put("createTime",null==map.get("createTime")?"":sdf.format(new Date(Long.parseLong(map.get("createTime").toString()))));
        }
        MixEnvelop mixEnvelop = new MixEnvelop();
        mixEnvelop.setDetailModelList(resultList);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setTotalCount(count.intValue());
        return  mixEnvelop;
    }
}

+ 3 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -3124,7 +3124,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
     * @return
     * @throws Exception
     */
    public void saveEmrToEntrance(String prescriptionId) throws Exception {
    public String  saveEmrToEntrance(String prescriptionId) throws Exception {
        Map<String,String> params = new HashedMap();
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
        JSONObject paramRequest = new JSONObject();
@ -3175,12 +3175,14 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        logger.info("保存电子病历"+response);
        if (response.contains("error:插入失败")){
            logger.info("保存失败:"+response);
            return "faild";
        }else {
            object = JSONObject.parseObject(response);
            if(object.getInteger("status")==200){
                jsonObject = object.getJSONObject("obj");
                logger.info("保存成功:"+jsonObject);
            }
            return "success";
        }
    }
    /**

+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -483,6 +483,8 @@ public class BaseHospitalRequestMapping {
        public static final String saveEmrToEntrance="/saveEmrToEntrance";
        //处方管理
        public static final String prescriptionManage="/prescriptionManage";
        public static final String findEmrByPrescriptionId="/findEmrByPrescriptionId";

+ 18 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -2219,4 +2219,22 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        objEnvelop.setObj(xzzxEntranceService.saveEmrToEntrance(prescriptionId));
        return objEnvelop;
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.prescriptionManage)
    @ApiOperation(value = "处方管理")
    public MixEnvelop prescriptionManage(
            @ApiParam(name = "keyWord", value = "患者姓名或证件号或就诊卡")
            @RequestParam(value = "keyWord",defaultValue = "",required = false) String keyWord,
            @ApiParam(name = "startTime", value = "开始时间")
            @RequestParam(value = "startTime",defaultValue = "",required = false) String startTime,
            @ApiParam(name = "endTime", value = "结束时间")
            @RequestParam(value = "endTime",defaultValue = "",required = false) String endTime,
            @ApiParam(name = "checkStatus", value = "处方状态")
            @RequestParam(value = "checkStatus",defaultValue = "",required = false) String checkStatus,
            @ApiParam(name = "page", value = "页数")
            @RequestParam(value = "page",defaultValue = "",required = false) Integer page,
            @ApiParam(name = "pageSize",value = "页大小")
            @RequestParam(value = "pageSize",defaultValue = "",required = false) Integer pageSize) throws Exception {
        return prescriptionService.prescriptionManage(keyWord,startTime,endTime,checkStatus,page,pageSize);
    }
}