@ Search public IBundleProvider search ( @ RequiredParam ( name = Patient . SP_FAMILY ) StringParam theFamily ) { final InstantDt searchTime = InstantDt . withCurrentTime ( ) ; /** * First, we'll search the database for a set of database row IDs that * match the given search criteria. That way we can keep just the row IDs * around, and load the actual resources on demand later as the client * pages through them. */ final List < Long > matchingResourceIds = null ; // <-- implement this /** * Return a bundle provider which can page through the IDs and return the * resources that go with them. */ return new IBundleProvider ( ) { @ Override public Integer size ( ) { return matchingResourceIds . size ( ) ; } @ Override public List < IBaseResource > getResources ( int theFromIndex , int theToIndex ) { int end = Math . max ( theToIndex , matchingResourceIds . size ( ) - 1 ) ; List < Long > idsToReturn = matchingResourceIds . subList ( theFromIndex , end ) ; return loadResourcesByIds ( idsToReturn ) ; } @ Override public InstantDt getPublished ( ) { return searchTime ; } @ Override public Integer preferredPageSize ( ) { // Typically this method just returns null return null ; } @ Override public String getUuid ( ) { return null ; } } ; }
Search for Patient resources matching a given family name