| 
					
				 | 
			
			
				@ -0,0 +1,154 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				package com.yihu.jw.hospital.endpoint.patient; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.prescription.service.PrescriptionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.service.consult.SysDictService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.im.service.ImService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.Envelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.ListEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.ObjEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.axis.utils.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.slf4j.Logger; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.slf4j.LoggerFactory; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.GetMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RestController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.Date; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.Map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * @author zmk 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * 患者不用登陆访问居民PC端控制类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * Created at 2019/12/25 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@RestController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@RequestMapping(value = BaseHospitalRequestMapping.PatientNoLogin.PREFIX) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@Api(value = "患者不用登陆访问居民PC端控制类", description = "患者不用登陆访问居民PC端控制类") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private static final Logger logger = LoggerFactory.getLogger(PatientNoLoginEndPoint.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private PrescriptionService prescriptionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private SysDictService sysDictService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private ImService imService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ListEnvelop findDoctorByHospitalAndDiseaseAndDept(@ApiParam(name = "orgCode", value = "机构code") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "orgCode", required = true,defaultValue = "350211A1002")String orgCode, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "dept", value = "部门code") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "dept", required = false)String dept, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "diseaseKey", value = "疾病名称关键字") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "diseaseKey", required = false)String diseaseKey, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "doctorNameKey", value = "医生名称关键字") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "doctorNameKey", required = false)String doctorNameKey, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "jobTitleNameKey", value = "医生职称关键字") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "jobTitleNameKey", required = false)String jobTitleNameKey, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "outpatientType", value = "咨询类型1图文,2视频") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "outpatientType", required = false)String outpatientType, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "keyName", value = "姓名/科室/疾病模糊搜索关键字") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "keyName", required = false)String keyName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "workingTime", value = "排班时间YYYY-MM-DD") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "workingTime", required = false)String workingTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "consultStatus", value = "在线状态") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "consultStatus", required = false,defaultValue = "")String consultStatus, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "chargType", value = "医生号别") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "chargType", required = false,defaultValue = "")String chargType, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "consutlSort", value = "咨询量排序") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "consutlSort", required = true,defaultValue = "DESC")String consutlSort, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "page", value = "第几页") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "page",required = false) Integer page, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @ApiParam(name = "pagesize", value = "分页大小") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                             @RequestParam(value = "pagesize",required = false) Integer pagesize 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success(prescriptionService.findDoctorByHospitalAndDiseaseAndDept( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                orgCode,dept, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                diseaseKey,doctorNameKey, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                jobTitleNameKey,outpatientType, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                keyName,workingTime,consultStatus,chargType,consutlSort,page,pagesize)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findHotDeptAndDiseaseDict) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取常见疾病、热门部门、医生拒绝接诊原因 字典", notes = "获取常见疾病、热门部门、医生拒绝接诊原因 字典") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ListEnvelop findHotDeptAndDiseaseDict(@ApiParam(name = "dictName", value = "dictName") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                 @RequestParam(value = "dictName", required = true,defaultValue = "ONLINE_HOSPITAL_DEPT_350211A1002")String dictName)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success(prescriptionService.findHotDeptAndDiseaseDict(dictName)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.getTodayOutpatinetList) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "居民获取当日就诊列表", notes = "居民获取当日就诊列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ListEnvelop getTodayOutpatinetList(@ApiParam(name = "patient", value = "居民ID") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                              @RequestParam(value = "patient", required = true) String patient){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success(prescriptionService.getTodayOutpatinetList(patient)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findByDeptTypeCode) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "就诊费用查询", notes = "就诊费用查询") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ListEnvelop findByDeptTypeCode(@ApiParam(name = "deptTypeCode", value = "6总部7金榜8夏禾") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                          @RequestParam(value = "deptTypeCode", required = false)String deptTypeCode) throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success(prescriptionService.findByDeptTypeCode(deptTypeCode)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findByHosAndDict) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "根据医院和字典名查询") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop findByHosAndDict( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "hospital", value = "医院编码", required = true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "hospital", required = true) String hospital, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "dictName", value = "字典名称", required = true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "dictName", required = true) String dictName ) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = sysDictService.findByHosAndDict(hospital, dictName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success("查询成功",list); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorInfo) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取医生信息", notes = "获取医生信息") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ObjEnvelop findDoctorInfo(@ApiParam(name = "doctor", value = "医生code") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     @RequestParam(value = "doctor", required = true)String doctor, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     @ApiParam(name = "withWork", value = "传1带排班,其他不带") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     @RequestParam(value = "withWork", required = false)String withWork){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success(prescriptionService.findDoctorInfo(doctor,withWork)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.isExistsUnfinishedConsult) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "查询居民与某个医生是否存在未结束的专家咨询") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop isExistsUnfinishedConsult( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "doctor", value = "医生CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "doctor",required = true) String doctor, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "patient", value = "居民CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "patient",required = true) String patient)throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(StringUtils.isEmpty(patient)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patient= getUID(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String consultCode = imService.getUnfinishedConsult(patient, doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return success("请求成功",consultCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |