Sask Vaccine Guide Code Docs
    Preparing search index...

    Interface iVaccineDataService

    interface iVaccineDataService {
        compareExternalPDFs(): Promise<VaccinePDFData[]>;
        downloadVaccinePDF(productId: number, formatId: number): Promise<string>;
        getVaccineListRemote(): Promise<VaccineListResponse>;
        getVaccineListVersionLocal(): Promise<number>;
        storeVaccineListLocal(vaccineList: VaccineInfoJSON[]): Promise<void>;
        storeVaccineListVersionLocal(version: number): Promise<void>;
        updateLocalPDFFilenames(
            productId: number,
            englishFilename?: string,
            frenchFilename?: string,
        ): Promise<void>;
        vaccineQuery(
            language: "english" | "french",
            input?: string,
            searchColumn?: string,
            order?: {
                ascending: boolean;
                column: "vaccineName" | "associatedDiseases" | "starting";
            },
        ): Promise<VaccineQueryResult[]>;
    }

    Implemented by

    Index

    Methods

    • Parameters

      • productId: number
      • formatId: number

      Returns Promise<string>

    • Async

      this function is asynchronous 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

    • Async

      this function is asynchronous Stores the remote vaccine list locally, returns a promise

      Parameters

      • vaccineList: VaccineInfoJSON[]

        a list of VaccineInfoJSON objects to insert into the vaccine data table. This will also update and existing row if a row with the productId already exists.

      Returns Promise<void>

      a void promise

    • Async

      this function is asynchronous Stores the version of the Vaccine List. This version number is obtained from the vaccine list JSON endpoint

      Parameters

      • version: number

        a string representing the version number to set

      Returns Promise<void>

    • Async

      this function is asynchronous 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.

      Returns Promise<void>

      A void promise.

    • Queries the database for vaccine sheets

      Parameters

      • language: "english" | "french"

        The language to query for, defaults to "english" if no value is provided

      • Optionalinput: string

        The value to search for.

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

        The sorting order for the results

      Returns Promise<VaccineQueryResult[]>

      A list of responses from the