|
@ -78,6 +78,7 @@ import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
|
|
|
import com.yihu.jw.utils.Pkis.PKIService_PortType;
|
|
|
import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
|
|
|
import com.yihu.jw.utils.StringUtil;
|
|
|
import com.yihu.jw.utils.WebserviceUtil;
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
|
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
|
|
@ -1506,28 +1507,37 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
String id = (String) doctor.get("id");
|
|
|
List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(id, orgCode);
|
|
|
doctor.put("workTime", times);
|
|
|
String deptTyepCode = "6";
|
|
|
List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByDoctorCode(id);
|
|
|
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){
|
|
|
deptTyepCode = dictHospitalDeptDO.get(0).getDeptTypeCode();
|
|
|
String deptTyepCode = "";
|
|
|
if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
|
|
|
deptTyepCode = "6";
|
|
|
List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByDoctorCode(id);
|
|
|
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();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
String chargeTypeList = doctor.get("chargeType").toString();
|
|
|
if (chargeType.contains(",")){
|
|
|
chargeTypeList = chargeType.replace(",","','");
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
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\",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);
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeTypeList+"')";
|
|
|
sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
|
|
|
List<Map<String,Object>> chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
doctor.put("chargeTypeList",chargeDictDOLists);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(doctorCode)) {
|
|
@ -1578,7 +1588,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询医生列表带月份排班状态
|
|
|
*
|
|
@ -3375,7 +3384,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
public Map<String, Object> findDoctorInfo(String doctor, String withWork,String patient) {
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
|
|
|
|
|
|
Map<String, Object> rs = new HashedMap();
|
|
|
if (doctorDO != null) {
|
|
|
rs.put("doctor", doctor);
|
|
@ -3409,28 +3417,38 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("popularity",doctorDO.getPopularity());
|
|
|
rs.put("qrcode",doctorDO.getQrcode());
|
|
|
//号别
|
|
|
String 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){
|
|
|
deptTyepCode = dictHospitalDeptDO.get(0).getDeptTypeCode();
|
|
|
}
|
|
|
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 (chargeType.contains(",")){
|
|
|
chargeType = chargeType.replace(",","','");
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeType+"')";
|
|
|
sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
|
|
|
List<Map<String,Object>> chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
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\",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);
|
|
|
}
|
|
|
rs.put("chargeTypeList",chargeDictDOLists);
|
|
|
//机构科室信息
|
|
|
List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
|
|
@ -3666,28 +3684,38 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
rs.put("sex",doctorDO.getSex());
|
|
|
rs.put("qrcode",doctorDO.getQrcode());
|
|
|
//号别
|
|
|
String 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){
|
|
|
deptTyepCode = dictHospitalDeptDO.get(0).getDeptTypeCode();
|
|
|
}
|
|
|
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 (chargeType.contains(",")){
|
|
|
chargeType = chargeType.replace(",","','");
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeType+"')";
|
|
|
sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
|
|
|
List<Map<String,Object>> chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
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\",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);
|
|
|
}
|
|
|
rs.put("chargeTypeList",chargeDictDOLists);
|
|
|
//机构科室信息
|
|
|
List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
|
|
@ -4956,7 +4984,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (pagesize <= 0) {
|
|
|
pagesize = 10;
|
|
|
}*/
|
|
|
wechatId = "12";
|
|
|
String sql = "SELECT " +
|
|
|
" d.id AS \"id\", " +
|
|
|
" d.photo AS \"photo\", " +
|
|
@ -5117,28 +5144,38 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
for (Map<String,Object> map:list){
|
|
|
String doctor = map.get("id").toString();
|
|
|
//号别
|
|
|
String 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){
|
|
|
deptTyepCode = dictHospitalDeptDO.get(0).getDeptTypeCode();
|
|
|
}
|
|
|
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();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
String chargeType = map.get("chargeType").toString();
|
|
|
if (chargeType.contains(",")){
|
|
|
chargeType = chargeType.replace(",","','");
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
if(null!=map.get("chargeType")){
|
|
|
String chargeType = map.get("chargeType").toString();
|
|
|
if (chargeType.contains(",")){
|
|
|
chargeType = chargeType.replace(",","','");
|
|
|
}
|
|
|
String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",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 charge_type as \"chargeType\",charge_name as \"chargeName\"," +
|
|
|
"req_fee as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeType+"')";
|
|
|
sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
|
|
|
List<Map<String,Object>> chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
map.put("chargeTypeList",chargeDictDOLists);
|
|
|
//查询医生各项评价平均分
|
|
|
String sqlscore = "SELECT " +
|
|
@ -8949,15 +8986,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
List<WlyyPrescriptionDiagnosisDO> wlyyPrescriptionDiagnosisDOs = prescriptionDiagnosisDao.findByPrescriptionId(prescriptionId,1);
|
|
|
if (null!=wlyyPrescriptionDiagnosisDOs&&wlyyPrescriptionDiagnosisDOs.size()>0){
|
|
|
xzzxEntranceService.deleteCheckInputInfo(hisId,"0",prescriptionDO.getDoctor(),prescriptionDO.getPatientCode(),wlyyPrescriptionDiagnosisDOs);
|
|
|
if (StringUtils.isNotBlank(prescriptionDO.getRealOrder())){
|
|
|
xzzxEntranceService.deletePrescriptionToEntrance(prescriptionDO.getRealOrder());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
prescriptionDO.setStatus(-1);
|
|
|
prescriptionDO.setCheckStatus(5);
|
|
|
prescriptionDO.setCheckReason("作废处方");
|
|
|
prescriptionDO.setCheckStatus(4);
|
|
|
prescriptionDO.setCheckReason("已删除");
|
|
|
prescriptionDao.save(prescriptionDO);
|
|
|
return "作废成功";
|
|
|
return "删除成功";
|
|
|
}else {
|
|
|
return "作废失败";
|
|
|
return "删除失败";
|
|
|
}
|
|
|
}
|
|
|
}
|