public List<BaseCodingDt> getListAsCodings() { ArrayList<BaseCodingDt> retVal = new ArrayList<BaseCodingDt>(); for (TokenParam next : getValuesAsQueryTokens()) { InternalCodingDt nextCoding = next.getValueAsCoding(); if (!nextCoding.isEmpty()) { retVal.add(nextCoding); } } return retVal; }
@Search() public List<Observation> searchByObservationNames( @RequiredParam(name=Observation.SP_CODE) TokenOrListParam theCodings ) { // The list here will contain 0..* codings, and any observations which match any of the // given codings should be returned List<TokenParam> wantedCodings = theCodings.getValuesAsQueryTokens(); List<Observation> retVal = new ArrayList<Observation>(); // ...populate... return retVal; } //END SNIPPET: searchMultiple
@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; }
@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(); } }
@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(); } }
public List<BaseCodingDt> getListAsCodings() { ArrayList<BaseCodingDt> retVal = new ArrayList<BaseCodingDt>(); for (TokenParam next : getValuesAsQueryTokens()) { InternalCodingDt nextCoding = next.getValueAsCoding(); if (!nextCoding.isEmpty()) { retVal.add(nextCoding); } } return retVal; }
@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; }