Sask Vaccine Guide Code Docs
    Preparing search index...

    Implements iVaccineService, is used to apply logic to external APIs and internal databases/filestorage

    Implements

    Index

    Constructors

    Methods

    • Compares the local productIds with the remote and collects the ids which are no longer existing remotely. These are then returned to be deleted.

      Parameters

      • vaccineList: VaccineInfoJSON[]

        a list of VaccineInfoJSON objects to insert into the vaccine data table.

      Returns Promise<number[]>

      the productIds which exist locally and no longer remotely

    • Deletes the vaccines corresponding to the given product ids from the database. The PDFs related to this id are also removed.

      Parameters

      • idsToRemove: number[]

        a list of product ids of the vaccines to remove.

      Returns Promise<void>

      a table must exist on the VaccineEntity

    • This will take the provided ids and download the related pdf from the saskatchewn publications api

      Parameters

      • productId: number

        the Id of the vaccine being updated, used to build the path, cannot be zero, must exist in the database

      • formatId: number

        the format id, this refers to the id of the english or french PDF, used to build the path cannot be 0

      Returns Promise<string>

      a promise containing a string, this string is the path to the pdf within the mobile device

    • Retrieves the names of the local PDFs of both the english and french versions

      Parameters

      • productId: number

        the vaccine to check, a number greater than 0 and existing in the database

      Returns Promise<default>

      an promise containing an object with the english and french PDF names, both in the form of strings

    • Gets the entire JSON sheet for each product ID from the Government of Saskatchewan publications api

      Returns Promise<Response[]>

      A list of responses in the form of the JSON received. It is much too large to warrant its own type

      !! This is going to be removed, it is not needed and cannot test reliably !!

    • Gets the local version of the Vaccine List. This version number is obtained from the vaccine list JSON endpoint and store in async storage

      If the version number is not present in storage a -1 is returned to ensure that it is always less than the new version

      Returns Promise<number>

      A promise containing the version number. It is type casted as AsyncStorage can only store strings

    • Gets the remote version of the Vaccine List. This version number is obtained from the vaccine list JSON endpoint and store in async storage

      If the version number is not present in storage a -1 is returned to ensure that it is always less than the new version

      Returns Promise<number>

      A promise containing the version number.

    • Gets a list of VaccineSheet object which contain the local vaccine information PDFs and other related info. Retrieves it in either english or french

      Parameters

      • language: "english" | "french"

        must be english or french, this is required

      Returns Promise<VaccineSheet[]>

      A promise containing a list of VaccineSheet objects

    • Takes in a product id and potentially an english and french filename. Filenames that exist are updated in the row linked to the product Id

      Parameters

      • productId: number

        the id of the row to update, a vaccine entry This must be a positive number which already exists in the table.

      • OptionalenglishFilename: string

        the new name of the remote vaccine pdf in english This must be a string.

      • OptionalfrenchFilename: string

        the new name of the remote vaccine pdf in french This must be a string.

      • OptionalenglishFormatId: number
      • OptionalfrenchFormatId: number

      Returns Promise<void>

      A void promise.

    • Builds and runs a query against the vaccine data table returning the filtered rows

      Parameters

      • language: "english" | "french" = "english"

        if a default language is not provided it will use english

      • Optionalinput: string

        if not given it will return all results,

      • OptionalsearchColumn: string

        search by a specific column

      • Optionalorder: {
            ascending: boolean;
            column: "vaccineName" | "associatedDiseases" | "starting";
        }

        if not given the default orfer will be given

      Returns Promise<VaccineQueryResult[]>