|
@ -110,7 +110,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
}
|
|
|
|
|
|
|
|
|
public JSONObject getPrescriptionFilter(Integer teamCode) {
|
|
|
public JSONObject getPrescriptionFilter(Integer teamCode,String patient) {
|
|
|
|
|
|
JSONObject rs = new JSONObject();
|
|
|
List<SystemDict> sdict = systemDictDao.findByDictName("PRESCRIPTION_STATE");
|
|
@ -119,7 +119,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
Map<String,Object> m = new HashedMap();
|
|
|
m.put("code",sd.getCode());
|
|
|
m.put("value",sd.getValue());
|
|
|
m.put("count",getPresCountByState(teamCode,sd.getCode()));
|
|
|
m.put("count",getPresCountByState(teamCode,sd.getCode(),patient));
|
|
|
states.add(m);
|
|
|
}
|
|
|
rs.put("states", states);
|
|
@ -137,7 +137,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public int getPresCountByState(Integer teamCode,String states){
|
|
|
public int getPresCountByState(Integer teamCode,String states,String patient){
|
|
|
String sql = "SELECT " +
|
|
|
" COUNT(1) AS count " +
|
|
|
" FROM " +
|
|
@ -145,6 +145,9 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
" WHERE " +
|
|
|
" p.admin_team_id =" +teamCode+
|
|
|
" AND p.`status` in ("+states+")";
|
|
|
if(StringUtils.isNotBlank(patient)){
|
|
|
sql = sql+ " AND p.patient = '"+patient+"'";
|
|
|
}
|
|
|
List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
|
|
|
if(rs!=null&&rs.size()>0){
|
|
|
Long r = (Long) rs.get(0).get("count");
|
|
@ -1367,8 +1370,11 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
}
|
|
|
|
|
|
|
|
|
public List<PrescriptionReasonDict> getReasonByType(Integer type){
|
|
|
List<PrescriptionReasonDict> list = prescriptionReasonDictDao.findByTypeOrderBySortAsc(type);
|
|
|
return list;
|
|
|
public JSONArray getReasonByType(Integer type){
|
|
|
|
|
|
String sql = "SELECT t.value,t.code FROM wlyy_prescription_reason_dict t WHERE t.type = "+type+" ORDER BY t.sort ASC ";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
//System.out.println("list:"+list.size());
|
|
|
return new JSONArray(list);
|
|
|
}
|
|
|
}
|