|
@ -297,21 +297,29 @@ public class PrescriptionService {
|
|
|
*/
|
|
|
public com.alibaba.fastjson.JSONObject getinfo(String code) {
|
|
|
Prescription prescription = prescriptionDao.findByCode(code);
|
|
|
Patient p = patientDao.findByCode(prescription.getPatient());
|
|
|
String rs = jwPrescriptionService.getRecipe(code, p.getSsc());
|
|
|
com.alibaba.fastjson.JSONObject r = presModeAdapter.modelToSinglePrescription(rs);
|
|
|
|
|
|
String rState = presCheckStateObj(code);
|
|
|
if ("1".equals(rState)) {
|
|
|
r.put("reviewedState", 1);
|
|
|
r.put("prescriptionCode", "");
|
|
|
List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code);
|
|
|
PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code);
|
|
|
List<PrescriptionAdjust> prescriptionAdjusts = prescriptionAdjustDao.findByPrescriptionCodeOrderByIdDesc(code);
|
|
|
com.alibaba.fastjson.JSONObject rs = new com.alibaba.fastjson.JSONObject();
|
|
|
prescription.setStatusName("");
|
|
|
rs.put("prescription", prescription);
|
|
|
rs.put("createTime", DateUtil.dateToStrLong(prescription.getCreateTime()));
|
|
|
rs.put("reviewedTime",DateUtil.dateToStrLong(reviewed.getReviewedTime()));
|
|
|
rs.put("prescriptionInfo", prescriptionInfos);
|
|
|
rs.put("reviewed", reviewed);
|
|
|
if (prescription != null && StringUtils.isNotBlank(prescription.getPatient())) {
|
|
|
rs.put("patient", patientDao.findByCode(prescription.getPatient()));
|
|
|
} else {
|
|
|
r.put("reviewedState", 0);
|
|
|
r.put("prescriptionCode", rState);
|
|
|
rs.put("patient", "");
|
|
|
}
|
|
|
rs.put("diagnosis", prescriptionDiagnosisDao.findByPrescriptionCode(code));
|
|
|
|
|
|
|
|
|
return r;
|
|
|
if (prescriptionAdjusts != null && prescriptionAdjusts.size() > 0) {
|
|
|
rs.put("prescriptionAdjust", prescriptionAdjusts.get(0));
|
|
|
} else {
|
|
|
rs.put("prescriptionAdjust", "");
|
|
|
}
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public String presCheckStateObj(String code) {
|