| 
					
				 | 
			
			
				@ -10,12 +10,13 @@ import com.yihu.jw.doctor.service.BaseDoctorInfoService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.dict.DictHospitalDeptDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.BaseDoctorDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.BaseDoctorPatientDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.BaseDoctorVo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.org.BaseOrgDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.BasePatientDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.PatientMedicareCardDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.wx.BasePatientWechatDo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.wx.WxWechatDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.consult.WlyyDoctorClinicRoomDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -74,6 +75,8 @@ import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.utils.StringUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.utils.WebserviceUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.utils.hibernate.HibenateUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.BasePatientWechatDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.WechatDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.mysql.query.BaseJpaService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.utils.security.MD5; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.ylzinfo.ehc.EhcHandler; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -217,6 +220,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BasePatientMedicareCardDao patientMedicareCardDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private PatientMappingDao patientMappingDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private WechatDao wechatDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BasePatientWechatDao patientWechatDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${demo.flag}") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3044,7 +3051,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "a.relation_code=b.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "AND b.doctor='"+doctor+"' " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "GROUP BY a.score_type"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "GROUP BY a.score_type ORDER BY  a.score_type ASC "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> listscore = jdbcTemplate.queryForList(sqlscore); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Double doctorScore = new Double("0"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4071,6 +4078,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("idcard",basePatientDO.getIdcard()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("mobile",basePatientDO.getMobile()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("photo",basePatientDO.getPhoto()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("address",basePatientDO.getAddress()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (patientMedicareCardDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("ssc",patientMedicareCardDO.getCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4157,6 +4166,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("idcard",basePatientDO.getIdcard()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("mobile",basePatientDO.getMobile()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("photo",basePatientDO.getPhoto()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("address",basePatientDO.getAddress()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (patientMedicareCardDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("ssc",patientMedicareCardDO.getCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -6409,20 +6420,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 查询患者问诊信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param status 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param page 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param size 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop findPatientAllOutpatient(String status, Integer page, Integer size) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        StringBuffer sql = new StringBuffer("SELECT c.* FROM wlyy_outpatient c WHERE c.patient = '"+userAgent.getUID()+"'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotEmpty(status)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql.append(" AND c.pay_status=").append(status); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop selectByUrl(String prescriptionId,String wxId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WxWechatDO wxWechatDO = wechatDao.findById(wxId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (wxWechatDO==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("微信配置不存在!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql.append("ORDER BY c.create_time DESC LIMIT ").append((page-1)*size).append(",").append(size); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (prescriptionDO==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("处方不存在!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<BasePatientWechatDo> patientWechatDos =patientWechatDao.findByWechatIdAndPatientId(wxId,prescriptionDO.getPatientCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (patientWechatDos==null||patientWechatDos.size()==0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("openid不存在!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BasePatientWechatDo patientWechatDo = patientWechatDos.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",prescriptionDO.getPatientCode(),"1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (patientMedicareCardDO==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("就诊卡不存在!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(),patientWechatDo.getOpenid(),patientMedicareCardDO.getCode(),"WX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(url); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,object); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |