|
@ -28,7 +28,6 @@ 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;
|
|
@ -102,7 +101,6 @@ import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
|
|
|
import com.yihu.jw.utils.*;
|
|
|
import com.yihu.jw.utils.Pkis.PKIService_PortType;
|
|
|
import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
|
|
|
import com.yihu.jw.utils.encode.Base64;
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
|
import com.yihu.jw.utils.sfutils.HttpClientUtils;
|
|
|
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
|
|
@ -120,9 +118,6 @@ import com.ylzinfo.ehc.EhcHandler;
|
|
|
import com.ylzinfo.ehc.common.utils.DateUtils;
|
|
|
import com.ylzinfo.ehc.trans.TransRequest;
|
|
|
import com.ylzinfo.ehc.trans.TransResponse;
|
|
|
import com.zaxxer.hikari.HikariDataSource;
|
|
|
import com.zaxxer.hikari.HikariPoolMXBean;
|
|
|
import jxl.format.*;
|
|
|
import jxl.format.VerticalAlignment;
|
|
|
import jxl.write.*;
|
|
|
import net.sf.json.JSONArray;
|
|
@ -144,14 +139,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.management.JMX;
|
|
|
import javax.management.MBeanServer;
|
|
|
import javax.management.ObjectName;
|
|
|
import java.io.DataOutput;
|
|
|
import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
|
import java.lang.Boolean;
|
|
|
import java.lang.management.ManagementFactory;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.net.URL;
|
|
|
import java.net.URLEncoder;
|
|
@ -160,7 +150,7 @@ import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Created by Trick on 2019/5/17.
|
|
@ -733,7 +723,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("patientId", basePatientDO.getId());
|
|
|
rs.put("idCard", basePatientDO.getIdcard());
|
|
|
rs.put("sex", basePatientDO.getSex());
|
|
|
PatientMedicareCardDO cardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel(PatientMedicareCardDO.Type.MedicareCard.getType(), outpatientDO.getPatient(), "1");
|
|
|
PatientMedicareCardDO cardDO = basePatientMedicareCardDao.findByCodeAndPatientCodeAndDel(outpatientDO.getCardNo(), outpatientDO.getPatient());
|
|
|
rs.put("ssc", cardDO);
|
|
|
rs.put("age", IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
|
|
|
rs.put("address", basePatientDO.getAddress());
|
|
@ -4328,11 +4318,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return rs.size();
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> findDoctorInfo(String doctor, String withWork,String patient) {
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
|
|
|
public Map<String, Object> findDoctorInfo(String doctor,String idcard, String withWork,String patient) {
|
|
|
BaseDoctorDO doctorDO = new BaseDoctorDO();
|
|
|
if (StringUtils.isNoneBlank(doctor)){
|
|
|
doctorDO = baseDoctorDao.findById(doctor);
|
|
|
}else {
|
|
|
doctorDO = baseDoctorDao.findByIdcardAndId(idcard);
|
|
|
}
|
|
|
|
|
|
Map<String, Object> rs = new HashedMap();
|
|
|
if (doctorDO != null) {
|
|
|
rs.put("doctor", doctor);
|
|
|
rs.put("id", doctorDO.getId());
|
|
|
rs.put("doctorSex", doctorDO.getSex());
|
|
|
if (StringUtils.isNoneBlank(doctorDO.getIdcard())) {
|
|
|
rs.put("doctorAge", IdCardUtil.getAgeForIdcard(doctorDO.getIdcard()));
|
|
@ -4362,6 +4358,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("sex",doctorDO.getSex());
|
|
|
rs.put("popularity",doctorDO.getPopularity());
|
|
|
rs.put("qrcode",doctorDO.getQrcode());
|
|
|
rs.put("appletQrcode",doctorDO.getAppletQrCode());
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
String sqlCharge = "SELECT\n" +
|
|
|
"\tm.req_fee as \"twfzFee\",\n" +
|
|
@ -8219,6 +8216,45 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return waitVideoCount;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据类型获取总问诊量
|
|
|
*
|
|
|
* @param doctor
|
|
|
* @param outpatient_type 1复诊 2协同
|
|
|
* @param type 1图文 2视频
|
|
|
* @return
|
|
|
*/
|
|
|
public Long getVideoCount(String doctor, String type, String outpatient_type, String wxId) {
|
|
|
String sql = "SELECT " +
|
|
|
"count(outpatient.id) AS \"total\" " +
|
|
|
"FROM " +
|
|
|
"wlyy_outpatient outpatient," +
|
|
|
"base_patient patient " +
|
|
|
"WHERE " +
|
|
|
"outpatient.patient=patient.id " +
|
|
|
"AND outpatient.status in (0,1,2,3) " +
|
|
|
"AND outpatient.doctor='" + doctor + "' " +
|
|
|
"AND outpatient.pay_status = 1 " +
|
|
|
"AND outpatient.outpatient_type= '" + outpatient_type + "' ";
|
|
|
|
|
|
if (!"xm_ihealth_wx".contains(wxId)){
|
|
|
if ("1".equals(outpatient_type)||"3".equals(outpatient_type)) {//复诊
|
|
|
sql = sql + " AND outpatient.type= '" + type + "' ";
|
|
|
|
|
|
}
|
|
|
}
|
|
|
logger.info("接口名称:doctorReviewConsultCount-->sql="+sql);
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
Long waitVideoCount = 0l;
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
waitVideoCount = Long.parseLong(rstotal.get(0).get("total").toString());
|
|
|
}
|
|
|
|
|
|
return waitVideoCount;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存在线排班
|
|
|
*
|
|
@ -12381,7 +12417,42 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
baseNatAppointmentDO.setRealOrder(realOrder);
|
|
|
baseNatAppointmentDO.setIsSuccess("1");
|
|
|
baseNatAppointmentDO.setVoucherNo(voucherNo);
|
|
|
if (chargeAmount.equalsIgnoreCase("0")){
|
|
|
baseNatAppointmentDO.setPayStatus("1");
|
|
|
}
|
|
|
baseNatAppointmentDO =baseNatAppointmentDao.save(baseNatAppointmentDO);
|
|
|
if (chargeAmount.equalsIgnoreCase("0")) {
|
|
|
BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId());
|
|
|
//发送预约成功通知
|
|
|
String name1 = patientDO.getName();
|
|
|
String idcard = patientDO.getIdcard();
|
|
|
String mobile1 = patientDO.getMobile();
|
|
|
String url = "https://hlwyy.xmzsh.com/hlwyy/ims-wx/#/nucleicTest/detail?id=" + baseNatAppointmentDO.getId();
|
|
|
String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
|
|
|
String first = "尊敬的用户" + baseNatAppointmentDO.getName() + ",您已完成线上自助核酸检测预约申请";
|
|
|
String contentMsg = "申请人:" + baseNatAppointmentDO.getName() + "\r\n 预约时间:" + date + " \r\n发票流水号:" + baseNatAppointmentDO.getRealOrder();
|
|
|
String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\r\n" +
|
|
|
"2、核酸检测标本采集6-8小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
|
|
|
String responseMsg = "";
|
|
|
responseMsg = entranceService.ehospitalNotice(
|
|
|
name1,
|
|
|
idcard,
|
|
|
mobile1,
|
|
|
first,
|
|
|
url,
|
|
|
contentMsg,
|
|
|
remark);
|
|
|
logger.info("中山发送模板消息返回结果=" + responseMsg);
|
|
|
System.out.println("结束发送模板消息");
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
wlyyHttpLogDO.setRequest(url);
|
|
|
wlyyHttpLogDO.setName("核酸检测模板消息推送");
|
|
|
wlyyHttpLogDO.setCode(baseNatAppointmentDO.getId().toString());
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setRequest(url);
|
|
|
wlyyHttpLogDO.setResponse(responseMsg);
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
}
|
|
|
/*logger.info("模板消息推送标识pushFlag"+pushFlag);
|
|
|
if (!StringUtils.isNoneBlank(pushFlag)){
|
|
|
String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
|
|
@ -12543,26 +12614,35 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if(StringUtils.isNoneBlank(itemPrice)){
|
|
|
natFee= Double.parseDouble(itemPrice)*100;
|
|
|
}
|
|
|
//先预约号源
|
|
|
Date format2 = null;
|
|
|
format2 = new SimpleDateFormat("yyyy-MM-dd").parse(natTime);
|
|
|
String shortDate = new SimpleDateFormat("yyyyMMdd").format(format2);
|
|
|
System.out.println("yyyy-MM-dd转yyyyMMdd:"+shortDate);
|
|
|
String regRes=tasyNatService.saveRegOrder(regDept,shortDate,pm,preNo,cardNo,mobile,name,"3");
|
|
|
com.alibaba.fastjson.JSONObject regObj = com.alibaba.fastjson.JSONObject.parseObject(regRes);
|
|
|
String HisSeqNo="";
|
|
|
String orderNum="";
|
|
|
if (regObj!=null){
|
|
|
if ("true".equalsIgnoreCase(regObj.getString("success"))){
|
|
|
com.alibaba.fastjson.JSONObject dataObj = com.alibaba.fastjson.JSONObject.parseObject(regObj.getString("data"));
|
|
|
HisSeqNo=dataObj.getString("HisSeqNo").trim();
|
|
|
orderNum=dataObj.getString("OrderNumber").trim();
|
|
|
}else {
|
|
|
returnMap.put("msg",regObj.getString("data"));
|
|
|
returnMap.put("status","-1");
|
|
|
return returnMap;
|
|
|
WlyyHospitalSysDictDO tasyTime = wlyyHospitalSysDictDao.findById("natTime");
|
|
|
if (tasyTime!=null){
|
|
|
String natTimeC = tasyTime.getDictValue();
|
|
|
if (natTimeC.equalsIgnoreCase("1")){
|
|
|
//先预约号源
|
|
|
Date format2 = null;
|
|
|
format2 = new SimpleDateFormat("yyyy-MM-dd").parse(natTime);
|
|
|
String shortDate = new SimpleDateFormat("yyyyMMdd").format(format2);
|
|
|
System.out.println("yyyy-MM-dd转yyyyMMdd:"+shortDate);
|
|
|
String regRes=tasyNatService.saveRegOrder(regDept,shortDate,pm,preNo,cardNo,mobile,name,"3");
|
|
|
com.alibaba.fastjson.JSONObject regObj = com.alibaba.fastjson.JSONObject.parseObject(regRes);
|
|
|
|
|
|
if (regObj!=null){
|
|
|
if ("true".equalsIgnoreCase(regObj.getString("success"))){
|
|
|
com.alibaba.fastjson.JSONObject dataObj = com.alibaba.fastjson.JSONObject.parseObject(regObj.getString("data"));
|
|
|
HisSeqNo=dataObj.getString("HisSeqNo").trim();
|
|
|
orderNum=dataObj.getString("OrderNumber").trim();
|
|
|
}else {
|
|
|
returnMap.put("msg",regObj.getString("data"));
|
|
|
returnMap.put("status","-1");
|
|
|
return returnMap;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//先进行核算检测预约
|
|
|
String realOrder="";
|
|
|
String addressNow=provinceName+cityName+townName+streetName+address;
|
|
@ -12577,7 +12657,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if ("0".equalsIgnoreCase(returnCode)){
|
|
|
returnMap.put("msg",object.getString("data"));
|
|
|
returnMap.put("status","-1");
|
|
|
tasyNatService.cancleOrder(cardNo,HisSeqNo,orderNum);
|
|
|
if (tasyTime.getDictValue().equalsIgnoreCase("1")){
|
|
|
tasyNatService.cancleOrder(cardNo,HisSeqNo,orderNum);
|
|
|
}
|
|
|
return returnMap;
|
|
|
}else {
|
|
|
flag = true;
|
|
@ -12600,7 +12682,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
baseNatAppointmentDO.setCardType(cardType);
|
|
|
baseNatAppointmentDO.setIdnoType(idnoType);
|
|
|
baseNatAppointmentDO.setAddress(address);
|
|
|
baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
|
|
|
if (tasyTime.getDictValue().equalsIgnoreCase("1")){
|
|
|
baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
|
|
|
}else {
|
|
|
baseNatAppointmentDO.setAppointmentTime(new Date());
|
|
|
}
|
|
|
baseNatAppointmentDO.setOderNum(orderNum);
|
|
|
baseNatAppointmentDO.setCityName(cityName);
|
|
|
baseNatAppointmentDO.setFirstJobCode(firstJobCode);
|
|
@ -13153,10 +13239,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}else if("xm_tasy_wx".equalsIgnoreCase(wechatId)){
|
|
|
if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
|
|
|
logger.info("同步his订单状态"+baseNatAppointmentDO.getRealOrder());
|
|
|
//取消号源
|
|
|
String registerCancel =tasyNatService.cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(registerCancel);
|
|
|
String isSuccess=jsonObject.getString("success");
|
|
|
WlyyHospitalSysDictDO tasyTime = wlyyHospitalSysDictDao.findById("natTime");
|
|
|
if (tasyTime!=null){
|
|
|
if (tasyTime.getDictValue().equalsIgnoreCase("1")){
|
|
|
//取消号源
|
|
|
String registerCancel =tasyNatService.cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(registerCancel);
|
|
|
String isSuccess=jsonObject.getString("success");
|
|
|
}
|
|
|
}
|
|
|
String natCancel=tasyNatService.cancelNat(baseNatAppointmentDO.getRealOrder(),baseNatAppointmentDO.getMedicare().trim(),baseNatAppointmentDO.getName());
|
|
|
com.alibaba.fastjson.JSONObject jsonObject1 = JSON.parseObject(natCancel);
|
|
|
String returnCode=jsonObject1.getString("ReturnCode");
|
|
@ -13931,27 +14022,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
object.put("deptName",outpatientDO.getPatientName());
|
|
|
return object;
|
|
|
}else {
|
|
|
/*entranceService.BS10108()*/
|
|
|
/*entrance(outpatientDO.getCardNo(),registerNo,sysDictDO.getDictValue());*/
|
|
|
logger.info("获取患者待结算信息开始!");
|
|
|
entranceService.getSettleInfo(outpatientDO.getCardNo(),outpatientDO.getIdcard(),outpatientDO.getId());
|
|
|
logger.info("获取患者待结算信息结束!");
|
|
|
logger.info("医保挂号开始!");
|
|
|
String register = healthCareService.register(registerNo);
|
|
|
logger.info("医保挂号结束!");
|
|
|
logger.info("医保费用明细上传开始!");
|
|
|
String feeDetailUpload= healthCareService.feeDetailUploadToEntrance(registerNo);
|
|
|
String feeDetailUpload= healthCareService.feeDetailUpload(registerNo);
|
|
|
logger.info("医保费用明细上传结束!");
|
|
|
|
|
|
logger.info("医保预结算信息开始!");
|
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = healthCareService.preSettlementToEntrance(registerNo);
|
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = healthCareService.preSettlement(registerNo);
|
|
|
logger.info("医保预结算信息结束!");
|
|
|
JSONObject object = new JSONObject();
|
|
|
if (flag==1){
|
|
|
logger.info("获取医保结算页面地址开始!");
|
|
|
String getSettlementResultUrl = healthCareService.getSettlementResultUrlToEntrance(registerNo);
|
|
|
String getSettlementResultUrl = healthCareService.getSettlementResultUrl(registerNo);
|
|
|
logger.info("获取医保结算页面地址结束!");
|
|
|
object.put("getSettlementResultUrl",getSettlementResultUrl);
|
|
|
}else if (flag==2){
|
|
|
logger.info("获取医保结算页面地址开始!");
|
|
|
String getSettlementResultUrlBase64 = healthCareService.getSettlementResultUrlBase64ToEntrance(registerNo);
|
|
|
String getSettlementResultUrlBase64 = healthCareService.getSettlementResultUrlBase64(registerNo);
|
|
|
logger.info("获取医保结算页面地址结束!");
|
|
|
object.put("getSettlementResultUrlBase64",getSettlementResultUrlBase64);
|
|
|
}
|