|
@ -51,6 +51,7 @@ import com.yihu.jw.entity.hospital.prescription.*;
|
|
|
import com.yihu.jw.entity.order.BusinessOrderDO;
|
|
|
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
|
|
|
import com.yihu.jw.file_upload.FileUploadService;
|
|
|
import com.yihu.jw.hospital.consult.dao.BaseAdviceTreatmentDao;
|
|
|
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
|
|
|
import com.yihu.jw.hospital.consult.dao.WlyyConsultAdviceDao;
|
|
|
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
|
|
@ -60,6 +61,7 @@ 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.httplog.dao.WlyyHttpLogDao;
|
|
|
import com.yihu.jw.hospital.httplog.service.BaseOperateLogService;
|
|
|
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
|
|
|
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
|
|
|
import com.yihu.jw.hospital.mapping.service.DoctorMappingService;
|
|
@ -313,6 +315,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
HikariDataSource dataSource;
|
|
|
@Autowired
|
|
|
private BaseSensitiveDao baseSensitiveDao;
|
|
|
@Autowired
|
|
|
private BaseOperateLogService baseOperateLogService;
|
|
|
@Autowired
|
|
|
private BaseAdviceTreatmentDao baseAdviceTreatmentDao;
|
|
|
|
|
|
@Value("${demo.flag}")
|
|
|
private boolean demoFlag;
|
|
@ -339,20 +345,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
logger.info("findOutpatientList patNo " + patNo);
|
|
|
List<WlyyOutpatientVO> wlyyOutpatientVOList = entranceService.BS30025(patNo, null, startTime, endTime, demoFlag,ksdm);
|
|
|
if (!ksdm.equalsIgnoreCase("1500010")){
|
|
|
List<WlyyOutpatientVO> wlyyOutpatientVOList1 = entranceService.BS30025(patNo, null, startTime, endTime, demoFlag,"1500010");
|
|
|
if (wlyyOutpatientVOList!=null&&wlyyOutpatientVOList.size()!=0){
|
|
|
if(wlyyOutpatientVOList1!=null&&wlyyOutpatientVOList1.size()!=0){
|
|
|
for (WlyyOutpatientVO wlyyOutpatientVO:wlyyOutpatientVOList1){
|
|
|
logger.info("==="+wlyyOutpatientVO);
|
|
|
if (wlyyOutpatientVO!=null){
|
|
|
wlyyOutpatientVOList.add(wlyyOutpatientVO);
|
|
|
if (StringUtils.isNoneBlank(ksdm)){
|
|
|
if (!ksdm.equalsIgnoreCase("1500010")){
|
|
|
List<WlyyOutpatientVO> wlyyOutpatientVOList1 = entranceService.BS30025(patNo, null, startTime, endTime, demoFlag,"1500010");
|
|
|
if (wlyyOutpatientVOList!=null&&wlyyOutpatientVOList.size()!=0){
|
|
|
if(wlyyOutpatientVOList1!=null&&wlyyOutpatientVOList1.size()!=0){
|
|
|
for (WlyyOutpatientVO wlyyOutpatientVO:wlyyOutpatientVOList1){
|
|
|
logger.info("==="+wlyyOutpatientVO);
|
|
|
if (wlyyOutpatientVO!=null){
|
|
|
wlyyOutpatientVOList.add(wlyyOutpatientVO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
wlyyOutpatientVOList = new ArrayList<>();
|
|
|
wlyyOutpatientVOList = wlyyOutpatientVOList1;
|
|
|
}
|
|
|
}else {
|
|
|
wlyyOutpatientVOList = new ArrayList<>();
|
|
|
wlyyOutpatientVOList = wlyyOutpatientVOList1;
|
|
|
}
|
|
|
}
|
|
|
return wlyyOutpatientVOList;
|
|
@ -656,82 +664,95 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
} else {
|
|
|
prescriptionDOs = prescriptionDao.findByOutpatientId(outpatientId);
|
|
|
}
|
|
|
List<WlyyPrescriptionVO> prescriptionVOs = new ArrayList<>();
|
|
|
List<BusinessOrderDO> businessOrders = new ArrayList<>();
|
|
|
BusinessOrderDO businessOrder = new BusinessOrderDO();
|
|
|
if (prescriptionDOs != null && prescriptionDOs.size() > 0) {
|
|
|
convertToModels(prescriptionDOs, prescriptionVOs, WlyyPrescriptionVO.class);
|
|
|
for (WlyyPrescriptionVO vo : prescriptionVOs) {
|
|
|
List<WlyyPrescriptionCheckDO> prescriptionCheckDO = prescriptionCheckDao.findByPrescriptionId(vo.getId());
|
|
|
//疾病信息
|
|
|
vo.setDiagnosisVOs(findDiagnosisById(vo.getId()));
|
|
|
if(null!=prescriptionCheckDO&&prescriptionCheckDO.size()>0){
|
|
|
vo.setDispUser(prescriptionCheckDO.get(0).getOperate());
|
|
|
vo.setDispUserName(prescriptionCheckDO.get(0).getOperateName());
|
|
|
}
|
|
|
|
|
|
//药品信息
|
|
|
List<WlyyPrescriptionInfoVO> infoVOs = new ArrayList<>();
|
|
|
System.out.println("=====PrescriptionId======"+vo.getId());
|
|
|
convertToModels(prescriptionInfoDao.findByPrescriptionId(vo.getId(), 1), infoVOs, WlyyPrescriptionInfoVO.class);
|
|
|
vo.setInfoVOs(infoVOs);
|
|
|
|
|
|
//检查检验信息
|
|
|
List<WlyyInspectionVO> inspectionVOs = new ArrayList<>();
|
|
|
vo.setInspectionVOs(convertToModels(wlyyInspectionDao.findByPrescriptionId(vo.getId(), 1), inspectionVOs, WlyyInspectionVO.class));
|
|
|
|
|
|
if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId());
|
|
|
if (wlyyPrescriptionEmrDO1 != null) {
|
|
|
vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1);
|
|
|
} else {
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = readOutPatientXml(outpatientDO.getOriginRegisterNo());
|
|
|
//电子病历
|
|
|
vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO);
|
|
|
if (!"2".equalsIgnoreCase(outpatientDO.getOutpatientType())){
|
|
|
List<WlyyPrescriptionVO> prescriptionVOs = new ArrayList<>();
|
|
|
List<BusinessOrderDO> businessOrders = new ArrayList<>();
|
|
|
BusinessOrderDO businessOrder = new BusinessOrderDO();
|
|
|
if (prescriptionDOs != null && prescriptionDOs.size() > 0) {
|
|
|
convertToModels(prescriptionDOs, prescriptionVOs, WlyyPrescriptionVO.class);
|
|
|
for (WlyyPrescriptionVO vo : prescriptionVOs) {
|
|
|
List<WlyyPrescriptionCheckDO> prescriptionCheckDO = prescriptionCheckDao.findByPrescriptionId(vo.getId());
|
|
|
//疾病信息
|
|
|
vo.setDiagnosisVOs(findDiagnosisById(vo.getId()));
|
|
|
if(null!=prescriptionCheckDO&&prescriptionCheckDO.size()>0){
|
|
|
vo.setDispUser(prescriptionCheckDO.get(0).getOperate());
|
|
|
vo.setDispUserName(prescriptionCheckDO.get(0).getOperateName());
|
|
|
}
|
|
|
} else if (wxId.equalsIgnoreCase("xm_xzzx_wx")) {
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId());
|
|
|
if (wlyyPrescriptionEmrDO1 != null) {
|
|
|
vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1);
|
|
|
} else {
|
|
|
List<WlyyPrescriptionEmrDO> listEmr = xzzxEntranceService.selectHistoryEmr(hisPatient,"");
|
|
|
if (null!=listEmr&&listEmr.size()>0){
|
|
|
vo.setWlyyPrescriptionEmrDO(listEmr.get(0));
|
|
|
|
|
|
//药品信息
|
|
|
List<WlyyPrescriptionInfoVO> infoVOs = new ArrayList<>();
|
|
|
System.out.println("=====PrescriptionId======"+vo.getId());
|
|
|
convertToModels(prescriptionInfoDao.findByPrescriptionId(vo.getId(), 1), infoVOs, WlyyPrescriptionInfoVO.class);
|
|
|
vo.setInfoVOs(infoVOs);
|
|
|
|
|
|
//检查检验信息
|
|
|
List<WlyyInspectionVO> inspectionVOs = new ArrayList<>();
|
|
|
vo.setInspectionVOs(convertToModels(wlyyInspectionDao.findByPrescriptionId(vo.getId(), 1), inspectionVOs, WlyyInspectionVO.class));
|
|
|
|
|
|
if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId());
|
|
|
if (wlyyPrescriptionEmrDO1 != null) {
|
|
|
vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1);
|
|
|
} else {
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = readOutPatientXml(outpatientDO.getOriginRegisterNo());
|
|
|
//电子病历
|
|
|
vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO);
|
|
|
}
|
|
|
} else if (wxId.equalsIgnoreCase("xm_xzzx_wx")) {
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId());
|
|
|
if (wlyyPrescriptionEmrDO1 != null) {
|
|
|
vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1);
|
|
|
} else {
|
|
|
List<WlyyPrescriptionEmrDO> listEmr = xzzxEntranceService.selectHistoryEmr(hisPatient,"");
|
|
|
if (null!=listEmr&&listEmr.size()>0){
|
|
|
vo.setWlyyPrescriptionEmrDO(listEmr.get(0));
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId());
|
|
|
if (wlyyPrescriptionEmrDO1 != null) {
|
|
|
vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1);
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId());
|
|
|
if (wlyyPrescriptionEmrDO1 != null) {
|
|
|
vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1);
|
|
|
//支付信息
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(vo.getId());
|
|
|
if (null!=businessOrderDO){
|
|
|
businessOrders.add(businessOrderDO);
|
|
|
}
|
|
|
}
|
|
|
//支付信息
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(vo.getId());
|
|
|
if (null!=businessOrderDO){
|
|
|
businessOrders.add(businessOrderDO);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
rs.put("prescriptions", prescriptionVOs);
|
|
|
rs.put("businessOrder", businessOrders);
|
|
|
|
|
|
}
|
|
|
rs.put("prescriptions", prescriptionVOs);
|
|
|
rs.put("businessOrder", businessOrders);
|
|
|
//物流信息
|
|
|
List<WlyyPrescriptionExpressageDO> expressageDOs = prescriptionExpressageDao.findByOutpatientId(outpatientId);
|
|
|
if (expressageDOs != null && expressageDOs.size() > 0) {
|
|
|
rs.put("expressage", convertToModel(expressageDOs.get(0), WlyyPrescriptionExpressageVO.class));
|
|
|
} else {
|
|
|
rs.put("expressage", null);
|
|
|
}
|
|
|
|
|
|
//物流信息
|
|
|
List<WlyyPrescriptionExpressageDO> expressageDOs = prescriptionExpressageDao.findByOutpatientId(outpatientId);
|
|
|
if (expressageDOs != null && expressageDOs.size() > 0) {
|
|
|
rs.put("expressage", convertToModel(expressageDOs.get(0), WlyyPrescriptionExpressageVO.class));
|
|
|
} else {
|
|
|
rs.put("expressage", null);
|
|
|
//物流配送新
|
|
|
List<WlyyPrescriptionExpressageLogDO> expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId);
|
|
|
List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>();
|
|
|
if (expressageLogDOs != null && expressageLogDOs.size() > 0) {
|
|
|
rs.put("expressageLogs", convertToModels(expressageLogDOs, expressageLogVOs, WlyyPrescriptionExpressageLogVO.class));
|
|
|
} else {
|
|
|
rs.put("expressageLogs", null);
|
|
|
}
|
|
|
}else {
|
|
|
List<BaseAdviceTreatmentDO> treatmentDOS=baseAdviceTreatmentDao.findByRelationCode(outpatientId);
|
|
|
if (treatmentDOS!=null&&treatmentDOS.size()>0){
|
|
|
//药品
|
|
|
List<WlyyPrescriptionInfoDO> infoDOList=prescriptionInfoDao.findByPrescriptionId(treatmentDOS.get(0).getId(), 1);
|
|
|
treatmentDOS.get(0).setInfoList(infoDOList);
|
|
|
rs.put("treatments",treatmentDOS.get(0));
|
|
|
}else{
|
|
|
rs.put("treatments","");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//物流配送新
|
|
|
List<WlyyPrescriptionExpressageLogDO> expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId);
|
|
|
List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>();
|
|
|
if (expressageLogDOs != null && expressageLogDOs.size() > 0) {
|
|
|
rs.put("expressageLogs", convertToModels(expressageLogDOs, expressageLogVOs, WlyyPrescriptionExpressageLogVO.class));
|
|
|
} else {
|
|
|
rs.put("expressageLogs", null);
|
|
|
}
|
|
|
|
|
|
//预约记录
|
|
|
List<WlyyPatientRegisterTimeDO> timeDOs = patientRegisterTimeDao.findByOutpatientId(outpatientId);
|
|
@ -1734,29 +1755,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"\td.req_fee as \"xtzxFee\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\tbase_doctor t\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.twzx_charge_type = d.charge_type\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.twzx_charge_type = d.charge_type and d.is_del='1'\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" +
|
|
|
"WHERE t.id = '"+doctor.get("id")+"' ";
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
/*if (null!=doctor.get("chargeType")){
|
|
|
String chargeTypeList = doctor.get("chargeType").toString();
|
|
|
if (chargeType.contains(",")){
|
|
|
chargeTypeList = chargeType.replace(",","','");
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",zj_fee as \"zjFee\",xt_fee as \"xtFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeTypeList+"')";
|
|
|
|
|
|
if (StringUtils.isNoneBlank(deptTyepCode)){
|
|
|
sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
|
|
|
}
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
}*/
|
|
|
doctor.put("chargeTypeList",chargeDictDOLists);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(doctorCode)) {
|
|
@ -3759,39 +3766,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("sex",doctorDO.getSex());
|
|
|
rs.put("popularity",doctorDO.getPopularity());
|
|
|
rs.put("qrcode",doctorDO.getQrcode());
|
|
|
//号别
|
|
|
/*String deptTyepCode = "";
|
|
|
if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
|
|
|
deptTyepCode = "6";
|
|
|
List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByDoctorCode(doctor);
|
|
|
if (null!=depts&&depts.size()>0){
|
|
|
BaseDoctorHospitalDO baseDoctorHospitalDO = depts.get(0);
|
|
|
String deptcode = baseDoctorHospitalDO.getDeptCode();
|
|
|
String hosptitalCode = baseDoctorHospitalDO.getOrgCode();
|
|
|
List<DictHospitalDeptDO> dictHospitalDeptDO = dictHospitalDeptDao.findByOrgCodeAndCode(hosptitalCode,deptcode);
|
|
|
if(null!=dictHospitalDeptDO&&dictHospitalDeptDO.size()>0){
|
|
|
if (StringUtils.isNotBlank(dictHospitalDeptDO.get(0).getDeptTypeCode())){
|
|
|
deptTyepCode = dictHospitalDeptDO.get(0).getDeptTypeCode();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}*/
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
/*String chargeType = doctorDO.getChargeType();
|
|
|
if (StringUtils.isNotBlank(chargeType)){
|
|
|
if (chargeType.contains(",")){
|
|
|
chargeType = chargeType.replace(",","','");
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",zj_fee as \"zjFee\",xt_fee as \"xtFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeType+"')";
|
|
|
if (StringUtils.isNoneBlank(deptTyepCode)){
|
|
|
sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
|
|
|
}
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
}*/
|
|
|
String sqlCharge = "SELECT\n" +
|
|
|
"\tm.req_fee as \"twfzFee\",\n" +
|
|
|
"\ta.req_fee as \"spfzFee\",\n" +
|
|
@ -3801,12 +3776,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"\td.req_fee as \"xtzxFee\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\tbase_doctor t\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type and d.is_del='1'\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" +
|
|
|
"WHERE t.id = '"+doctorDO.getId()+"' ";
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
//System.out.println(chargeDictDOLists.get(1));
|
|
@ -4090,13 +4065,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"\td.req_fee as \"xtzxFee\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\tbase_doctor t\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
|
|
|
"WHERE t.id = '"+doctorDO.getId()+"' ";
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type and d.is_del='1'\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" +
|
|
|
"WHERE t.id = '"+doctorDO.getId()+"'";
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
rs.put("chargeTypeList",chargeDictDOLists);
|
|
|
//机构科室信息
|
|
@ -4209,6 +4184,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
else if("2".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
|
|
|
type="17";
|
|
|
}else if("2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
|
|
|
type="12";
|
|
|
}
|
|
|
description = "居民取消";
|
|
|
if (StringUtils.isNoneBlank(type)){
|
|
@ -4393,24 +4370,33 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
contentMsg = "您发起的视频咨询已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您发起的视频咨询,医生已接诊";
|
|
|
}
|
|
|
if ("12".equals(type)) {
|
|
|
contentMsg = "您发起的专科协同已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您发起的专科协同,医生已接诊";
|
|
|
return;
|
|
|
}
|
|
|
if ("15".equals(type)) {
|
|
|
contentMsg = "您发起的家医咨询已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您发起的家医咨询,医生已接诊";
|
|
|
}
|
|
|
logger.info("doctorPick诊查费支付成功推送模板消息:outpatientId="+outpatientId);
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
} else if("doctorRefund".equalsIgnoreCase(titelType)) {
|
|
|
if ("9".equals(type)) {
|
|
|
contentMsg = "您的图文复诊订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
|
|
|
contentMsg = "您的图文复诊订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已退号";
|
|
|
}
|
|
|
if ("16".equals(type)) {
|
|
|
contentMsg = "您的视频复诊订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您发起的视频复诊已退号";
|
|
|
contentMsg = "您的视频复诊订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已退号";
|
|
|
}
|
|
|
if ("1".equals(type)) {
|
|
|
contentMsg = "您的图文咨询订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您发起的图文咨询已退号";
|
|
|
contentMsg = "您的图文咨询订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已退号";
|
|
|
}
|
|
|
if ("17".equals(type)) {
|
|
|
contentMsg = "您的视频咨询订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您发起的视频咨询已退号";
|
|
|
contentMsg = "您的视频咨询订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已退号";
|
|
|
}
|
|
|
logger.info("doctorRefund:outpatientId="+outpatientId);
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
@ -4431,6 +4417,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
contentMsg = "您发起的视频咨询已被您取消。由于订单取消将不做扣费处理。";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已被您取消,您可重新发起";
|
|
|
}
|
|
|
if ("12".equals(type)) {
|
|
|
return;
|
|
|
}
|
|
|
logger.info("patientCancel诊查费支付成功推送模板消息:outpatientId="+outpatientId);
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
}else if("systemCancelRemind".equalsIgnoreCase(titelType)){
|
|
@ -4457,8 +4446,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您有一笔未完成的在线问诊订单,请及时处理。";//您有一个视频复诊订单待支付,请及时支付。
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
logger.info("视频复诊订单待支付微信消息模板推送开始");
|
|
|
}
|
|
|
if ("1".equals(type)) {
|
|
|
}else if ("1".equals(type)) {
|
|
|
contentMsg = "您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
|
|
@ -4468,23 +4456,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
|
|
|
logger.info("视频咨询订单待支付微信消息模板推送开始");
|
|
|
}else {
|
|
|
return;
|
|
|
}
|
|
|
} else if ("paySuccess".equalsIgnoreCase(titelType)) {
|
|
|
if ("9".equals(type)) {
|
|
|
contentMsg = "您已成功发起图文复诊,请耐心等待医生接单。如长时间未接诊,建议选择其他医生";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您已成功发起图文复诊";
|
|
|
}
|
|
|
if ("16".equals(type)) {
|
|
|
}else if ("16".equals(type)) {
|
|
|
contentMsg = "您已成功发起视频复诊,请耐心等待医生接单。如长时间未接诊,建议选择其他医生";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您已成功发起视频复诊";
|
|
|
}
|
|
|
if ("1".equals(type)) {
|
|
|
}else if ("1".equals(type)) {
|
|
|
contentMsg = "您已成功发起图文咨询,请耐心等待医生接单。如长时间未接诊,建议选择其他医生";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您已成功发起图文咨询";
|
|
|
}
|
|
|
if ("17".equals(type)) {
|
|
|
}else if ("17".equals(type)) {
|
|
|
contentMsg = "您已成功发起视频咨询,请耐心等待医生接单。如长时间未接诊,建议选择其他医生";
|
|
|
first = outpatientDO.getConsumerName() + ",您好!您已成功发起视频咨询";
|
|
|
}else {
|
|
|
return;
|
|
|
}
|
|
|
logger.info("paySuccess诊查费支付成功推送模板消息:outpatientId="+outpatientId);
|
|
|
msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
|
|
@ -4532,18 +4521,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (consultTeam.getType()!=null&&1==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条图文咨询已结束,请及时对咨询医生进行评价。";
|
|
|
logger.info("图文咨询服务评价微信消息模板推送开始");
|
|
|
}
|
|
|
if (consultTeam.getType()!=null&&9==consultTeam.getType()){
|
|
|
}else if (consultTeam.getType()!=null&&9==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条图文复诊已结束,请及时对咨询医生进行评价。";
|
|
|
logger.info("图文复诊服务评价微信消息模板推送开始");
|
|
|
}
|
|
|
if (consultTeam.getType()!=null&&16==consultTeam.getType()){
|
|
|
}else if (consultTeam.getType()!=null&&16==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条视频复诊已结束,请及时对咨询医生进行评价。";
|
|
|
logger.info("视频复诊服务评价微信消息模板推送开始");
|
|
|
}
|
|
|
if (consultTeam.getType()!=null&&17==consultTeam.getType()){
|
|
|
}else if (consultTeam.getType()!=null&&17==consultTeam.getType()){
|
|
|
first = consultTeam.getName() + ",您好!您有1条视频咨询已结束,请及时对咨询医生进行评价。";
|
|
|
logger.info("视频咨询服务评价微信消息模板推送开始");
|
|
|
}else {
|
|
|
return;
|
|
|
}
|
|
|
contentMsg = "请对" + consDoctorDO.getName() + "医生的服务进行评价";
|
|
|
msgUrl="/ims-wx/index.html#/fuwupingjia?consultCode="+consultTeam.getConsult();
|
|
@ -5225,8 +5213,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
//根据身份证计算年龄
|
|
|
for (Map<String, Object> outpatient : list) {
|
|
|
String idcard = (String) outpatient.get("idcard");
|
|
|
int patientAge = 0;
|
|
|
int patientSex = 3;
|
|
|
Integer patientAge = 0;
|
|
|
Integer patientSex = 3;
|
|
|
if (null!=outpatient.get("outPatient")){
|
|
|
BasePatientDO basePatientDO = basePatientDao.findById(outpatient.get("outPatient").toString());
|
|
|
if (null!=basePatientDO){
|
|
@ -5895,13 +5883,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"\td.req_fee as \"xtzxFee\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\t ("+sql+") t \n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n"+
|
|
|
" where t.id is not null ";
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type and d.is_del='1'\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n"+
|
|
|
" where t.id is not null";
|
|
|
List<Map<String,Object>> chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge, params);
|
|
|
//查询医生各项评价平均分
|
|
|
String sqlscore = "select t.doctor as \"id\" ,sum(t.score)/3 as\"score\" from ("+
|
|
@ -6246,13 +6234,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"\td.req_fee as \"xtzxFee\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\tbase_doctor t\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
|
|
|
"WHERE t.id = '"+map.get("id")+"' ";
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type and d.is_del='1'\n" +
|
|
|
" LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" +
|
|
|
"WHERE t.id = '"+map.get("id")+"'";
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
map.put("chargeTypeList",chargeDictDOLists);
|
|
|
//查询医生各项评价平均分
|
|
@ -9547,7 +9535,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public net.sf.json.JSON outpatient(String patient) throws Exception {
|
|
|
public net.sf.json.JSON outpatient(String patient,String doctorId) throws Exception {
|
|
|
try {
|
|
|
baseOperateLogService.saveOperateLog(doctorId,patient,"EMR","住院病历","","");
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
PatientMappingDO mappingDO = patientMappingDao.findByPatient(patient);
|
|
|
String url = "";
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("HAI_TAI_OUTPATIENT_URL");
|
|
@ -9571,6 +9564,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
net.sf.json.JSON json = xmlSerializer.read(returnValue);
|
|
|
logger.info("返回json" + json);
|
|
|
|
|
|
return json;
|
|
|
}
|
|
|
|
|
@ -10772,6 +10766,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
chargeDictDO.setReqFee(twPrcie1);
|
|
|
chargeDictDO.setChargeType(twPrcie+"");
|
|
|
chargeDictDO.setChargeName(twPrcie+"");
|
|
|
chargeDictDO.setIsDel("1");
|
|
|
chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
|
|
|
}
|
|
|
doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
|
|
@ -10809,6 +10804,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
chargeDictDO.setReqFee(spPrcie1);
|
|
|
chargeDictDO.setChargeType(spPrcie+"");
|
|
|
chargeDictDO.setChargeName(spPrcie+"");
|
|
|
chargeDictDO.setIsDel("1");
|
|
|
chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
|
|
|
}
|
|
|
doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
|
|
@ -10888,6 +10884,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
chargeDictDO.setReqFee(price1);
|
|
|
chargeDictDO.setChargeType(price + "");
|
|
|
chargeDictDO.setChargeName(price + "");
|
|
|
chargeDictDO.setIsDel("1");
|
|
|
chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
|
|
|
}
|
|
|
doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
|
|
@ -10907,6 +10904,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
chargeDictDO.setReqFee(price1);
|
|
|
chargeDictDO.setChargeType(price + "");
|
|
|
chargeDictDO.setChargeName(price + "");
|
|
|
chargeDictDO.setIsDel("1");
|
|
|
chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
|
|
|
}
|
|
|
doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
|
|
@ -12659,5 +12657,4 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|