Kaynağa Gözat

关注医生修改

wangjun 4 yıl önce
ebeveyn
işleme
80a0fd6e5a

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionCheckDao.java

@ -18,6 +18,9 @@ public interface PrescriptionCheckDao extends PagingAndSortingRepository<WlyyPre
    @Query("select a from WlyyPrescriptionCheckDO a where a.prescriptionId = ?1 order by a.createTime desc ")
    List<WlyyPrescriptionCheckDO> findByPrescriptionId(String prescriptionId);
    @Query("select a from WlyyPrescriptionCheckDO a where a.prescriptionId = ?1 and a.status in (1,2,3,4,5) order by a.createTime desc ")
    List<WlyyPrescriptionCheckDO> findByPrescriptionIdAndStatus(String prescriptionId);
    @Query("select a from WlyyPrescriptionCheckDO a where a.prescriptionId = ?1 and a.status=?2 order by a.createTime desc ")
    List<WlyyPrescriptionCheckDO> findByStatus(String prescriptionId,Integer status);

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

@ -2627,6 +2627,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                result1.put("mes", "开方提交成功");
                result1.put("prescriptionId",prescription.getId());
                return result1;
            }else if (wechatId.equalsIgnoreCase("sd_tnzyy_wx")) {
                Double price = prescription.getDrugFee();
                businessOrderService.recharge(prescription.getId(), "处方收费", "4", "处方收费", prescription.getPatientCode(), prescription.getPatientName(), prescription.getDoctor(), price);
                result.put("code", 1);
                result.put("mes", "诊断完成");
                result.put("prescriptionId",prescription.getId());
                return result;
            }else {
                result.put("code", 1);
                result.put("mes", "诊断完成");
@ -8393,7 +8400,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @return
     */
    public List<WlyyPrescriptionCheckDO> findPrescriptionCheck(String prescriptionId) {
        return prescriptionCheckDao.findByPrescriptionId(prescriptionId);
        return prescriptionCheckDao.findByPrescriptionIdAndStatus(prescriptionId);
    }
@ -10205,5 +10212,37 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return "接口调用失败";
    }
    /**
     * 根据doctorid获取待服务数量
     *
     * @return
     */
    public Long waitUpdoorCount(String doctor) {
       WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("waitUpdoorCount");
       String url = "";
       if (wlyyHospitalSysDictDO!=null){
           url = wlyyHospitalSysDictDO.getDictValue();
       }
       logger.info("waitUpdoorCountUrl:"+url);
       if (StringUtils.isNoneBlank(doctor)){
           url+="?doctor="+doctor;
       }
        Long doorServiceCount = 0L;
       try {
           String res = httpClientUtil.get(url,"UTF-8");
           logger.info("waitUpdoorCountres:"+res);
           if (StringUtils.isNoneBlank(res)){
               com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
               if (jsonObject!=null&&"200".equalsIgnoreCase(jsonObject.getString("status"))){
                   String dataCount = jsonObject.getString("data");
                   doorServiceCount = Long.parseLong(dataCount);
               }
           }
       }catch (Exception e){
           e.printStackTrace();
           return doorServiceCount;
       }
       return doorServiceCount;
    }
}

