Skip to content

Pre-fill scan data

When creating a scan, you can pre-fill patient health data like age, weight, and smoking status. This data is used during the scan to produce more accurate risk assessments — the patient won’t need to enter it themselves.

  1. const { data: patient } =
    await client.v1.core.patients.create({
    name: 'Jane Smith',
    email: 'jane@example.com',
    })
  2. Pass an inputData object when creating the scan. These fields are optional — include whichever you have available:

    const { data: scan } =
    await client.v1.vitals.scans.create({
    vitalsLinkId: 'your-link-id',
    patientId: patient.id,
    inputData: {
    gender: 'female',
    age: 35,
    height: 165,
    weight: 62,
    smokingStatus: 'never',
    activityLevel: 'exercise20to60Mins',
    },
    })
  3. Generate a magic link to authenticate the patient and redirect them to the scan page:

    const alias = process.env.UPVIO_BUSINESS_ALIAS
    const scanUrl =
    `https://scan.upvio.com/${alias}/scans/${scan.id}`
    const { data: magicLink } =
    await client.v1.core.patients.createMagicLink(
    patient.id,
    { redirectUrl: scanUrl },
    )
    console.log(magicLink.url)

    When the patient opens the link, their health data is already attached to the scan — they just need to complete the face scan.