|
@ -792,34 +792,26 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
|
|
|
@ApiParam(name = "orderId", value = "上门服务订单号")
|
|
|
@RequestParam(value = "orderId", required = false) String orderId) throws Exception {
|
|
|
Map<String, Object> result = prescriptionService.makeDiagnosis(outPatientId, prescriptionId, advice, type, infoJsons, diagnosisJson, inspectionJson, emrJson, hisId);
|
|
|
try {
|
|
|
|
|
|
com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
|
|
|
|
|
|
List<WlyyPrescriptionDiagnosisDO> diagnosisDOs = (List<WlyyPrescriptionDiagnosisDO>) com.alibaba.fastjson.JSONArray.parseArray(diagnosisJson, WlyyPrescriptionDiagnosisDO.class);
|
|
|
String zd_str = "";
|
|
|
String jl_str = advice;
|
|
|
for (WlyyPrescriptionDiagnosisDO diagnosisDO : diagnosisDOs) {
|
|
|
if ("1".equals(diagnosisDO.getType())) {
|
|
|
zd_str += diagnosisDO.getName() + "," + zd_str;
|
|
|
} else {
|
|
|
zd_str += diagnosisDO.getName() + ",";
|
|
|
}
|
|
|
}
|
|
|
zd_str = zd_str.substring(0, zd_str.length() - 1);
|
|
|
msgObj.put("zd", zd_str);
|
|
|
msgObj.put("jl", jl_str);
|
|
|
msgObj.put("outpatientid", outPatientId);
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outPatientId).orElse(null);
|
|
|
String immsg = imService.pushHuiZhenMsg(msgObj, wlyyOutpatientDO.getDoctor(), wlyyOutpatientDO.getDoctorName(), outPatientId, wlyyOutpatientDO.getPatient(), wlyyOutpatientDO.getOutpatientType());
|
|
|
System.out.println("发送诊断消息成功:" + immsg);
|
|
|
if (result.get("prescriptionId") != null && StringUtils.isNoneBlank(orderId)) {
|
|
|
prescriptionService.savePrescriptionToDoorService(orderId, result.get("prescriptionId").toString());
|
|
|
com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
|
|
|
List<WlyyPrescriptionDiagnosisDO> diagnosisDOs = (List<WlyyPrescriptionDiagnosisDO>) com.alibaba.fastjson.JSONArray.parseArray(diagnosisJson, WlyyPrescriptionDiagnosisDO.class);
|
|
|
String zd_str = "";
|
|
|
String jl_str = advice;
|
|
|
for (WlyyPrescriptionDiagnosisDO diagnosisDO : diagnosisDOs) {
|
|
|
if ("1".equals(diagnosisDO.getType())) {
|
|
|
zd_str += diagnosisDO.getName() + "," + zd_str;
|
|
|
} else {
|
|
|
zd_str += diagnosisDO.getName() + ",";
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
System.out.println("发送诊断消息失败:" + e.getMessage());
|
|
|
// e.printStackTrace();
|
|
|
}
|
|
|
zd_str = zd_str.substring(0, zd_str.length() - 1);
|
|
|
msgObj.put("zd", zd_str);
|
|
|
msgObj.put("jl", jl_str);
|
|
|
msgObj.put("outpatientid", outPatientId);
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outPatientId).orElse(null);
|
|
|
String immsg = imService.pushHuiZhenMsg(msgObj, wlyyOutpatientDO.getDoctor(), wlyyOutpatientDO.getDoctorName(), outPatientId, wlyyOutpatientDO.getPatient(), wlyyOutpatientDO.getOutpatientType());
|
|
|
System.out.println("发送诊断消息成功:" + immsg);
|
|
|
if (result.get("prescriptionId") != null && StringUtils.isNoneBlank(orderId)) {
|
|
|
prescriptionService.savePrescriptionToDoorService(orderId, result.get("prescriptionId").toString());
|
|
|
}
|
|
|
return success(result);
|
|
|
}
|