+ 202 - 1
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -3899,7 +3899,7 @@ public class ImService {
		return mapList;
	}
	/**
	/**TnyyEntranceService
	 * 修改视频会话邀请状态
	 * @param session_id session_id
	 * @param status 1发起,0挂断
@ -4263,4 +4263,205 @@ public class ImService {
		}
		return count;
	}
	public List<Map<String,Object>> doctorUpcomingList2(String doctorCode, String type) {
		String sql = "";
		if("1,15,17".equals(type)) {
			/*sql = "SELECT " +
					"a.id AS \"id\"," +
					"a.type AS \"type\"," +
					"a.title AS \"title\"," +
					"a.symptoms AS \"symptoms\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
				}else{
					sql = sql + "to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
				}
			}else{
				sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}
			sql = sql +"b.status AS \"status\"," +
					"b.evaluate AS \"evaluate\"," +
					"b.doctor AS \"doctorCode\"," +
					"b.actual_sender AS \"generalDoctor\"," +
					"d.name AS \"patientName\"," +
					"d.id as \"patientId\"," +
					"d.idcard as \"patientIdcard\"," +
					"d.sex as \"patientsex\"," +
					"d.photo AS \"patientphoto\" " +
					"FROM wlyy_consult a," +
					"wlyy_consult_team b," +
					"base_patient d  " +
					"WHERE a.id=b.consult " +
					"AND b.patient=d.id AND b.doctor='" + doctorCode + "' AND b.type in (" + type + ") and b.status = 0 and a.pay_status=1 " +
					"ORDER BY a.czrq desc ";*/
			sql = "SELECT " +
					" DISTINCT op.id AS \"outpatientId\"," +
					"op.description AS \"title\"," +
					"op.description AS \"symptoms\","+
					//添加排序的列
					"op.create_time AS \"createTime\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
				}else {
					sql = sql + "to_char(op.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
				}
			}else{
				sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}
			sql =sql +"op.status AS \"status\"," +
					"op.evaluate_status AS \"evaluate\"," +
					"op.doctor AS \"doctorCode\"," +
					"case op.type when '1' then '1'  when '3' then '15' else  '17' end \"type\"," +
					"op.general_doctor AS \"generalDoctor\"," +
					"patient.NAME AS \"patientName\"," +
					"patient.id AS \"patientId\"," +
					"op.consumer AS \"consumer\"," +
					"patient.idcard AS \"patientIdcard\"," +
					"patient.sex AS \"patientsex\"," +
					"patient.photo AS \"patientphoto\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(op.register_date,'%Y-%m-%d %H:%i:%S' )  AS \"registerDate\",";
				}else {
					sql = sql + "to_char(op.register_date,'YYYY-MM-DD hh24:mi:ss')  AS \"registerDate\",";
				}
			}else{
				sql = sql + "date_format(op.register_date,'%Y-%m-%d %H:%i:%S' )  AS \"registerDate\",";
			}
			sql = sql +		"op.status AS \"outpatientstatus\" "+
					"FROM base_patient patient," +
					"wlyy_outpatient op " +
					"WHERE op.patient=patient.id " +
					"AND op.doctor='"+doctorCode+"' " +
					"AND op.status in ('0','1','2') and  op.pay_status=1 ";
			/*if("9".equals(type)){
				//图文复诊
				sql =sql +"AND op.type=1 AND op.outpatient_type=1 ";
			}else if("16".equals(type)){
				//视频复诊
				sql =sql +"AND op.type=2 AND op.outpatient_type=1 ";
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else {
						sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
			}else if("12".equals(type)){
				//视频复诊
				sql =sql +"AND op.outpatient_type=2";
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else  {
						sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
			}else{}*/
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
			}
			sql =sql +" AND op.type in ('1','2') AND op.outpatient_type = 3 ";
			sql =sql +" ORDER BY op.create_time DESC";
		}
		if("9".equals(type) || "16".equals(type)|| "12".equals(type)){
			sql = "SELECT " +
					" DISTINCT op.id AS \"outpatientId\"," +
					"op.description AS \"title\"," +
					"op.description AS \"symptoms\","+
					//添加排序的列
					"op.create_time AS \"createTime\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
				}else {
					sql = sql + "to_char(op.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
				}
			}else{
				sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}
			sql =sql +"op.status AS \"status\"," +
					"op.evaluate_status AS \"evaluate\"," +
					"op.doctor AS \"doctorCode\"," +
					"op.general_doctor AS \"generalDoctor\"," +
					"op.consumer AS \"consumer\"," +
					"patient.NAME AS \"patientName\"," +
					"patient.id AS \"patientId\"," +
					"patient.idcard AS \"patientIdcard\"," +
					"patient.sex AS \"patientsex\"," +
					"patient.photo AS \"patientphoto\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(op.register_date,'%Y-%m-%d %H:%i:%S' )  AS \"registerDate\",";
				}else {
					sql = sql + "to_char(op.register_date,'YYYY-MM-DD hh24:mi:ss')  AS \"registerDate\",";
				}
			}else{
				sql = sql + "date_format(op.register_date,'%Y-%m-%d %H:%i:%S' )  AS \"registerDate\",";
			}
			sql = sql +		"op.status AS \"outpatientstatus\" " +
					"FROM base_patient patient," +
					"wlyy_outpatient op " +
					"WHERE op.patient=patient.id " +
					"AND op.doctor='"+doctorCode+"' " +
					"AND op.status in ('0','1','2') and  op.pay_status=1 ";
			if("9".equals(type)){
				//图文复诊
				sql =sql +"AND op.type=1 AND op.outpatient_type=1 ";
			}else if("16".equals(type)){
				//视频复诊
				sql =sql +"AND op.type=2 AND op.outpatient_type=1 ";
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else {
						sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
			}else if("12".equals(type)){
				//视频复诊
				sql =sql +"AND op.outpatient_type=2";
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else  {
						sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
			}else{}
			sql =sql +" ORDER BY op.create_time DESC";
		}
		List<Map<String,Object>> mapList = hibenateUtils.createSQLQuery(sql);
		for (Map<String,Object> map:mapList){
			if (map.get("patientIdcard")!=null){
				String idcard = map.get("patientIdcard").toString();
				Integer age =IdCardUtil.getAgeForIdcard(idcard);
				map.put("patientAge",age);
			}
		}
		return mapList;
	}
}

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

