| 
					
				 | 
			
			
				@ -28,6 +28,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.im.ConsultTeamDo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.org.BaseOrgDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.BaseNatPatientFamilyMemberDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.BasePatientDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.PatientMedicareCardDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.words.BaseSensitiveDO; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -60,6 +61,7 @@ import com.yihu.jw.hospital.doctor.dao.DoctorWorkTimeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.doctor.dao.WlyyDoctorOnlineTimeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.drugstore.dao.BaseDrugStoreDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.family.dao.WlyyNatPatientFamilyMemberDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.service.BaseOperateLogService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -333,6 +335,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private HealthCareService healthCareService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private HcyyPrescriptionService hcyyPrescriptionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private WlyyNatPatientFamilyMemberDao natPatientFamilyMemberDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12179,7 +12183,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Map saveNatAppointment(String chargeAmount,String inspectionName,String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushFlag,String cardNoType,String consumer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                  String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo,String idnoType,Integer source) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                  String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo,String idnoType,Integer source,String patientHisId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map returnMap = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer winNo = 6; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (checkPart==null||checkPart==""){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12292,6 +12296,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO.setAmpm(pm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO.setConsumer(consumer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO.setConsumerName(name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO.setPatientHisId(patientHisId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        rs = entranceService.BS10111(mediaCard, map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12721,6 +12726,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String hisId = patientMappingService.findHisPatNoByPatient(baseNatAppointmentDO.getPatientId(),baseNatAppointmentDO.getMedicare()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("cardNo:" + baseNatAppointmentDO.getMedicare()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(!patientDO.getIdcard().equalsIgnoreCase(baseNatAppointmentDO.getCardNo())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hisId = baseNatAppointmentDO.getPatientHisId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject jsonObject1 =entranceService.BS15054(hisId,baseNatAppointmentDO.getRealOrder(),demoFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("获取待结算数据 res: " + res.toString()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12739,7 +12747,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String contentMsg="申请人:"+baseNatAppointmentDO.getName()+"\r\n预约时间:"+date; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String remark = "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\r\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\r\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "3、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "3、核酸检测标本采集6-8小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    responseMsg = entranceService.ehospitalNotice( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            baseNatAppointmentDO.getName(), 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12763,7 +12771,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                jsonObject.put("keyword2","申请人:"+baseNatAppointmentDO.getName()+"\n预约时间:"+date); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String remark =  "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "3、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "3、核酸检测标本采集6-8小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                jsonObject.put("remark",remark); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                jsonObject.put("url","111111"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String url = "https://xmzsyyfwc.xmpbinfo.cn/weixin/1/notification/push/nucleictest"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12867,7 +12875,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return "发送成功!"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop getNatRecords(String patientId,String id,String payStatus,String appointmentTime, String isSuccess,Integer page ,Integer pageSize){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop getNatRecords(String patientId,String id,String payStatus,String appointmentTime, String isSuccess,String idcard,Integer page ,Integer pageSize){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "select t.name as \"name\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.card_no as \"cardNo\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.card_type as \"cardType\"," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12883,6 +12891,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.dept_name as \"deptName\","+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.id as \"id\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.card_no_type as \"cardNoType\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.province_name as \"provinceName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.city_name as \"cityName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.town_name as \"townName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.street_name as \"streetName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.address as \"address\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.HOSPITAL_FLAG as \"hospitalFlag\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.charge_amount as \"chargeAmount\"," ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("xm_tasy_wx".equalsIgnoreCase(wechatId)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12914,6 +12927,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" and t.is_success ="+isSuccess; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNoneBlank(idcard)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+="  and t.card_no ='"+idcard+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNoneBlank(appointmentTime)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12945,8 +12961,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void savePayStatusByHis(String patientId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<BaseNatAppointmentDO> baseNatAppointmentDOList = baseNatAppointmentDao.findPayStatusByPatientId(patientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (BaseNatAppointmentDO baseNatAppointmentDO:baseNatAppointmentDOList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String hisId = patientMappingService.findHisPatNoByPatient(patientId,baseNatAppointmentDO.getMedicare()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("cardNo:" + baseNatAppointmentDO.getMedicare()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(!patientDO.getIdcard().equalsIgnoreCase(baseNatAppointmentDO.getCardNo())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hisId = baseNatAppointmentDO.getPatientHisId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject jsonObject1 =entranceService.BS15054(hisId,baseNatAppointmentDO.getRealOrder(),demoFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("获取待结算数据 res: " + res.toString()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -13181,7 +13201,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "预约时间:"+reserverTime+"\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "发票流水号:"+realorder+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "2、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "2、核酸检测标本采集6-8小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            jsonObject.put("remark",remark); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            jsonObject.put("url",redirdctUrl); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 |