|  | @ -13,6 +13,7 @@ import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.doctor.WlyyDoctorWorkTimeDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.prescription.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.consult.dao.DoctorClinicRoomConsultDao;
 | 
	
	
		
			
				|  | @ -21,6 +22,7 @@ import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.doctor.dao.DoctorWorkTimeDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.mapping.service.DoctorMappingService;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.mapping.service.PatientMappingService;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.prescription.dao.*;
 | 
	
	
		
			
				|  | @ -105,6 +107,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |     private DoctorWorkTimeDao doctorWorkTimeDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PatientRegisterTimeDao patientRegisterTimeDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private WlyyHttpLogDao wlyyHttpLogDao;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Value("${demo.flag}")
 | 
	
		
			
				|  |  |     private boolean demoFlag;
 | 
	
	
		
			
				|  | @ -531,6 +535,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |     public Boolean createRoom(WlyyOutpatientDO outpatientDO,Date reservationTime){
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         WlyyHospitalWaitingRoomDO waitingRoom = new WlyyHospitalWaitingRoomDO();
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         waitingRoom.setDept(outpatientDO.getDept());
 | 
	
		
			
				|  |  |         waitingRoom.setDeptName(outpatientDO.getDeptName());
 | 
	
		
			
				|  |  |         waitingRoom.setHospital(outpatientDO.getHospital());
 | 
	
		
			
				|  |  |         waitingRoom.setHospitalName(outpatientDO.getHospitalName());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         waitingRoom.setConsultType(1);
 | 
	
		
			
				|  |  |         waitingRoom.setPatientId(outpatientDO.getPatient());
 | 
	
		
			
				|  |  |         waitingRoom.setPatientName(outpatientDO.getPatientName());
 | 
	
	
		
			
				|  | @ -762,6 +772,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         if(doctorMappingDO==null){
 | 
	
		
			
				|  |  |             throw new RuntimeException("未找到医生映射信息");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         net.sf.json.JSONObject rs = entranceService.BS10111(outpatientDO.getCardNo(),doctorMappingDO.getMappingCode(),outpatientDO.getDept(),null,outpatientDO.getWinNo(),demoFlag);
 | 
	
		
			
				|  |  |         String rsCode = (String)rs.get("@RESULT");
 | 
	
		
			
				|  |  |         if("0".equals(rsCode)){
 | 
	
	
		
			
				|  | @ -771,7 +782,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             String conNo = (String)rs.get("@times");
 | 
	
		
			
				|  |  |             outpatientDO.setCardNo(conNo);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         //保存日志
 | 
	
		
			
				|  |  |         WlyyHttpLogDO log = new WlyyHttpLogDO();
 | 
	
		
			
				|  |  |         log.setCode("registerOutPatient");
 | 
	
		
			
				|  |  |         log.setName("挂号");
 | 
	
		
			
				|  |  |         log.setPatient(outpatientDO.getPatient());
 | 
	
		
			
				|  |  |         log.setDoctor(doctor);
 | 
	
		
			
				|  |  |         log.setResponse(rs.toString());
 | 
	
		
			
				|  |  |         log.setRequest("outPatientId="+outPatientId+"&doctor="+doctor);
 | 
	
		
			
				|  |  |         log.setStatus(rsCode);
 | 
	
		
			
				|  |  |         log.setCreateTime(new Date());
 | 
	
		
			
				|  |  |         wlyyHttpLogDao.save(log);
 | 
	
		
			
				|  |  |         return rs;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -932,8 +953,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 
 | 
	
		
			
				|  |  |                 //调用his开方接口
 | 
	
		
			
				|  |  |                 net.sf.json.JSONObject jsonObject = entranceService.BS10112(jsonData.toJSONString(),demoFlag);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 //判断返回结果
 | 
	
		
			
				|  |  |                 String rs = jsonObject.getString("@RESULT");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 //保存日志
 | 
	
		
			
				|  |  |                 WlyyHttpLogDO log = new WlyyHttpLogDO();
 | 
	
		
			
				|  |  |                 log.setCode("makeDiagnosis");
 | 
	
		
			
				|  |  |                 log.setName("下诊断");
 | 
	
		
			
				|  |  |                 log.setPatient(outpatientDO.getPatient());
 | 
	
		
			
				|  |  |                 log.setDoctor(outpatientDO.getDoctor());
 | 
	
		
			
				|  |  |                 log.setResponse(jsonObject.toString());
 | 
	
		
			
				|  |  |                 log.setRequest(jsonData.toJSONString());
 | 
	
		
			
				|  |  |                 log.setStatus(rs);
 | 
	
		
			
				|  |  |                 log.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                 wlyyHttpLogDao.save(log);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 if("0".equals(rs)){
 | 
	
		
			
				|  |  |                     String admNo = jsonObject.getString("@ADM_NO");
 | 
	
		
			
				|  |  |                     String realOrder = jsonObject.getString("@real_order");
 |