|
@@ -20,6 +20,7 @@ import com.wdkl.infoboardclassic.data.NurseConfigBean;
|
|
|
import com.wdkl.infoboardclassic.data.NurseConfigItem;
|
|
|
import com.wdkl.infoboardclassic.data.NurseConfigLevel;
|
|
|
import com.wdkl.infoboardclassic.data.PatientInfoBean;
|
|
|
+import com.wdkl.infoboardclassic.utils.DateUtil;
|
|
|
import com.wdkl.infoboardclassic.utils.ToastUtil;
|
|
|
|
|
|
import java.io.IOException;
|
|
@@ -29,6 +30,7 @@ import java.util.Collections;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.TimeZone;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import okhttp3.Call;
|
|
@@ -140,8 +142,7 @@ public class PatientInfoManager {
|
|
|
for (PatientInfoBean bean: patientInfoBeanList) {
|
|
|
Long outTime = bean.getOutDate();
|
|
|
if (outTime != null && outTime > 0) {
|
|
|
- Date outDate = new Date(outTime);
|
|
|
- String outDay = new SimpleDateFormat(DATE_FORMAT).format(outDate);
|
|
|
+ String outDay = DateUtil.millsToDate(outTime, DATE_FORMAT);
|
|
|
if (MainActivity.curDate.equals(outDay)) {
|
|
|
contents[1]++; //今日出院
|
|
|
} else if (MainActivity.nextDate.equals(outDay)) {
|
|
@@ -151,8 +152,7 @@ public class PatientInfoManager {
|
|
|
|
|
|
Long inTime = bean.getInDate();
|
|
|
if (inTime != null && inTime > 0) {
|
|
|
- Date inDate = new Date(inTime);
|
|
|
- String inDay = new SimpleDateFormat(DATE_FORMAT).format(inDate);
|
|
|
+ String inDay = DateUtil.millsToDate(inTime, DATE_FORMAT);;
|
|
|
if (MainActivity.curDate.equals(inDay)) {
|
|
|
contents[3]++; //今日入院
|
|
|
}
|
|
@@ -202,71 +202,74 @@ public class PatientInfoManager {
|
|
|
}
|
|
|
|
|
|
public void setMainInfoList() {
|
|
|
- if (patientInfoBeanList != null && patientInfoBeanList.size() > 0) {
|
|
|
+ if (bedFrameBeanList != null && bedFrameBeanList.size() > 0) {
|
|
|
+ //床位数据
|
|
|
List<MainInfoItem> mainInfoItemList = new ArrayList<>();
|
|
|
List<NurseConfigBean> gradeLvl = null;
|
|
|
if (nurseConfigBeanList != null) {
|
|
|
gradeLvl = Stream.of(nurseConfigBeanList).filter(p -> p.getNurseLevel() == 0).collect(Collectors.toList());
|
|
|
}
|
|
|
- for (PatientInfoBean bean : patientInfoBeanList) {
|
|
|
- MainInfoItem infoItem = new MainInfoItem();
|
|
|
- String gender = "";
|
|
|
- String ageUnit = "";
|
|
|
- if (bean.getSex() == 1) {
|
|
|
- gender = "男";
|
|
|
- } else if (bean.getSex() == 2) {
|
|
|
- gender = "女";
|
|
|
- } else if (bean.getSex() == 3) {
|
|
|
- gender = "未知";
|
|
|
- }
|
|
|
- if (bean.getAgeUnit() == 0) {
|
|
|
- ageUnit = "岁";
|
|
|
- } else if (bean.getAge() == 1) {
|
|
|
- ageUnit = "月";
|
|
|
- } else if (bean.getAge() == 2) {
|
|
|
- ageUnit = "天";
|
|
|
- }
|
|
|
- //病人性别及年龄
|
|
|
- infoItem.setPatientAge(gender + " " + bean.getAge() + ageUnit);
|
|
|
|
|
|
- if (gradeLvl != null) {
|
|
|
- for (NurseConfigBean grade : gradeLvl) {
|
|
|
- if (bean.getGradeLevel().longValue() == grade.getId()) {
|
|
|
- infoItem.setGradeLevelColor(grade.getColor());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ for (HospitalFrameBean bedFrame : bedFrameBeanList) {
|
|
|
+ MainInfoItem infoItem = new MainInfoItem();
|
|
|
+ //床位号
|
|
|
+ infoItem.setBedNum(bedFrame.getName());
|
|
|
|
|
|
- if (bedFrameBeanList != null) {
|
|
|
- for (HospitalFrameBean frameBean : bedFrameBeanList) {
|
|
|
- if (bean.getFrameId().longValue() == frameBean.getId().longValue()) {
|
|
|
- //病人房间号及姓名
|
|
|
- infoItem.setBedNum(frameBean.getName());
|
|
|
+ if (patientInfoBeanList != null) {
|
|
|
+ for (PatientInfoBean bean : patientInfoBeanList) {
|
|
|
+ if (bean.getFrameId().longValue() == bedFrame.getId().longValue()) {
|
|
|
+ //入住人姓名
|
|
|
infoItem.setPatientName(bean.getName());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- if (employeeBeanList != null) {
|
|
|
- for (EmployeeBean employeeBean : employeeBeanList) {
|
|
|
- if (bean.getDoctorId().longValue() == employeeBean.getId().longValue()) {
|
|
|
- //责任医生
|
|
|
- infoItem.setDoctorName(getString(R.string.patient_doctor) + " " + employeeBean.getName());
|
|
|
- }
|
|
|
- if (bean.getNurseId().longValue() == employeeBean.getId().longValue()) {
|
|
|
- //责任护士
|
|
|
- infoItem.setNurseName(getString(R.string.patient_nurse) + " " + employeeBean.getName());
|
|
|
+ String gender = "";
|
|
|
+ String ageUnit = "";
|
|
|
+ if (bean.getSex() == 1) {
|
|
|
+ gender = "男";
|
|
|
+ } else if (bean.getSex() == 2) {
|
|
|
+ gender = "女";
|
|
|
+ } else if (bean.getSex() == 3) {
|
|
|
+ gender = "未知";
|
|
|
+ }
|
|
|
+ if (bean.getAgeUnit() == 0) {
|
|
|
+ ageUnit = "岁";
|
|
|
+ } else if (bean.getAge() == 1) {
|
|
|
+ ageUnit = "月";
|
|
|
+ } else if (bean.getAge() == 2) {
|
|
|
+ ageUnit = "天";
|
|
|
+ }
|
|
|
+ //入住人性别及年龄
|
|
|
+ infoItem.setPatientAge(gender + " " + bean.getAge() + ageUnit);
|
|
|
+
|
|
|
+ if (gradeLvl != null) {
|
|
|
+ for (NurseConfigBean grade : gradeLvl) {
|
|
|
+ if (bean.getGradeLevel().longValue() == grade.getId()) {
|
|
|
+ infoItem.setGradeLevelColor(grade.getColor());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (employeeBeanList != null) {
|
|
|
+ for (EmployeeBean employeeBean : employeeBeanList) {
|
|
|
+ if (bean.getDoctorId().longValue() == employeeBean.getId().longValue()) {
|
|
|
+ //责任医生
|
|
|
+ infoItem.setDoctorName(getString(R.string.patient_doctor) + " " + employeeBean.getName());
|
|
|
+ }
|
|
|
+ if (bean.getNurseId().longValue() == employeeBean.getId().longValue()) {
|
|
|
+ //责任护士
|
|
|
+ infoItem.setNurseName(getString(R.string.patient_nurse) + " " + employeeBean.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //入院日期
|
|
|
+ if (bean.getInDate() != null) {
|
|
|
+ String inDate = DateUtil.millsToDate(bean.getInDate(), DATE_FORMAT);
|
|
|
+ infoItem.setInDate(getString(R.string.patient_indate) + " " + inDate);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //入院日期
|
|
|
- if (bean.getInDate() != null) {
|
|
|
- Date date = new Date(bean.getInDate());
|
|
|
- String inDate = new SimpleDateFormat(DATE_FORMAT).format(date);
|
|
|
- infoItem.setInDate(getString(R.string.patient_indate) + " " + inDate);
|
|
|
- }
|
|
|
-
|
|
|
mainInfoItemList.add(infoItem);
|
|
|
}
|
|
|
|