@ -442,6 +442,9 @@ public class BaseHospitalRequestMapping {
        //医生待办事项列表
        public static final String doctorUpcomingList = "/doctorUpcomingList";
        //医生待办事项列表 不关联处方
        public static final String doctorUpcomingList2 = "/doctorUpcomingList2";
        public static final String setRecord = "/setRecord";
        public static final String findPatientRecord = "/findPatientRecord";

+ 9 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyInspectionVO.java

@ -15,7 +15,7 @@ public class WlyyInspectionVO extends UuidIdentityVO {
    private String outpatientId;//门诊id',
    private String prescriptionId;//处方id',
    private String chargeAmount;//单价
    private String dept;//执行科室
    private String deptName;//执行科室名称
    private String groupName;//检查检验方法
@ -60,6 +60,14 @@ public class WlyyInspectionVO extends UuidIdentityVO {
    private String mzpg;//麻醉评估 0否,1有
    private String sfzg;//是否做过 0 否 和 1是
    public String getChargeAmount() {
        return chargeAmount;
    }
    public void setChargeAmount(String chargeAmount) {
        this.chargeAmount = chargeAmount;
    }
    public String getOutpatientId() {
        return outpatientId;
    }

+ 7 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/account/PatientEndpoint.java

@ -37,6 +37,12 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                                  @RequestParam(value = "pw", required = true)String pw,
                                  @ApiParam(name = "orgPw", value = "原密码")
                                  @RequestParam(value = "orgPw", required = false)String orgPw)throws Exception{
        return success(basePatientService.updatePatientPw(id,pw,orgPw));
        Boolean isSuccess = basePatientService.updatePatientPw(id,pw,orgPw);
        if (isSuccess){
            return success(isSuccess);
        }else {
            return failed("修改失败,请检查原密码是否正确");
        }
    }
}

+ 1 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -917,6 +917,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		result.put("imgConsultCount",prescriptionService.getWaitVideoCount(doctor,"1","3",wxId));//图文咨询数量
		result.put("videoConsultCount",prescriptionService.getWaitVideoCount(doctor,"2","3",wxId));//视频咨询数量
		result.put("homeConsultCount",prescriptionService.getWaitVideoCount(doctor,"3","3",wxId));//家医咨询数量
		result.put("doorServiceCount",prescriptionService.waitUpdoorCount(doctor));//上门服务数量
		logger.info("action:doctorReviewConsultCount--end:"+DateUtil.dateToStrLong(new Date()));
		return success("请求成功",result);
	}

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

@ -2415,6 +2415,41 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(tnyyEntranceService.findJKTA_ZY_RECORD(brid));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.doctorUpcomingList2)
    @ApiOperation(value = "医生待办事项列表")
    public Envelop doctorUpcomingList2(@ApiParam(name = "doctorCode", value = "医生CODE")
                                      @RequestParam(value = "doctorCode",required = true) String doctorCode,
                                      @ApiParam(name = "type", value = "类型:1.视频复诊(16)、2.专科协同(12)、3.图文复诊(9)、4.专家咨询(1,15)")
                                      @RequestParam(value = "type",required = true) String type)throws Exception{
        com.alibaba.fastjson.JSONArray array = new com.alibaba.fastjson.JSONArray();
        List<Map<String,Object>>  data = imService.doctorUpcomingList2(doctorCode, type);
        if (data != null) {
            for (Map<String,Object> consult : data) {
                if("1,15,17".equals(type)){//专家咨询
                    Integer consultType =  Integer.parseInt(consult.get("type").toString());
                    if(1 == consultType){//专家咨询
                        consult.put("session_id", consult.get("consumer").toString()+"_"+ consult.get("outpatientId").toString()+"_1");
                    }else if(15 == consultType){//家医求助
                        consult.put("session_id", consult.get("consumer").toString()+"_"+ consult.get("outpatientId").toString()+"_"+ consult.get("doctorCode").toString()+"_15");
                    }else if (17==consultType){//视频咨询
                        consult.put("session_id", consult.get("consumer").toString()+"_"+ consult.get("outpatientId").toString()+"_17");
                    }
                }else if("9".equals(type)){//图文复诊
                    consult.put("session_id", consult.get("consumer").toString()+"_"+consult.get("outpatientId").toString()+"_9");
                    consult.put("type",type);
                }else if("16".equals(type)){//视频复诊
                    consult.put("session_id", consult.get("consumer").toString()+"_"+consult.get("outpatientId").toString()+"_16");
                    consult.put("type",type);
                }else if("12".equals(type)){//协同门诊
                    consult.put("session_id", consult.get("consumer").toString()+"_"+consult.get("outpatientId").toString()+"_12");
                    consult.put("type",type);
                }else{}
                array.add(consult);
            }
        }
        return success(array);
    }
}