|
@ -5096,7 +5096,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @query_status 0:图文复诊候诊 1:图文复诊抢单列表
|
|
|
* @dept 部门
|
|
|
*/
|
|
|
public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept,String sex,String keyword,String ageGroup) {
|
|
|
public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept,String sex,String keyword,String ageGroup,String patient) {
|
|
|
|
|
|
String sql = "SELECT " +
|
|
|
"room.outpatient_id AS \"id\"," +
|
|
@ -5177,6 +5177,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}if(StringUtils.isNoneBlank(keyword)){
|
|
|
sql += " AND outpatient.patient_name like '%" + keyword + "%' ";
|
|
|
}
|
|
|
if(StringUtils.isNoneBlank(patient)){
|
|
|
sql += " AND (outpatient.patient= '" + patient + "' or outpatient.consumer ='"+patient+"') ";
|
|
|
}
|
|
|
if(StringUtils.isNoneBlank(ageGroup)){
|
|
|
String[] age = ageGroup.split(",");
|
|
|
Calendar nowBegin = Calendar.getInstance();
|
|
@ -9864,13 +9867,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
* @param size
|
|
|
* @return
|
|
|
*/
|
|
|
public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size,String patient,String isSelectDrug) {
|
|
|
public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size,String patient,String isSelectDrug,boolean consumerflag) {
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patient);
|
|
|
if (patientDO==null){
|
|
|
return PageEnvelop.getError("找不到该患者",-1);
|
|
|
}
|
|
|
StringBuffer sql = new StringBuffer(" SELECT DISTINCT b.*, c.oneself_pickup_flg,f.job_title_code,f.job_title_name FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id WHERE o.consumer = '");
|
|
|
StringBuffer countSql = new StringBuffer("select COUNT(DISTINCT b.id) count FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id WHERE o.consumer = '");
|
|
|
/*if (consumerflag){
|
|
|
sql.append(" WHERE o.consumer = '");
|
|
|
countSql.append(" WHERE o.consumer = '");
|
|
|
}else{
|
|
|
sql.append(" WHERE o.patient = '");
|
|
|
countSql.append(" WHERE o.patient = '");
|
|
|
}*/
|
|
|
sql.append(patient).append("') b LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id ");
|
|
|
countSql.append(patient).append("') b LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id ");
|
|
|
if (StringUtils.isNoneBlank(isSelectDrug)){
|
|
@ -10436,6 +10446,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
|
|
|
/*prescriptionDao.updateCheckStatus(prescriptionId,2,reason,20);*/
|
|
|
logger.info("作废处方开始" + prescriptionDO.getCheckStatus());
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
|
|
|
List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId, 1);
|
|
@ -10467,13 +10478,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
try {
|
|
|
net.sf.json.JSONObject jsonObject = entranceService.BS10112(jsonData.toJSONString(), demoFlag);
|
|
|
wlyyHttpLogDO.setResponse(jsonObject.toString());
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return "作废失败";
|
|
|
}
|
|
|
|
|
|
wlyyHttpLogDO.setRequest(jsonData.toJSONString());
|
|
|
wlyyHttpLogDO.setName("作废处方");
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
wlyyHttpLogDO.setCode(outpatientDO.getId());
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
}
|
|
|
|
|
|
prescriptionDO.setStatus(-4);
|
|
|
prescriptionDO.setDisableTime(new Date());
|
|
|
prescriptionDO.setCheckStatus(5);
|
|
|
prescriptionDO.setCheckReason("已作废");
|
|
|
prescriptionDao.save(prescriptionDO);
|