Ver código fonte

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 8 anos atrás
pai
commit
285fef15e3

+ 5 - 4
patient-co-figure/src/main/java/com/yihu/figure/controller/DiseaseController.java

@ -77,7 +77,7 @@ public class DiseaseController extends BaseController {
    @RequestMapping(value = "getVisits", method = RequestMethod.GET)
    public String getVisits(
            @ApiParam(name = "patientCode", value = "患者code", required = true) @RequestParam(value = "patientCode", required = true) String patientCode,
            @ApiParam(name = "icdName", value = "主诊断", required = false) @RequestParam(value = "icdName", required = false) String icdName,
            @ApiParam(name = "icdName", value = "主诊断(高血压或者糖尿病)", required = false) @RequestParam(value = "icdName", required = false) String icdName,
            @ApiParam(name = "time", value = "时间", required = false) @RequestParam(value = "time", required = false) String time) {
        try {
            List<Visit> visitList = diseaseService.getVisits(patientCode,time,icdName);
@ -85,7 +85,7 @@ public class DiseaseController extends BaseController {
            visitList.stream().forEach( v->{
                JSONObject jo=new JSONObject();
                jo.put("orgName",v.getOrgName());
                jo.put("typeName",v.getTypeName());
                jo.put("typeName",v.getTypeName());//住院或者门诊
                jo.put("time", DateUtil.dateToStr(v.getEndTime(),"yyyy-MM-dd"));
                ja.put(jo);
            });
@ -100,14 +100,15 @@ public class DiseaseController extends BaseController {
    @RequestMapping(value = "getInspections", method = RequestMethod.GET)
    public String getInspections(
            @ApiParam(name = "patientCode", value = "患者code", required = true) @RequestParam(value = "patientCode", required = true) String patientCode,
            @ApiParam(name = "type", value = "类型(1高血压 2糖尿病)", required = false) @RequestParam(value = "type", required = false) String type,
            @ApiParam(name = "time", value = "时间", required = false) @RequestParam(value = "time", required = false) String time) {
        try {
            List<Inspection> inspections = diseaseService.getInspections(patientCode,time);
            List<Inspection> inspections = diseaseService.getInspections(patientCode,time,type);
            JSONArray ja=new JSONArray();
            inspections.stream().forEach( v->{
                JSONObject jo=new JSONObject();
                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"));
                ja.put(jo);
            });

+ 32 - 0
patient-co-figure/src/main/java/com/yihu/figure/controller/patient/PatientController.java

@ -7,6 +7,7 @@ import com.yihu.figure.util.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * Created by chenweida on 2017/3/7.
 */
@ -52,5 +55,34 @@ public class PatientController extends BaseController {
        }
    }
    @ApiOperation(value = "获取示例患者信息列表")
    @RequestMapping(value = "getPatientList", method = RequestMethod.GET)
    public String getPatientInfo() {
        try {
            JSONArray ja=new JSONArray();
            List<PatientInfo> patientInfos = patientInfoService.getPatientList();
            patientInfos.stream().forEach( patientInfo->{
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("name", patientInfo.getName());
                jsonObject.put("code", patientInfo.getCode());
                //jsonObject.put("sex", patientInfo.getSex());
                //jsonObject.put("xbs", patientInfo.getXbs());
                //jsonObject.put("jws", patientInfo.getJws());
               // jsonObject.put("grs", patientInfo.getGrs());
               // jsonObject.put("jzs", patientInfo.getJzs());
               // jsonObject.put("hys", patientInfo.getHys());
              //  jsonObject.put("age", DateUtil.getAgeByBirthday(patientInfo.getBirthday()));
              //  jsonObject.put("userPortraits", patientInfo.getUserPortraits());
              //  jsonObject.put("suggests", patientInfo.getSuggests());
                ja.put(jsonObject);
            });
            return write(200, "获取成功!", "patient", ja);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, e.getMessage());
        }
    }
}

+ 3 - 0
patient-co-figure/src/main/java/com/yihu/figure/dao/patient/PatientInfoDao.java

@ -15,4 +15,7 @@ public interface PatientInfoDao extends PagingAndSortingRepository<PatientInfo,
    @Query("from PatientInfo p ")
    List<PatientInfo> findAllPatient();
    @Query("from PatientInfo p where (p.code='test1' or p.code='test2'or p.code='test3') ")
    List<PatientInfo> findByHasCode();
}

+ 0 - 1
patient-co-figure/src/main/java/com/yihu/figure/model/disease/Inspection.java

@ -29,7 +29,6 @@ public class Inspection extends IdEntity {
    private String patientCode;//患者code
    private String cataLogCodeName;//类别名称
    public Inspection() {
    }

+ 17 - 1
patient-co-figure/src/main/java/com/yihu/figure/service/DiseaseService.java

@ -138,11 +138,13 @@ public class DiseaseService {
            params.add("%"+icdName+"%");
        }
        sql.append(" order by f.end_time desc ");
        List<Visit> visisList= jdbcTemplate.query(sql.toString(),params.toArray(),new BeanPropertyRowMapper(Visit.class));
        return visisList;
    }
    public List<Inspection> getInspections(String patientCode,String time) {
    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);
@ -154,6 +156,20 @@ public class DiseaseService {
            sql.append(" and f.end_time < ? ");
            params.add( LocalDate.of(Integer.valueOf(time),1,1).plusYears(1).toString());
        }
        if(!StringUtils.isEmpty(type))
        {
            sql.append(" and ( " +
                    " f.item like '%血常规%' or " +
                    " f.item like '%血糖%' or " +
                    " f.item like '%糖化%' or " +
                    " f.item like '%蛋白%' or " +
                    " f.item like '%眼底%' or " +
                    " f.item like '%肝功%'  ) ");
        }
        sql.append(" order by f.end_time desc ");
        List<Inspection> inspectionList= jdbcTemplate.query(sql.toString(),params.toArray(),new BeanPropertyRowMapper(Inspection.class));
        return inspectionList;
    }

+ 5 - 0
patient-co-figure/src/main/java/com/yihu/figure/service/PatientInfoService.java

@ -48,4 +48,9 @@ public class PatientInfoService extends BaseService {
        patient.setSuggests(map);
        return patient;
    }
    public List<PatientInfo> getPatientList() {
        List<PatientInfo>  pas=patientInfoDao.findByHasCode();
        return pas;
    }
}

BIN
patient-co-figure/文档/接口文档.docx