FhirStream.js
/**
     * Counts the total number of rows and sets the following properties on the
     * instance:
     *      total    - the total rows
     *      page     - the page number we are currently in
     *      overflow - the number of rewinds
     * @returns {Promise<FhirStream>} Resolves with the instance
     */
Counts the total number of rows and sets the following properties on the
instance:
total    - the total rows
page     - the page number we are currently in
overflow - the number of rewinds
@returns {Promise} Resolves with the instance
Counts the total number of rows and sets the following properties on the instance : total - the total rows page - the page number we are currently in overflow - the number of rewinds @returns { Promise } Resolves with the instance
countRecords()
    {
        let { sql, params } = this.builder.compileCount();
        return this.db.promise("get", sql, params).then(row => {
            this.total = row && row.rowCount ? row.rowCount || 0 : 0;
            this.page = Math.floor(this.offset / this.limit) + 1;
            this.overflow = Math.floor(this.offset/this.total);
            return this;
        });
    }
countRecords ( ) { let { sql , params } = this . builder . compileCount ( ) ; return this . db . promise ( "get" , sql , params ) . then ( row => { this . total = row && row . rowCount ? row . rowCount || 0 : 0 ; this . page = Math . floor ( this . offset / this . limit ) + 1 ; this . overflow = Math . floor ( this . offset / this . total ) ; return this ; } ) ; }
Counts the total number of rows and sets the following properties on the
 instance:
      total    - the total rows
      page     - the page number we are currently in
      overflow - the number of rewinds
 @returns {Promise<FhirStream>} Resolves with the instance
Counts the total number of rows and sets the following properties on the instance : total - the total rows page - the page number we are currently in overflow - the number of rewinds @returns { Promise<FhirStream > } Resolves with the instance
// SELECT "fhir_type", COUNT(*) as "totalRows" FROM "data" // WHERE "fhir_type" IN("Patient") GROUP BY "fhir_type"