|
@@ -34,6 +34,9 @@ public class PatientInfoManager {
|
|
|
private List<String> nurseConfigTitleList = new ArrayList<>();
|
|
|
private List<NurseConfigItem> nurseConfigItemList = new ArrayList<>();
|
|
|
|
|
|
+ private int[] titleId = new int[] {R.string.patient_count_title, R.string.discharged_today_title, R.string.discharged_tomorrow_title, R.string.admission_today};
|
|
|
+ private int[] contents = new int[]{0, 0, 0, 0};
|
|
|
+
|
|
|
private PatientInfoManager(){
|
|
|
}
|
|
|
|
|
@@ -49,6 +52,7 @@ public class PatientInfoManager {
|
|
|
}
|
|
|
|
|
|
public void getPatientInfo() {
|
|
|
+ clearLists();
|
|
|
OkHttpClient.Builder builder = new OkHttpClient.Builder()
|
|
|
.connectTimeout(30, TimeUnit.SECONDS)
|
|
|
.writeTimeout(60, TimeUnit.SECONDS)
|
|
@@ -89,8 +93,6 @@ public class PatientInfoManager {
|
|
|
private void parsePatientInfo(List<PatientInfoBean> patients) {
|
|
|
allPatientInfoItemList.clear();
|
|
|
if (patients != null) {
|
|
|
- int[] titleId = new int[] {R.string.patient_count_title, R.string.discharged_today_title, R.string.discharged_tomorrow_title, R.string.admission_today};
|
|
|
- int[] contents = new int[]{0, 0, 0, 0};
|
|
|
contents[0] = patients.size();
|
|
|
for (int i = 0; i < titleId.length; i++) {
|
|
|
//住院信息
|
|
@@ -103,6 +105,15 @@ public class PatientInfoManager {
|
|
|
}
|
|
|
|
|
|
public List<AllPatientInfoItem> getAllPatientInfoItemList() {
|
|
|
+ if (allPatientInfoItemList.size() == 0) {
|
|
|
+ //默认值
|
|
|
+ for (int i = 0; i < titleId.length; i++) {
|
|
|
+ AllPatientInfoItem allPatientInfoItem = new AllPatientInfoItem();
|
|
|
+ allPatientInfoItem.setInfoTitle(getString(titleId[i]));
|
|
|
+ allPatientInfoItem.setInfoContent(Integer.toString(contents[i]));
|
|
|
+ allPatientInfoItemList.add(allPatientInfoItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
return allPatientInfoItemList;
|
|
|
}
|
|
|
|
|
@@ -126,4 +137,10 @@ public class PatientInfoManager {
|
|
|
private String getString(int resId) {
|
|
|
return BaseApp.getContext().getString(resId);
|
|
|
}
|
|
|
+
|
|
|
+ private void clearLists() {
|
|
|
+ allPatientInfoItemList.clear();
|
|
|
+ nurseConfigTitleList.clear();
|
|
|
+ nurseConfigItemList.clear();
|
|
|
+ }
|
|
|
}
|