chenweida пре 8 година
родитељ
комит
e01e5b9c37

+ 28 - 0
patient-co-figure/src/main/java/com/yihu/figure/controller/DiseaseController.java

@ -85,6 +85,7 @@ public class DiseaseController extends BaseController {
            visitList.stream().forEach( v->{
            visitList.stream().forEach( v->{
                JSONObject jo=new JSONObject();
                JSONObject jo=new JSONObject();
                jo.put("orgName",v.getOrgName());
                jo.put("orgName",v.getOrgName());
                jo.put("id",v.getId());
                jo.put("diagnosis",v.getDiagnosis());//主诊断结果
                jo.put("diagnosis",v.getDiagnosis());//主诊断结果
                jo.put("typeName",v.getTypeName());//住院或者门诊
                jo.put("typeName",v.getTypeName());//住院或者门诊
                jo.put("time", DateUtil.dateToStr(v.getEndTime(),"yyyy-MM-dd"));
                jo.put("time", DateUtil.dateToStr(v.getEndTime(),"yyyy-MM-dd"));
@ -108,6 +109,7 @@ public class DiseaseController extends BaseController {
            JSONArray ja=new JSONArray();
            JSONArray ja=new JSONArray();
            inspections.stream().forEach( v->{
            inspections.stream().forEach( v->{
                JSONObject jo=new JSONObject();
                JSONObject jo=new JSONObject();
                jo.put("id",v.getId());
                jo.put("orgName",v.getOrgName());
                jo.put("orgName",v.getOrgName());
                jo.put("cataLogCodeName",v.getCataLogCodeName());//检查或者检验
                jo.put("cataLogCodeName",v.getCataLogCodeName());//检查或者检验
                jo.put("time", DateUtil.dateToStr(v.getEndTime(),"yyyy-MM-dd"));
                jo.put("time", DateUtil.dateToStr(v.getEndTime(),"yyyy-MM-dd"));
@ -119,4 +121,30 @@ public class DiseaseController extends BaseController {
            return error(-1, e.getMessage());
            return error(-1, e.getMessage());
        }
        }
    }
    }
    @ApiOperation(value = "删除检查检验")
    @RequestMapping(value = "deleteInspections", method = RequestMethod.POST)
    public String deleteInspections(
            @ApiParam(name = "id", value = "检查检验id", required = true) @RequestParam(value = "id", required = true) Long id) {
        try {
            diseaseService.deleteInspections(id);
            return success("删除成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
        }
    }
    @ApiOperation(value = "删除就诊事件")
    @RequestMapping(value = "deleteVisit", method = RequestMethod.POST)
    public String deleteVisit(
            @ApiParam(name = "id", value = "就诊事件id", required = true) @RequestParam(value = "id", required = true) Long id) {
        try {
            diseaseService.deleteVisit(id);
            return success("删除成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
        }
    }
}
}

+ 32 - 25
patient-co-figure/src/main/java/com/yihu/figure/service/DiseaseService.java

@ -39,7 +39,7 @@ public class DiseaseService {
     * @param strSSID
     * @param strSSID
     */
     */
    @Transactional
    @Transactional
    public void getResidentEventListJson(String strSSID,String patientCode) {
    public void getResidentEventListJson(String strSSID, String patientCode) {
        String url = baseurl + "data/getResidentEventListJson?strSSID=" + strSSID;
        String url = baseurl + "data/getResidentEventListJson?strSSID=" + strSSID;
        String response = HttpClientUtil.get(url, "UTF-8");
        String response = HttpClientUtil.get(url, "UTF-8");
        JSONObject obj = new JSONObject(response);
        JSONObject obj = new JSONObject(response);
@ -87,7 +87,7 @@ public class DiseaseService {
     * @param strSSID
     * @param strSSID
     */
     */
    @Transactional
    @Transactional
    public void GetRecordListByCatalogcodesJson(String strSSID,String patientCode) {
    public void GetRecordListByCatalogcodesJson(String strSSID, String patientCode) {
        String url = baseurl + "data/GetRecordListByCatalogcodesJson?strSSID=" + strSSID;
        String url = baseurl + "data/GetRecordListByCatalogcodesJson?strSSID=" + strSSID;
        String response = HttpClientUtil.get(url, "UTF-8");
        String response = HttpClientUtil.get(url, "UTF-8");
        JSONObject obj = new JSONObject(response);
        JSONObject obj = new JSONObject(response);
@ -105,8 +105,8 @@ public class DiseaseService {
                inspection.setOrgId(jo.getInt("ORG_ID"));
                inspection.setOrgId(jo.getInt("ORG_ID"));
                inspection.setOrgName(jo.getString("ORG_NAME"));
                inspection.setOrgName(jo.getString("ORG_NAME"));
                inspection.setR(jo.getInt("R"));
                inspection.setR(jo.getInt("R"));
                inspection.setSerial(jo.getInt("SERIAL")+"");
                inspection.setType(jo.getInt("TYPE")+"");
                inspection.setSerial(jo.getInt("SERIAL") + "");
                inspection.setType(jo.getInt("TYPE") + "");
                inspection.setUnionssid(jo.getString("UNIONSSID"));
                inspection.setUnionssid(jo.getString("UNIONSSID"));
                inspection.setXmanId(jo.getString("XMAN_ID"));
                inspection.setXmanId(jo.getString("XMAN_ID"));
                inspections.add(inspection);
                inspections.add(inspection);
@ -116,49 +116,47 @@ public class DiseaseService {
    }
    }
    /**
    /**
     *
     * @param patientCode
     * @param patientCode
     * @param time  2015
      * @return
     * @param time        2015
     * @return
     */
     */
    public List<Visit> getVisits(String patientCode,String time,String icdName) {
        StringBuffer sql=new StringBuffer("select * from figure_visit f where 1=1 and  f.patient_code =? ");
        List<Object> params=new ArrayList<>();
    public List<Visit> getVisits(String patientCode, String time, String icdName) {
        StringBuffer sql = new StringBuffer("select * from figure_visit f where 1=1 and  f.patient_code =? ");
        List<Object> params = new ArrayList<>();
        params.add(patientCode);
        params.add(patientCode);
        if(!StringUtils.isEmpty(time)){
        if (!StringUtils.isEmpty(time)) {
            sql.append(" and f.end_time >= ? ");
            sql.append(" and f.end_time >= ? ");
            params.add( LocalDate.of(Integer.valueOf(time),1,1).toString());
            params.add(LocalDate.of(Integer.valueOf(time), 1, 1).toString());
            sql.append(" and f.end_time < ? ");
            sql.append(" and f.end_time < ? ");
            params.add( LocalDate.of(Integer.valueOf(time),1,1).plusYears(1).toString());
            params.add(LocalDate.of(Integer.valueOf(time), 1, 1).plusYears(1).toString());
        }
        }
        if(!StringUtils.isEmpty(icdName)){
        if (!StringUtils.isEmpty(icdName)) {
            sql.append(" and f.diagnosis like ? ");
            sql.append(" and f.diagnosis like ? ");
            params.add("%"+icdName+"%");
            params.add("%" + icdName + "%");
        }
        }
        sql.append(" order by f.end_time desc ");
        sql.append(" order by f.end_time desc ");
        List<Visit> visisList= jdbcTemplate.query(sql.toString(),params.toArray(),new BeanPropertyRowMapper(Visit.class));
        List<Visit> visisList = jdbcTemplate.query(sql.toString(), params.toArray(), new BeanPropertyRowMapper(Visit.class));
        return visisList;
        return visisList;
    }
    }
    public List<Inspection> getInspections(String patientCode,String time,String type) {
        StringBuffer sql=new StringBuffer("select * from figure_inspection f where 1=1 and  f.patient_code =? ");
        List<Object> params=new ArrayList<>();
    public List<Inspection> getInspections(String patientCode, String time, String type) {
        StringBuffer sql = new StringBuffer("select * from figure_inspection f where 1=1 and  f.patient_code =? ");
        List<Object> params = new ArrayList<>();
        params.add(patientCode);
        params.add(patientCode);
        if(!StringUtils.isEmpty(time)){
        if (!StringUtils.isEmpty(time)) {
            sql.append(" and f.end_time >= ? ");
            sql.append(" and f.end_time >= ? ");
            params.add( LocalDate.of(Integer.valueOf(time),1,1).toString());
            params.add(LocalDate.of(Integer.valueOf(time), 1, 1).toString());
            sql.append(" and f.end_time < ? ");
            sql.append(" and f.end_time < ? ");
            params.add( LocalDate.of(Integer.valueOf(time),1,1).plusYears(1).toString());
            params.add(LocalDate.of(Integer.valueOf(time), 1, 1).plusYears(1).toString());
        }
        }
        if(!StringUtils.isEmpty(type))
        {
        if (!StringUtils.isEmpty(type)) {
            sql.append(" and ( " +
            sql.append(" and ( " +
                    " f.item like '%血常规%' or " +
                    " f.item like '%血常规%' or " +
                    " f.item like '%血糖%' or " +
                    " f.item like '%血糖%' or " +
@ -170,8 +168,17 @@ public class DiseaseService {
        sql.append(" order by f.end_time desc ");
        sql.append(" order by f.end_time desc ");
        List<Inspection> inspectionList= jdbcTemplate.query(sql.toString(),params.toArray(),new BeanPropertyRowMapper(Inspection.class));
        List<Inspection> inspectionList = jdbcTemplate.query(sql.toString(), params.toArray(), new BeanPropertyRowMapper(Inspection.class));
        return inspectionList;
        return inspectionList;
    }
    }
    @Transactional
    public void deleteInspections(Long id) {
        inspectionDao.delete(id);
    }
    @Transactional
    public void deleteVisit(Long id) {
        visitDao.delete(id);
    }
}
}

+ 1 - 1
patient-co-figure/src/main/resources/application.yml

@ -73,7 +73,7 @@ spring:
  profiles: prod
  profiles: prod
  datasource:
  datasource:
    url: jdbc:mysql://59.61.92.94:3306/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://59.61.92.94:3306/figure?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    username: wlyy
    password: jkzlehr@123
    password: jkzlehr@123