Browse Source

眼科视力筛查接口

wangzhinan 1 năm trước cách đây
mục cha
commit
7038abfbf2

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/healthCare/service/HealthCareService.java

@ -1598,7 +1598,7 @@ public class HealthCareService {
                    ylzMedicailBillDao.save(ylzMb);
                }
            }else {
                throw new Exception(object.getString("cause"));
                throw new Exception(resObj.getString("cause"));
            }
        }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 632 - 547
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java


+ 31 - 10
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -2255,7 +2255,7 @@ public class YkyyEntranceService {
     * @throws Exception
     */
    public JSONArray findHisDoctor(String idcard) throws Exception{
        String sql ="select y.code AS \"code\",y.ygbh,y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\" from v_Hlw_Ysxx y where y.idcard ='"+idcard+"'";
        String sql ="select y.code AS \"code\",y.ygbh,y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\",y.ksdm as \"ksdm\" from v_Hlw_Ysxx y where y.idcard ='"+idcard+"'";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -2385,6 +2385,16 @@ public class YkyyEntranceService {
            hlwGhmxDO.setBRXZ(json.getInteger("brxz"));
            brid = json.getInteger("brid");
        }
        String doctor = map.get("doctorCode").toString();
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String ksdm = "";
        //操作工号
        JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
        if(jsonArray1!=null&&jsonArray1.size()>0){
            //获取医生信息
            JSONObject json = jsonArray1.getJSONObject(0);
            ksdm=json.getString("ksdm");
        }
        hlwGhmxDO.setSBXH(0);
        hlwGhmxDO.setGHCS(1);
        hlwGhmxDO.setGHJE(0);
@ -2403,7 +2413,7 @@ public class YkyyEntranceService {
        hlwGhmxDO.setSFFS(0);
        hlwGhmxDO.setJZZT(2);
        hlwGhmxDO.setJZXH(0);
        hlwGhmxDO.setKSDM(map.get("deptCode").toString());
        hlwGhmxDO.setKSDM(ksdm);
        hlwGhmxDO.setBRID(brid);
        hlwGhmxDO.setGHSJ(new Date());//挂号时间
        hlwGhmxDO.setGHLB(1);//挂号类别
@ -2463,7 +2473,7 @@ public class YkyyEntranceService {
        hlwYsMzJzLsDO.setJZXH(0);
        hlwYsMzJzLsDO.setGHXH(GHXH);
        hlwYsMzJzLsDO.setBRBH(brid);
        hlwYsMzJzLsDO.setKSDM(Integer.parseInt(map.get("deptCode").toString()));
        hlwYsMzJzLsDO.setKSDM(Integer.parseInt(ksdm));
        hlwYsMzJzLsDO.setYSDM(map.get("doctorCode").toString());
        hlwYsMzJzLsDO.setKSSJ(DateUtil.getNowDate());
        hlwYsMzJzLsDO.setJSSJ(DateUtil.getNight23());
@ -2694,7 +2704,6 @@ public class YkyyEntranceService {
        hlwGhmxDO.setSFFS(0);
        hlwGhmxDO.setJZZT(2);
        hlwGhmxDO.setJZXH(0);
        hlwGhmxDO.setKSDM(wlyyPrescriptionVO.getDept());
        hlwGhmxDO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
        hlwGhmxDO.setGHSJ(new Date());//挂号时间
        hlwGhmxDO.setGHLB(1);//挂号类别
@ -2709,12 +2718,16 @@ public class YkyyEntranceService {
        }else {
            throw new Exception("患者信息有误!");
        }
        String ksdm = "";
        //操作工号
        JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
        if(jsonArray1!=null&&jsonArray1.size()>0){
            //获取医生信息
            JSONObject json = jsonArray1.getJSONObject(0);
            hlwGhmxDO.setCZGH(json.getString("YGBH"));
            hlwGhmxDO.setKSDM(json.getString("ksdm"));
            ksdm=json.getString("ksdm");
         /*   hlwGhmxDO.set*/
        }
        // 同一个医生同一个病人,一天一条挂号记录。
@ -2781,7 +2794,7 @@ public class YkyyEntranceService {
                hlwYsMzJzLsDO.setJZXH(0);
                hlwYsMzJzLsDO.setGHXH(GHXH);
                hlwYsMzJzLsDO.setBRBH(Integer.parseInt(patientMappingDO.getMappingCode()));
                hlwYsMzJzLsDO.setKSDM(Integer.parseInt(wlyyPrescriptionVO.getDept()));
                hlwYsMzJzLsDO.setKSDM(Integer.parseInt(ksdm));
                hlwYsMzJzLsDO.setYSDM(doctorMappingDO.getMappingCode());
                hlwYsMzJzLsDO.setKSSJ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
                hlwYsMzJzLsDO.setJSSJ(DateUtil.getNight23());
@ -2884,13 +2897,23 @@ public class YkyyEntranceService {
        logger.info("开始===================");
        if (wlyyPrescriptionVO!=null&&wlyyPrescriptionVO.getInfoVOs()!=null){
            try {
                String doctor = wlyyPrescriptionVO.getDoctor();
                DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
                String ksdm = "";
                //操作工号
                JSONArray jsonArray1 = findHisDoctor(doctorMappingDO.getIdcard());
                if(jsonArray1!=null&&jsonArray1.size()>0){
                    //获取医生信息
                    JSONObject json = jsonArray1.getJSONObject(0);
                    ksdm=json.getString("ksdm");
                }
                hlwCf01DO.setSPZT(0);
                hlwCf01DO.setFKZT(wlyyPrescriptionVO.getPayStatus());
                if (StringUtils.isNoneBlank(drugCode)){
                    Integer yfsb = Integer.parseInt(drugCode);
                    hlwCf01DO.setYFSB(yfsb);
                }
                hlwCf01DO.setCFLX(wlyyPrescriptionVO.getType());
                hlwCf01DO.setKFRQ(DateUtil.strToDate(DateUtil.dateToStr(wlyyPrescriptionVO.getCreateTime(),"yyyy-MM-dd HH:mm:ss")));
                hlwCf01DO.setZFPB(0);
@ -2919,9 +2942,7 @@ public class YkyyEntranceService {
                }
                hlwCf01DO.setBRID(Integer.parseInt(patientMappingDO.getMappingCode()));
                hlwCf01DO.setBRXM(wlyyPrescriptionVO.getPatientName());
                hlwCf01DO.setKSDM(Integer.parseInt(wlyyPrescriptionVO.getDept()));
                String doctor = wlyyPrescriptionVO.getDoctor();
                DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
                hlwCf01DO.setKSDM(Integer.parseInt(ksdm));
                hlwCf01DO.setYSDM(doctorMappingDO.getMappingCode());
                hlwCf01DO.setJZKH(wlyyPrescriptionVO.getSsc());
                hlwCf01DO.setGUID(getCode());
@ -3364,7 +3385,7 @@ public class YkyyEntranceService {
        if(jsonArray1!=null&&jsonArray1.size()>0){
            JSONObject json = jsonArray1.getJSONObject(0);
            doctorHis=json.getString("code");
            kdks = Integer.parseInt(json.getString("dept"));
            kdks = Integer.parseInt(json.getString("ksdm"));
        }
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){

+ 16 - 0
common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java

@ -381,6 +381,22 @@ public class HttpClientUtil {
        return ret;
    }
    public  static JSONObject postBodySl(String url, com.alibaba.fastjson.JSONObject params,Map<String,Object> headerMap) {
        RestTemplate restTemplate = new RestTemplate();
        JSONObject object = new JSONObject();
        HttpHeaders headers = new HttpHeaders();
        for(String str:headerMap.keySet()){
            headers.add(str,headerMap.get(str).toString());
        }
        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(params.toString(), headers);
        org.springframework.http.HttpEntity<JSONObject> response = restTemplate.exchange(url, HttpMethod.POST,formEntity, JSONObject.class);
        object.put("header",response.getHeaders());
        object.put("body",response.getBody());
        return object;
    }
    public static String postBodyHead(String url, com.alibaba.fastjson.JSONObject params, Map<String, Object> headerMap) {
        RestTemplate restTemplate = new RestTemplate();

+ 39 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -600,5 +600,44 @@ public class YkyyController extends EnvelopRestEndpoint {
        }
    }
    @RequestMapping(value = "getStudentInfo", method = RequestMethod.POST)
    @ApiOperation("获取筛查学生视力档案" )
    public ObjEnvelop getStudentInfo(@ApiParam(name = "condition", value = "手机号/证件号/二维码", required = true)
                                 @RequestParam(required = true)String condition,
                                 @ApiParam(name = "type", value = "登录类型 1-手机号 2-证件号 3 二维码", required = true)
                                 @RequestParam(required = true)String type) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.getStudentInfo(condition,type));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @RequestMapping(value = "otherLogin", method = RequestMethod.POST)
    @ApiOperation("视力学生认证信息" )
    public ObjEnvelop otherLogin(@ApiParam(name = "condition", value = "手机号/证件号/二维码", required = true)
                                         @RequestParam(required = true)String condition,
                                 @ApiParam(name = "type", value = "登录类型 1-手机号 2-证件号 3 二维码", required = true)
                                 @RequestParam(required = true)String type) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.otherLogin(condition,type));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @RequestMapping(value = "otherVisionHealthArchives", method = RequestMethod.POST)
    @ApiOperation("获取学生视力筛查报告" )
    public ObjEnvelop otherVisionHealthArchives(@ApiParam(name = "authorization", value = "otherLogin获取到authorization", required = true)
                                 @RequestParam(required = true)String authorization) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",ykyyPrescriptionService.otherVisionHealthArchives(authorization));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}