|
@ -225,11 +225,13 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
List listNum = new ArrayList();
|
|
List listNum = new ArrayList();
|
|
JSONObject list = familyContractService.getPatientByLable(oldDoctorCode, labelType, level, teamCode);
|
|
JSONObject list = familyContractService.getPatientByLable(oldDoctorCode, labelType, level, teamCode);
|
|
List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode);
|
|
List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode);
|
|
|
|
int count = 0;
|
|
for (SignPatientLabel label : s) {
|
|
for (SignPatientLabel label : s) {
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
String labelName = label.getLabelName();
|
|
String labelName = label.getLabelName();
|
|
JSONArray jsonArray = list.getJSONArray(label.getLabelName());
|
|
JSONArray jsonArray = list.getJSONArray(label.getLabelName());
|
|
List codes = new ArrayList();
|
|
List codes = new ArrayList();
|
|
|
|
|
|
for (int i = 0 ;i<jsonArray.length();i++){
|
|
for (int i = 0 ;i<jsonArray.length();i++){
|
|
JSONObject json = jsonArray.getJSONObject(i);
|
|
JSONObject json = jsonArray.getJSONObject(i);
|
|
Map info = new HashMap();
|
|
Map info = new HashMap();
|
|
@ -239,11 +241,17 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
info.put("name",name);
|
|
info.put("name",name);
|
|
codes.add(info);
|
|
codes.add(info);
|
|
}
|
|
}
|
|
|
|
int length = codes.size();
|
|
map.put("label", labelName);
|
|
map.put("label", labelName);
|
|
map.put("codes", codes);
|
|
map.put("codes", codes);
|
|
|
|
map.put("number", length);
|
|
listNum.add(map);
|
|
listNum.add(map);
|
|
|
|
count+=length;
|
|
}
|
|
}
|
|
return write(200, "查询成功", "data", listNum);
|
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
map.put("count",count);
|
|
|
|
map.put("patients",listNum);
|
|
|
|
return write(200, "查询成功", "data", map);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return error(-1, "查询失败");
|
|
return error(-1, "查询失败");
|
|
}
|
|
}
|
|
@ -968,25 +976,49 @@ public class DoctorFamilyContractController extends WeixinBaseController {
|
|
Long teamCode) {
|
|
Long teamCode) {
|
|
try {
|
|
try {
|
|
List listNum = new ArrayList();
|
|
List listNum = new ArrayList();
|
|
|
|
Map patients = new HashMap();
|
|
JSONObject list = familyContractService.findNoHealthSignFamilyHealth(getUID(), labelType, patientName, teamCode);
|
|
JSONObject list = familyContractService.findNoHealthSignFamilyHealth(getUID(), labelType, patientName, teamCode);
|
|
List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode);
|
|
|
|
for (SignPatientLabel label : s) {
|
|
|
|
Map map = new HashMap();
|
|
|
|
String labelName = label.getLabelName();
|
|
|
|
JSONArray jsonArray = list.getJSONArray(label.getLabelName());
|
|
|
|
List codes = new ArrayList();
|
|
|
|
|
|
List<SignFamily> signFamily = familyContractService.findNoHealthSignFamilyNum(teamCode);
|
|
|
|
if (!"4".equals(labelType)){
|
|
|
|
List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode);
|
|
|
|
for (SignPatientLabel label : s) {
|
|
|
|
Map map = new HashMap();
|
|
|
|
String labelName = label.getLabelName();
|
|
|
|
JSONArray jsonArray = list.getJSONArray(label.getLabelName());
|
|
|
|
/* List codes = new ArrayList();
|
|
for (Object patient:jsonArray) {
|
|
for (Object patient:jsonArray) {
|
|
JSONObject jsonObject = new JSONObject(patient.toString());
|
|
JSONObject jsonObject = new JSONObject(patient.toString());
|
|
String code = jsonObject.get("code").toString();
|
|
String code = jsonObject.get("code").toString();
|
|
codes.add(code);
|
|
codes.add(code);
|
|
|
|
}*/
|
|
|
|
int length = jsonArray.length();
|
|
|
|
map.put("label", labelName);
|
|
|
|
map.put("number", length);
|
|
|
|
// map.put("codes", codes);
|
|
|
|
listNum.add(map);
|
|
}
|
|
}
|
|
int length = jsonArray.length();
|
|
|
|
map.put("label", labelName);
|
|
|
|
map.put("number", length);
|
|
|
|
map.put("codes", codes);
|
|
|
|
|
|
}else {
|
|
|
|
JSONArray jsonArray = list.getJSONArray("孕产妇");
|
|
|
|
Map map = new HashMap();
|
|
|
|
map.put("label", "孕产妇");
|
|
|
|
map.put("number", jsonArray.length());
|
|
listNum.add(map);
|
|
listNum.add(map);
|
|
}
|
|
|
|
return write(200, "查询成功!", "data", listNum);
|
|
|
|
|
|
JSONArray jsonArray1 = list.getJSONArray("未标注");
|
|
|
|
Map map1 = new HashMap();
|
|
|
|
map1.put("label", "未标注");
|
|
|
|
map1.put("number", jsonArray1.length());
|
|
|
|
listNum.add(map1);
|
|
|
|
JSONArray jsonArray2 = list.getJSONArray("儿童");
|
|
|
|
Map map2 = new HashMap();
|
|
|
|
map2.put("label", "儿童");
|
|
|
|
map2.put("number", jsonArray2.length());
|
|
|
|
listNum.add(map2);
|
|
|
|
|
|
|
|
}
|
|
|
|
patients.put("count",list.length());
|
|
|
|
patients.put("count",signFamily.size());
|
|
|
|
patients.put("patients",listNum);
|
|
|
|
return write(200, "查询成功!", "data", patients);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
error(e);
|
|
error(e);
|
|
return invalidUserException(e, -1, "查询失败");
|
|
return invalidUserException(e, -1, "查询失败");
|