瀏覽代碼

代码修改

LAPTOP-KB9HII50\70708 3 年之前
父節點
當前提交
2a58c5a564

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

@ -180,7 +180,7 @@ public class HealthCareService {
    /**
     * 2.3.1	医师身份验证(处方权,多点执业等)
     */
    public void doctorAuthentication(String doctorId) throws Exception{
    public String doctorAuthentication(String doctorId) throws Exception{
        BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
        if (doctorDO == null){
            throw new Exception("医生不存在");
@ -195,11 +195,22 @@ public class HealthCareService {
        data.put("his_dept_name",doctorHospitalDO.getDeptName());//his内部科室名称
//        data.put("dept_code","");//医保科室编码	String	N
//        data.put("dept_name","");//医保科室名称	String	N
        data.put("medical_mode","10");//医疗就诊方式	10	门(急)诊
        data.put("name",doctorDO.getName());//医师姓名
        data.put("idcard",doctorDO.getIdcard());//医师证件号
        data.put("cert_type","01");//医师证件类型
        requestYlz(data,"N20.17.02.01","医师身份验证");
        String result = requestYlz(data,"N20.17.02.01","医师身份验证");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("医师身份验证:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
        }
        return result;
    }
    /**
@ -207,7 +218,7 @@ public class HealthCareService {
     * @param doctorId
     * @throws Exception
     */
    public void doctorFaceCheckInAddress(String doctorId)throws Exception{
    public String doctorFaceCheckInAddress(String doctorId)throws Exception{
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findOne("ylzConfigFaceReturnUrl");
        if(hospitalSysDictDO == null){
            throw new Exception("未配置回调地址");
@ -221,13 +232,23 @@ public class HealthCareService {
        data.put("idcard",doctorDO.getIdcard());//医师证件号
        data.put("cert_type","01");//医师证件类型
        data.put("redirect_url",hospitalSysDictDO.getDictValue());//回调地址
        requestYlz(data,"N20.17.02.02","医师人脸签到表单地址");
        String result = requestYlz(data,"N20.17.02.02","医师人脸签到表单地址");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("医师人脸签到表单地址:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
        }
        return result;
    }
    /**
     * 2.3.3	获取医师人脸签到数据
     */
    public void doctorFaceCheckInData(String doctorId)throws Exception{
    public String doctorFaceCheckInData(String doctorId)throws Exception{
        BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
        if (doctorDO == null){
            throw new Exception("医生不存在");
@ -236,13 +257,23 @@ public class HealthCareService {
        data.put("name",doctorDO.getName());//医师姓名
        data.put("idcard",doctorDO.getIdcard());//医师证件号
        data.put("cert_type","01");//医师证件类型
        requestYlz(data,"N20.17.02.05","获取医师人脸签到数据");
        String result = requestYlz(data,"N20.17.02.05","获取医师人脸签到数据");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("获取医师人脸签到数据:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
        }
        return result;
    }
    /**
     * 2.4.1 事前提醒
     */
    public void advanceWarning(String outpatientId) throws Exception{
    public String advanceWarning(String outpatientId) throws Exception{
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
        if (outpatientDO == null){
            throw new Exception("事前提醒失败:门诊信息不存在");
@ -349,14 +380,24 @@ public class HealthCareService {
        data.put("mxlist",mxlist);
        requestYlz(data,"N20.17.03.03","事前提醒");
        String result = requestYlz(data,"N20.17.03.03","事前提醒");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("事前提醒:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
        }
        return result;
    }
    /**
     * 2.4.2	医师开方上传
     */
    public void doctorPrescriptionUpload(String prescriptionId)throws Exception{
    public String doctorPrescriptionUpload(String prescriptionId)throws Exception{
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
        if (wlyyPrescriptionDO == null){
            throw new Exception("续方信息不存在");
@ -482,13 +523,23 @@ public class HealthCareService {
        data.put("mxlist",mxlist);
        requestYlz(data,"N20.17.03.01","医师开方上传");
        String result = requestYlz(data,"N20.17.03.01","医师开方上传");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("医师开方上传:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
        }
        return result;
    }
    /**
     * 2.4.3	医师开方上传取消(N20.17.03.06)
     */
    public void doctorPrescriptionUploadCancle(String prescriptionId,String cancelReason)throws Exception{
    public String doctorPrescriptionUploadCancle(String prescriptionId,String cancelReason)throws Exception{
        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
        JSONObject data = new JSONObject();
        data.put("transaction_no","");//处方上传流水号  	String	Y
@ -501,13 +552,23 @@ public class HealthCareService {
        data.put("data_source","");//数据来源	String	Y	参见编码附件
        requestYlz(data,"N20.17.03.06","医师开方上传取消");
        String result = requestYlz(data,"N20.17.03.06","医师开方上传取消");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("医师开方上传:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
        }
        return result;
    }
    /**
     * 2.6.1	电子处方订单接收(N20.17.05.02)
     */
    public void electronicPrescriptionReceiving(String outpatientId)throws Exception{
    public String electronicPrescriptionReceiving(String outpatientId)throws Exception{
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
        if (outpatientDO == null){
            throw new Exception("门诊信息不存在");
@ -583,13 +644,23 @@ public class HealthCareService {
//        item_code	医保项目编码	String	Y
//        supervision_code	药品电子监管码	String	N	非必填
        requestYlz(data,"N20.17.05.02","电子处方订单接收");
        String result = requestYlz(data,"N20.17.05.02","电子处方订单接收");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("电子处方订单接收:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
        }
        return result;
    }
    /**
     *2.6.2	电子处方订单取消(N20.17.05.03)
     */
    public void electronicPrescriptionCancle(String outpatientId)throws Exception{
    public String electronicPrescriptionCancle(String outpatientId)throws Exception{
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
        if (outpatientDO == null){
            throw new Exception("门诊信息不存在");
@ -609,13 +680,23 @@ public class HealthCareService {
        data.put("cancel_time","");//订单取消时间  取消时必填
        data.put("cancel_reason","");//取消原因
        requestYlz(data,"N20.17.05.03","电子处方订单取消");
        String result = requestYlz(data,"N20.17.05.03","电子处方订单取消");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("电子处方订单取消:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
        }
        return result;
    }
    /**
     * 2.6.3 获取处方流转平台药师审方结果(N20.17.05.04)
     */
    public void pharmacistReviewResults(String outpatientId)throws Exception{
    public String pharmacistReviewResults(String outpatientId)throws Exception{
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outpatientId);
        if (outpatientDO == null){
            throw new Exception("门诊信息不存在");
@ -628,7 +709,17 @@ public class HealthCareService {
        }
        data.put("prescription_code",wlyyPrescriptionDOS.get(0).getRealOrder());//医院处方编号
        String response = requestYlz(data,"N20.17.05.04","获取处方流转平台药师审方结果");
        String result = requestYlz(data,"N20.17.05.04","获取处方流转平台药师审方结果");
        if(result == null){
            throw new Exception("医保请求失败");
        }
        logger.info("获取处方流转平台药师审方结果:"+result);
        JSONObject object = JSONObject.parseObject(result);
        if (object.getString("flag").equalsIgnoreCase("1")){
            JSONObject encryptData = object.getJSONObject("encrypt_data");
            return encryptData.toJSONString();
        }
        return result;
    }
    public String getYlzToken() throws Exception {

+ 66 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/healthCare/HealthCareEndPoint.java

@ -117,6 +117,72 @@ public class HealthCareEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private HealthCareService healthCareService;
    @GetMapping(value = "doctorAuthentication")
    @ApiOperation(value = "医师身份验证", notes = "医师身份验证")
    public ObjEnvelop doctorAuthentication(@ApiParam(name = "doctorId", value = "医生id", required = true)
                                           @RequestParam(value = "doctorId",required = true) String doctorId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.doctorAuthentication(doctorId));
    }
    @GetMapping(value = "doctorFaceCheckInAddress")
    @ApiOperation(value = "医师人脸签到表单地址", notes = "医师人脸签到表单地址")
    public ObjEnvelop doctorFaceCheckInAddress(@ApiParam(name = "doctorId", value = "医生id", required = true)
                                           @RequestParam(value = "doctorId",required = true) String doctorId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.doctorFaceCheckInAddress(doctorId));
    }
    @GetMapping(value = "doctorFaceCheckInData")
    @ApiOperation(value = "获取医师人脸签到数据", notes = "获取医师人脸签到数据")
    public ObjEnvelop doctorFaceCheckInData(@ApiParam(name = "doctorId", value = "医生id", required = true)
                                               @RequestParam(value = "doctorId",required = true) String doctorId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.doctorFaceCheckInData(doctorId));
    }
    @PostMapping(value = "advanceWarning")
    @ApiOperation(value = "事前提醒", notes = "事前提醒")
    public ObjEnvelop advanceWarning(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                            @RequestParam(value = "outpatientId",required = true) String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.advanceWarning(outpatientId));
    }
    @PostMapping(value = "doctorPrescriptionUpload")
    @ApiOperation(value = "医师开方上传", notes = "医师开方上传")
    public ObjEnvelop doctorPrescriptionUpload(@ApiParam(name = "prescriptionId", value = "处方id", required = true)
                                     @RequestParam(value = "prescriptionId",required = true) String prescriptionId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.doctorPrescriptionUpload(prescriptionId));
    }
    @PostMapping(value = "doctorPrescriptionUploadCancle")
    @ApiOperation(value = "医师开方上传取消", notes = "医师开方上传取消")
    public ObjEnvelop doctorPrescriptionUploadCancle(@ApiParam(name = "prescriptionId", value = "处方id", required = true)
                                               @RequestParam(value = "prescriptionId",required = true) String prescriptionId,
                                               @ApiParam(name = "cancelReason",value="取消原因",required = true)
                                               @RequestParam(value = "cancelReason",required = true) String cancelReason)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.doctorPrescriptionUploadCancle(prescriptionId,cancelReason));
    }
    @GetMapping(value = "electronicPrescriptionReceiving")
    @ApiOperation(value = "电子处方订单接收", notes = "电子处方订单接收")
    public ObjEnvelop electronicPrescriptionReceiving(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                                     @RequestParam(value = "outpatientId",required = true) String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.electronicPrescriptionReceiving(outpatientId));
    }
    @PostMapping(value = "electronicPrescriptionCancle")
    @ApiOperation(value = "电子处方订单取消", notes = "电子处方订单取消")
    public ObjEnvelop electronicPrescriptionCancle(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                                      @RequestParam(value = "outpatientId",required = true) String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.electronicPrescriptionCancle(outpatientId));
    }
    @GetMapping(value = "pharmacistReviewResults")
    @ApiOperation(value = "获取处方流转平台药师审方结果", notes = "获取处方流转平台药师审方结果")
    public ObjEnvelop pharmacistReviewResults(@ApiParam(name = "outpatientId", value = "门诊id", required = true)
                                                      @RequestParam(value = "outpatientId",required = true) String outpatientId)throws Exception{
        return ObjEnvelop.getSuccess("ok",healthCareService.pharmacistReviewResults(outpatientId));
    }
    @GetMapping(value = "/getYlzToken")
    @ApiOperation(value = "获取医保accessToken", notes = "获取医保accessToken")
    public ObjEnvelop getChargeDict()throws Exception{