Class FetchResourcePayloadsDAO


  • public class FetchResourcePayloadsDAO
    extends Object
    DAO to fetch resource ids using a time range and optional current resource id as a filter. Useful for scanning the database for new resources since a given timestamp (for example in export scenarios).
    • Constructor Detail

      • FetchResourcePayloadsDAO

        public FetchResourcePayloadsDAO​(com.ibm.fhir.database.utils.api.IDatabaseTranslator translator,
                                        String schemaName,
                                        String resourceType,
                                        Instant fromLastUpdated,
                                        Instant toLastUpdated,
                                        Function<com.ibm.fhir.persistence.ResourcePayload,​Boolean> processor)
    • Method Detail

      • run

        public com.ibm.fhir.persistence.ResourcePayload run​(Connection c)
                                                     throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Run the query, feeding each result row to the consumer
        Parameters:
        c -
        Returns:
        the last record processed
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • count

        public int count​(Connection c)
                  throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Get a count of the resources matching the filter predicates...for debugging...slows things down a lot
        Parameters:
        c -
        Returns:
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException