|
@ -182,13 +182,23 @@ public class UnSettledHISPrescriptionService {
|
|
|
JSONObject json = jsonArray.getJSONObject(i);
|
|
|
String cfsb = json.getString("CFSB");
|
|
|
//查找对应的处方
|
|
|
String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR_NAME from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '"+cfsb+"' ORDER BY w.CREATE_TIME desc";
|
|
|
String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR,w.DOCTOR_NAME from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '"+cfsb+"' and status <> 11 ORDER BY w.CREATE_TIME desc";
|
|
|
List<Map<String, Object>> pre = hibenateUtils.createSQLQuery(sql);
|
|
|
if(pre!=null && pre.size()>0){
|
|
|
String prescriptionId = pre.get(0).get("ID").toString();
|
|
|
String outpatientId=pre.get(0).get("OUTPATIENT_ID").toString();
|
|
|
String doctor = pre.get(0).get("DOCTOR").toString();
|
|
|
String doctorName = pre.get(0).get("DOCTOR_NAME").toString();
|
|
|
//修改处方状态
|
|
|
String updateSql = "update WLYY_PRESCRIPTION set status = 11 where id = '"+prescriptionId+"'";
|
|
|
hibenateUtils.updateBySql(updateSql);
|
|
|
com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
|
|
|
msgObj.put("outpatientid",outpatientId);
|
|
|
msgObj.put("prescriptionId",prescriptionId);
|
|
|
msgObj.put("reason","处方驳回");
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
|
|
|
String immsg = imService.pushPrescriptionBackMsg(msgObj,doctor,doctorName,outpatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
|
|
|
System.out.println("发送诊断消息成功:"+immsg);
|
|
|
}
|
|
|
}
|
|
|
}
|