|
@ -340,7 +340,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
//疾病类型不为空,关联查询疾病类型表
|
|
|
pre_sql.append(" ,wlyy_prescription_diagnosis s " +
|
|
|
" WHERE s.prescription_code = pr.code " +
|
|
|
" AND s.code = ?");
|
|
|
" AND s.health_problem = ?");
|
|
|
params.add(diseases);
|
|
|
setSQL(pre_sql,params,teamCode,state,startDate,endDate,nameKeyword,patient,page,size);
|
|
|
}else{
|
|
@ -383,7 +383,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
pre_sql.append(" AND pr.patient = ?");
|
|
|
params.add(patient);
|
|
|
}
|
|
|
pre_sql.append(" GROUP BY pr.code ORDER BY pr.create_time DESC");
|
|
|
pre_sql.append(" GROUP BY pr.health_problem ORDER BY pr.create_time DESC");
|
|
|
if(page!=null&&page>0&&size!=null&&size>0){
|
|
|
pre_sql.append(" LIMIT "+(page-1)*size+","+size);
|
|
|
}
|
|
@ -480,22 +480,14 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
//删除所有药品
|
|
|
StringBuffer sql = new StringBuffer("UPDATE wlyy_prescription_info SET del = 0 WHERE prescription_code = '"+code+"'");
|
|
|
jdbcTemplate.execute(sql.toString());
|
|
|
JSONArray jsonArray = new JSONArray(infos);
|
|
|
net.sf.json.JSONArray jsonArray= net.sf.json.JSONArray.fromObject(sql);
|
|
|
Iterator<Object> it = jsonArray.iterator();
|
|
|
while (it.hasNext()){
|
|
|
JSONObject info = (JSONObject) it.next();
|
|
|
PrescriptionInfo p = new PrescriptionInfo();
|
|
|
net.sf.json.JSONObject info = (net.sf.json.JSONObject) it.next();
|
|
|
PrescriptionInfo p = (PrescriptionInfo)net.sf.json.JSONObject.toBean(info,PrescriptionInfo.class) ;
|
|
|
p.setCode(getCode());
|
|
|
p.setDel(1);
|
|
|
p.setPrescriptionCode(code);
|
|
|
p.setPrice(info.getInt("price"));
|
|
|
p.setDrugCode(info.getString("drugCode"));
|
|
|
p.setDrugName(info.getString("drugName"));
|
|
|
p.setDrugRate(info.getString("drugRate"));
|
|
|
p.setDrugFormat(info.getString("drugFormat"));
|
|
|
p.setNum(info.getInt("num"));
|
|
|
p.setIsRefrigerate(info.getInt("isRefrigerate"));
|
|
|
p.setDirection(info.getString("direction"));
|
|
|
prescriptionInfoDao.save(p);
|
|
|
}
|
|
|
prescriptionDiagnosisService.setPrescriptionInfo(code);
|
|
@ -525,10 +517,6 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
prescriptionDiagnosisService.setPrescriptionDiagnosis(code);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Prescription p = prescriptionDao.findByCode(code);
|
|
|
//记录Log
|
|
|
PrescriptionLog log = new PrescriptionLog();
|
|
@ -596,7 +584,8 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
" pr.`status`, " +
|
|
|
" pr.`code`, " +
|
|
|
" LEFT(pr.create_time,19) AS createTime, " +
|
|
|
" pr.doctor " +
|
|
|
" pr.doctor, " +
|
|
|
" pr.dispensary_type AS dispensaryType " +
|
|
|
" FROM " +
|
|
|
" wlyy_prescription pr " +
|
|
|
" LEFT JOIN wlyy_patient p ON pr.patient = p.`code` " +
|
|
@ -790,7 +779,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
" pr.`code`, " +
|
|
|
" LEFT(pr.create_time,19) AS createTime, " +
|
|
|
" pr.doctor, " +
|
|
|
" pr.dispensary_type,"+
|
|
|
" pr.dispensary_type AS dispensaryType,"+
|
|
|
" e.expressage_code AS expressageCode "+
|
|
|
" FROM " +
|
|
|
" wlyy_prescription pr " +
|