VitalSnap Operations

Cordova ==> VitalSnap module

Read

To use InformVitalSnap to scan a peripheral, the following call is provided,

const result = await ValidicMobile.InformVitalSnap.takeReading(3);

The id parameter is the ID property from the VitalSnap peripheral object. The successCallback is passed an object containing the generated record in the informRecord property. The image which was recognized is also returned in the image property as a base64 encoded string.

The following snippet initiates a InformVitalSnap read. On success the image is displayed and record submitted. On failure the error is displayed.

try {
    const result = await ValidicMobile.InformVitalSnap.takeReading(3);
    info.innerHTML = JSON.stringify(result.informRecord, null, 2);
    if (result.image) {
        image.src = 'data:image/png;base64,' + result.image;
    }
    await ValidicMobile.InformCore.submitInformRecord(result.informRecord, result.image);
} catch (error) {
    console.error(error);
};

Runtime Unit Selection

For any glucose meter in our lineup of supported meters, you can now specify mmol/L or mg/dL at runtime for a given reading. If no unit is provided, mg/dL is assumed.

await ValidicMobile.InformVitalSnap.takeReading(3, ValidicMobile.InformVitalSnap.GlucoseUnit.MMOL_L, success, fail); // Start a OneTouch UltraMini reading with mmol/L units