@Search public List<IBaseResource> searchById( @RequiredParam(name = "_id") TokenAndListParam theIds) { List<IBaseResource> retVal = new ArrayList<>(); for (TreeMap<Long, T> next : myIdToVersionToResourceMap.values()) { if (next.isEmpty() == false) { T nextResource = next.lastEntry().getValue(); boolean matches = true; if (theIds != null && theIds.getValuesAsQueryTokens().size() > 0) { for (TokenOrListParam nextIdAnd : theIds.getValuesAsQueryTokens()) { matches = false; for (TokenParam nextOr : nextIdAnd.getValuesAsQueryTokens()) { if (nextOr.getValue().equals(nextResource.getIdElement().getIdPart())) { matches = true; } } if (!matches) { break; } } } if (!matches) { continue; } retVal.add(nextResource); } } mySearchCount.incrementAndGet(); return retVal; }
@CoverageIgnore @Override public TokenAndListParam addAnd(TokenOrListParam theValue) { addValue(theValue); return this; }
@Override public List<TokenParam> getPatientIdParam() { if (_id != null) return Collections.singletonList(_id); if (identifiers != null) return identifiers.getValuesAsQueryTokens().stream() .flatMap(tol -> tol.getValuesAsQueryTokens().stream()) .collect(Collectors.toList()); return Collections.emptyList(); } }
@CoverageIgnore @Override public TokenAndListParam addAnd(TokenOrListParam theValue) { addValue(theValue); return this; }
@Override public List<TokenParam> getPatientIdParam() { if (_id != null) return Collections.singletonList(_id); if (identifiers != null) return identifiers.getValuesAsQueryTokens().stream() .flatMap(tol -> tol.getValuesAsQueryTokens().stream()) .collect(Collectors.toList()); return Collections.emptyList(); } }
@Search public List<IBaseResource> searchById( @RequiredParam(name = "_id") TokenAndListParam theIds) { List<IBaseResource> retVal = new ArrayList<>(); for (TreeMap<Long, T> next : myIdToVersionToResourceMap.values()) { if (next.isEmpty() == false) { T nextResource = next.lastEntry().getValue(); boolean matches = true; if (theIds != null && theIds.getValuesAsQueryTokens().size() > 0) { for (TokenOrListParam nextIdAnd : theIds.getValuesAsQueryTokens()) { matches = false; for (TokenParam nextOr : nextIdAnd.getValuesAsQueryTokens()) { if (nextOr.getValue().equals(nextResource.getIdElement().getIdPart())) { matches = true; } } if (!matches) { break; } } } if (!matches) { continue; } retVal.add(nextResource); } } mySearchCount.incrementAndGet(); return retVal; }