| | |
| | | import com.smartor.mapper.*; |
| | | import com.smartor.service.*; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | |
| | | serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size()); |
| | | //记录过滤患者详情 |
| | | List<ServiceSubtask> filterServiceSubtasks = new ArrayList<>(); |
| | | //记录首次应随访详情 |
| | | List<ServiceSubtask> needFollowUpInfo = new ArrayList<>(); |
| | | //记录首次待随访详情 |
| | | List<ServiceSubtask> pendingFollowUpInfo = new ArrayList<>(); |
| | | //记录首次随访成功详情 |
| | | List<ServiceSubtask> followUpSuccessInfo = new ArrayList<>(); |
| | | //记录首次随访失败详情 |
| | | List<ServiceSubtask> followUpFailInfo = new ArrayList<>(); |
| | | |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | //无需随访人次 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) { |
| | |
| | | |
| | | //首次出院随访 |
| | | if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() == 1) { |
| | | //首次应随访 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) { |
| | | serviceSubtaskStatistic.setNeedFollowUp(serviceSubtaskStatistic.getNeedFollowUp() + 1L); |
| | | needFollowUpInfo.add(serviceSubtask); |
| | | } |
| | | //首次待随访 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) { |
| | | serviceSubtaskStatistic.setPendingFollowUp(serviceSubtaskStatistic.getPendingFollowUp() + 1L); |
| | | pendingFollowUpInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访成功 |
| | | if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 6)) { |
| | | serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L); |
| | | followUpSuccessInfo.add(serviceSubtask); |
| | | } |
| | | //首次随访失败 |
| | | if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) { |
| | | serviceSubtaskStatistic.setFollowUpFail(serviceSubtaskStatistic.getFollowUpFail() + 1L); |
| | | followUpFailInfo.add(serviceSubtask); |
| | | } |
| | | if (serviceSubtaskStatistic.getNeedFollowUp() > 0) { |
| | | double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccess() + serviceSubtaskStatistic.getFollowUpFail()) / serviceSubtaskStatistic.getNeedFollowUp(); |
| | |
| | | } |
| | | } |
| | | serviceSubtaskStatistic.setFilterCountList(filterServiceSubtasks); |
| | | |
| | | //记录首次应随访详情 |
| | | serviceSubtaskStatistic.setNeedFollowUpInfo(needFollowUpInfo); |
| | | //记录首次待随访详情 |
| | | serviceSubtaskStatistic.setPendingFollowUpInfo(pendingFollowUpInfo); |
| | | //记录首次随访成功详情 |
| | | serviceSubtaskStatistic.setFollowUpSuccessInfo(followUpSuccessInfo); |
| | | //记录首次随访失败详情 |
| | | serviceSubtaskStatistic.setFollowUpFailInfo(followUpFailInfo); |
| | | return serviceSubtaskStatistic; |
| | | } |
| | | |