|
@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.address.Town;
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
|
import com.yihu.wlyy.entity.organization.Hospital;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionDispensaryCode;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
|
|
|
import com.yihu.wlyy.entity.statistics.PopulationBase;
|
|
|
import com.yihu.wlyy.repository.address.TownDao;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorAdminTeamDao;
|
|
@ -19,6 +20,7 @@ import io.searchbox.client.JestClient;
|
|
|
import io.searchbox.core.Bulk;
|
|
|
import io.searchbox.core.BulkResult;
|
|
|
import io.searchbox.core.Index;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
@ -2299,4 +2301,60 @@ public class StatisticsESService {
|
|
|
return new JSONArray();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public Map<String,Object> getPrescriptionCount(int level,String area,String disease) throws Exception{
|
|
|
String index ="58";
|
|
|
Map<String,Object> rs = new HashedMap();
|
|
|
//总数
|
|
|
List<SaveModel> totalList = elasticsearchUtil.findListDateQuotaLevel1(null,area,level,index,"2",null,disease);
|
|
|
//进行中
|
|
|
List<SaveModel> processingList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"1");
|
|
|
//已完成
|
|
|
List<SaveModel> finishedList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"2");
|
|
|
//已经取消
|
|
|
List<SaveModel> canceledList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"3");
|
|
|
//审核不通过
|
|
|
List<SaveModel> unPassList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"4");
|
|
|
//其他原因取消
|
|
|
List<SaveModel> otherList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"5");
|
|
|
|
|
|
//总数
|
|
|
if(totalList!=null && totalList.size()>0){
|
|
|
rs.put("total",totalList.get(0).getResult2());
|
|
|
}else{
|
|
|
rs.put("total",0);
|
|
|
}
|
|
|
|
|
|
//进行中
|
|
|
if(processingList!=null && processingList.size()>0){
|
|
|
rs.put("processingCount",processingList.get(0).getResult2());
|
|
|
}else {
|
|
|
rs.put("processingCount", 0);
|
|
|
}
|
|
|
//已完成
|
|
|
if(finishedList!=null && finishedList.size()>0){
|
|
|
rs.put("finishCount",finishedList.get(0).getResult2());
|
|
|
}else {
|
|
|
rs.put("finishCount", 0);
|
|
|
}
|
|
|
//已取消
|
|
|
if(canceledList!=null && canceledList.size()>0){
|
|
|
rs.put("patientCancelCount",canceledList.get(0).getResult2());
|
|
|
}else {
|
|
|
rs.put("patientCancelCount", 0);
|
|
|
}
|
|
|
//审核不通过
|
|
|
if(unPassList!=null && unPassList.size()>0){
|
|
|
rs.put("noReviewedCount",unPassList.get(0).getResult2());
|
|
|
}else {
|
|
|
rs.put("noReviewedCount", 0);
|
|
|
}
|
|
|
//其他原因取消
|
|
|
if(otherList!=null && otherList.size()>0){
|
|
|
rs.put("payOuttimeCount",otherList.get(0).getResult2());
|
|
|
}else {
|
|
|
rs.put("payOuttimeCount", 0);
|
|
|
}
|
|
|
return rs;
|
|
|
}
|
|
|
}
|