{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "2CA496DB-0135-4EE8-80EB-7ED0D3098B00",
    "name": "Vaccination Record Check (Jev)"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": 53.507247724674016,
        "y": 1.6984197253715365,
        "zoom": 0.8658471201476783
      },
      "autoSave": true,
      "descriptions": {
        "flow": "Checks a scanned travel vaccination record with Jev (TypeSafe AI) before a trip. Flags rows to check the reading or the dose, logs a pending review in the Jev review log and asks a nurse in Slack with buttons; the \"Jev review decisions\" flow records the click. The run does not wait.",
        "initialData": "",
        "initialDataFields": {
          "departureDate": "Departure date, YYYY-MM-DD.",
          "imageUrl": "Public URL of the scanned record (PNG or JPEG, 280 to 1568 px per side).",
          "travellerName": "The traveller's name, shown in Slack and the run name."
        }
      }
    },
    "description": "Checks a scanned travel vaccination record with Jev from TypeSafe AI, flags the rows a nurse should review, logs each review in a Google Sheet and asks the nurse in Slack. Rebuilt from TypeSafe's \"Build with Jev\" recipe for reading a scanned vaccination record.",
    "elements": [
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Prepare the in-date check Result"
          },
          "position": {
            "x": 706.2465562621825,
            "y": 256.8544367273708
          }
        },
        "flowElementId": "09EF3D4D-BF49-46E0-945F-20D66A486E94",
        "groupId": null,
        "id": "E677F2E4-8EE1-4E18-BDA6-EC5588237E32",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "rows",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "rows",
                    "subPathSegments": [
                      {
                        "key": "rows",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E5B83D30-F8E2-4D76-80ED-49C0FA791AEB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "read",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "read",
                    "subPathSegments": [
                      {
                        "key": "answers",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "3F8F56C6-ED01-4A6A-B2F4-DBA44C3CB6A7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "departureDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "INITIAL_DATA",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "departureDate",
                        "optional": false
                      }
                    ],
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.initialData",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "initialData",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const MONTHS = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\nconst departure = new Date(departureDate + \"T00:00:00Z\");\nconst depYear = departure.getUTCFullYear();\n\nrows.forEach(row => {\n  const year = read[row.id + \"|year\"];\n  row.year = year.choice;\n  row.year_confidence = year.confidence;\n  row.legible = read[row.id + \"|legible\"].noul;\n});\n\n// other or unreadable leaves the row without a year, so there is nothing to check yet.\nconst yearGiven = row => (row.year === \"other\" || row.year === \"unreadable\") ? null : parseInt(row.year.slice(1), 10);\n// Date arithmetic is a job for code: roughly how long before departure each dose was given.\nconst beforeDeparture = year => { const n = depYear - year; return n === 0 ? \"less than a year\" : \"about \" + n + \" year\" + (n !== 1 ? \"s\" : \"\"); };\n\nconst readable = rows.filter(row => yearGiven(row) !== null);\nconst data = {\n  context: \"Each entry is one line of an adult traveller's vaccination record, as read from a scan. The traveller leaves on \" + departure.getUTCDate() + \" \" + MONTHS[departure.getUTCMonth()] + \" \" + depYear + \". Judge only whether the dose will still protect the traveller on that date, by usual travel-health guidance for adults.\",\n  entries: readable.map(row => ({ id: row.id, vaccine: row.vaccine, year_given: String(yearGiven(row)), given_before_departure: beforeDeparture(yearGiven(row)) }))\n};\n\nconst questions = {};\nreadable.forEach(row => {\n  questions[row.id] = {\n    type: \"noul\",\n    instructions: { question: \"Will this dose still protect the traveller on the departure date?\", entry: row.id },\n    criteria: {\n      \"true\": \"The dose is within the usual protection period for this vaccine on the departure date.\",\n      \"false\": \"The dose is past the usual protection period for this vaccine by the departure date.\"\n    }\n  };\n});\n\nreturn { rows, data, questions };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "dates",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Prepare the in-date check",
        "nextElementIds": [
          "A280A358-7043-4D04-A94E-25BD23E7B821"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Asks Jev several typed questions about the same content in one request (yes/no, choice, score and, in preview, box), written in the TypeSafe API format. Answers come back keyed by the names you choose. Use it to combine questions, or for structured criteria the other actions do not offer.",
          "elementId": "EXTENSION:::SHARED:::default:::jev:::askQuestions",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "model": {
              "jev-1.14.0": "jev-1.14.0"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find vaccines on the record Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::jev:::askQuestions",
          "legacyElementId": null,
          "methodName": "askQuestions",
          "position": {
            "x": 709.3568047766206,
            "y": 119.9419700247874
          }
        },
        "flowElementId": "0EF629F6-768F-4AAB-9560-A4E26CD10193",
        "groupId": null,
        "id": "D253B98F-DC37-48E0-A282-18B23943B97D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "model",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "jev-1.14.0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "questions",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "prep",
                    "subPathSegments": [
                      {
                        "key": "questions",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C22F535F-BF64-4BEA-8D5A-B9BD5BCF0C9E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "text",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "data",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "prep",
                    "subPathSegments": [
                      {
                        "key": "imageUrls",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C22F535F-BF64-4BEA-8D5A-B9BD5BCF0C9E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "longContext",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "askQuestions",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "find",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "jev",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find vaccines on the record",
        "nextElementIds": [
          "E5B83D30-F8E2-4D76-80ED-49C0FA791AEB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Flag rows for the nurse Result"
          },
          "position": {
            "x": 93.19529355911757,
            "y": 256.8544367273708
          }
        },
        "flowElementId": "02DA81BB-EA07-4B04-B31E-0532D0A04E72",
        "groupId": null,
        "id": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "rows",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "dates",
                    "subPathSegments": [
                      {
                        "key": "rows",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E677F2E4-8EE1-4E18-BDA6-EC5588237E32"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "checked",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "check",
                    "subPathSegments": [
                      {
                        "key": "answers",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A280A358-7043-4D04-A94E-25BD23E7B821"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "unlisted",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "rows",
                    "subPathSegments": [
                      {
                        "key": "unlisted",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E5B83D30-F8E2-4D76-80ED-49C0FA791AEB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "INITIAL_DATA",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "imageUrl",
                        "optional": false
                      }
                    ],
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.initialData",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "initialData",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "travellerName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "INITIAL_DATA",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "travellerName",
                        "optional": false
                      }
                    ],
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.initialData",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "initialData",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "departureDate",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "INITIAL_DATA",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "departureDate",
                        "optional": false
                      }
                    ],
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.initialData",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "initialData",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "executionId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_ID",
                    "label": null,
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.executionId",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "executionId",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "// TypeSafe's starting cutoffs. Tune them on records a nurse has already checked.\nconst READ_CUTOFF = 0.90, LEGIBLE_CUTOFF = 0.50, IN_DATE_CUTOFF = 0.50, PRESENT_CUTOFF = 0.5;\n\nconst unresolved = row => row.year === \"other\" || row.year === \"unreadable\";\nconst r2 = x => Math.round(x * 100) / 100;\nconst reasons = row => {\n  const out = [];\n  const reading = Math.min(row.present, row.year_confidence); // the weakest answer about finding and reading the row\n  if (unresolved(row) || reading < READ_CUTOFF || row.legible < LEGIBLE_CUTOFF) out.push(\"Check the reading\");\n  if (row.in_date !== null && row.in_date < IN_DATE_CUTOFF) out.push(\"Check the dose\");\n  return out;\n};\n\nconst table = rows.map(row => {\n  row.in_date = checked && checked[row.id] ? checked[row.id].noul : null;\n  return {\n    position: row.position,\n    vaccine: row.vaccine,\n    year_given: unresolved(row) ? row.year : row.year.slice(1),\n    reading_score: r2(Math.min(row.present, row.year_confidence)),\n    legible: r2(row.legible),\n    in_date: row.in_date === null ? null : r2(row.in_date),\n    flags: reasons(row),\n    box: row.box\n  };\n});\n\nconst pageFlags = unlisted >= PRESENT_CUTOFF ? [\"Check the page: it may record a vaccine outside the list\"] : [];\nconst flagged = table.filter(t => t.flags.length);\nconst needsReview = flagged.length > 0 || pageFlags.length > 0;\n\nconst lines = flagged.map(t => \"• *Row \" + t.position + \", \" + t.vaccine + \"* (year \" + t.year_given + \"): \" + t.flags.join(\", \") + \". Reading \" + t.reading_score + \", legible \" + t.legible + (t.in_date === null ? \"\" : \", in date \" + t.in_date));\npageFlags.forEach(p => lines.push(\"• *Whole page*: \" + p + \" (\" + r2(unlisted) + \")\"));\n\nconst summary = \"Vaccination record for \" + travellerName + \", leaving \" + departureDate + \": \" + (needsReview ? flagged.length + \" of \" + table.length + \" rows need a nurse\" : \"all \" + table.length + \" rows clear\");\n\n// The review lives in the Jev review log; the buttons carry its id. No run waits for the click:\n// the \"Jev review decisions\" flow records it.\nconst reviewId = \"vax-\" + executionId;\nconst slackBlocks = [\n  { type: \"section\", text: { type: \"mrkdwn\", text: \"*Please review a vaccination record*\\n\" + travellerName + \" leaves on \" + departureDate + \". Jev read the scan and flagged:\" } },\n  { type: \"section\", text: { type: \"mrkdwn\", text: lines.join(\"\\n\") || \"Nothing\" } },\n  { type: \"image\", image_url: imageUrl, alt_text: \"The scanned vaccination record\" },\n  { type: \"actions\", block_id: \"jev_review\", elements: [\n    { type: \"button\", action_id: \"jev_vax_confirm\", text: { type: \"plain_text\", text: \"Confirmed\" }, style: \"primary\", value: reviewId },\n    { type: \"button\", action_id: \"jev_vax_followup\", text: { type: \"plain_text\", text: \"Needs follow-up\" }, style: \"danger\", value: reviewId }\n  ] }\n];\n\nconst logRow = {\n  \"Review ID\": reviewId,\n  \"Flow\": \"Vaccination Record Check (Jev)\",\n  \"Run ID\": executionId,\n  \"Created At\": new Date().toISOString(),\n  \"Summary\": summary,\n  \"Payload\": JSON.stringify({ imageUrl, travellerName, departureDate, flagged: flagged.map(t => ({ position: t.position, vaccine: t.vaccine, year_given: t.year_given, reading_score: t.reading_score, legible: t.legible, in_date: t.in_date, flags: t.flags })), pageFlags }),\n  \"Status\": \"pending\",\n  \"Decision\": \"\",\n  \"Decided By\": \"\",\n  \"Decided At\": \"\"\n};\n\nreturn { needsReview, summary, table, flagged, pageFlags, reviewId, logRow, slackBlocks: JSON.stringify(slackBlocks) };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "flags",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Flag rows for the nurse",
        "nextElementIds": [
          "546A778A-271A-4D3E-869D-9C8AE25814AA"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 106.01010183720518,
            "y": 390.8272793929618
          }
        },
        "flowElementId": "F9BB727D-079E-428E-BAF1-3066F46F8422",
        "groupId": null,
        "id": "546A778A-271A-4D3E-869D-9C8AE25814AA",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "80881505-1404-4c31-baca-ba09940aa211",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "flags",
                      "subPathSegments": [
                        {
                          "key": "needsReview",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "80881505-1404-4c31-baca-ba09940aa211"
            ]
          },
          "elseComponent": {
            "componentId": "5DAB3626-9457-400E-A05A-AF951F348037",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "anyFlags",
          "storeResult": false,
          "thenComponent": {
            "componentId": "C7C5DDF2-1529-454E-AD57-316837EA102B",
            "componentType": "ELEMENT"
          }
        },
        "name": "Anything flagged?",
        "nextElementIds": [
          "5DAB3626-9457-400E-A05A-AF951F348037",
          "C7C5DDF2-1529-454E-AD57-316837EA102B"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Asks Jev several typed questions about the same content in one request (yes/no, choice, score and, in preview, box), written in the TypeSafe API format. Answers come back keyed by the names you choose. Use it to combine questions, or for structured criteria the other actions do not offer.",
          "elementId": "EXTENSION:::SHARED:::default:::jev:::askQuestions",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "model": {
              "jev-1.14.0": "jev-1.14.0"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read each year and legibility Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::jev:::askQuestions",
          "legacyElementId": null,
          "methodName": "askQuestions",
          "position": {
            "x": 1044.5329908318506,
            "y": 247.61493033664027
          }
        },
        "flowElementId": "2C687F92-449C-4EA0-971B-8BB6C61CB376",
        "groupId": null,
        "id": "3F8F56C6-ED01-4A6A-B2F4-DBA44C3CB6A7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "model",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "jev-1.14.0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "questions",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "rows",
                    "subPathSegments": [
                      {
                        "key": "questions",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E5B83D30-F8E2-4D76-80ED-49C0FA791AEB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "text",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "data",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "prep",
                    "subPathSegments": [
                      {
                        "key": "imageUrls",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C22F535F-BF64-4BEA-8D5A-B9BD5BCF0C9E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "longContext",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "askQuestions",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "read",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "jev",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read each year and legibility",
        "nextElementIds": [
          "E677F2E4-8EE1-4E18-BDA6-EC5588237E32"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Order rows and ask for each year Result"
          },
          "position": {
            "x": 1025.9434910595571,
            "y": 126.34640895830361
          }
        },
        "flowElementId": "CEADAE71-1121-4370-817A-10CED06E5D18",
        "groupId": null,
        "id": "E5B83D30-F8E2-4D76-80ED-49C0FA791AEB",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "found",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "find",
                    "subPathSegments": [
                      {
                        "key": "answers",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "D253B98F-DC37-48E0-A282-18B23943B97D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "vaccines",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "prep",
                    "subPathSegments": [
                      {
                        "key": "vaccines",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "C22F535F-BF64-4BEA-8D5A-B9BD5BCF0C9E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const PRESENT_CUTOFF = 0.5; // at or above this, the vaccine counts as on the record\n\nconst key = i => \"vac_\" + String(i).padStart(2, \"0\");\nconst present = [];\nvaccines.forEach((vaccine, i) => {\n  const p = found[key(i)].noul;\n  const box = found[key(i) + \"|box\"];\n  if (p >= PRESENT_CUTOFF) present.push({ vaccine, present: p, box: box.box, box_confidence: box.confidence });\n});\n\n// The top edges of the boxes give the page order.\nconst rows = present.sort((a, b) => a.box.top - b.box.top);\nrows.forEach((row, n) => { row.id = \"row-\" + (n + 1); row.position = n + 1; });\n\n// Year options end with other and unreadable, so Jev can say it can't read a date.\nconst YEAR = {};\nfor (let y = 2016; y <= 2026; y++) YEAR[\"y\" + y] = String(y);\nYEAR.other = \"A year before 2016 or after 2026\";\nYEAR.unreadable = \"The year is covered, stained, smudged or damaged and can't be read\";\n\nconst questions = {};\nrows.forEach(row => {\n  const where = \"the DATE GIVEN cell of the \" + row.vaccine + \" row of the vaccines table in the scan in `images`\";\n  questions[row.id + \"|year\"] = { type: \"choice\", criteria: YEAR, instructions: \"Dates on this record are written day/month/year, so the year is the last part. What year is written in \" + where + \"?\" };\n  questions[row.id + \"|legible\"] = { type: \"noul\", instructions: \"Is the date in \" + where + \" fully legible, with nothing covering, staining, smudging or blurring any of it?\" };\n});\n\nconst scores = vaccines.map((vaccine, i) => ({ vaccine, recorded: Math.round(found[key(i)].noul * 100) / 100 }));\nreturn { rows, questions, unlisted: found.unlisted.noul, scores };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "rows",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Order rows and ask for each year",
        "nextElementIds": [
          "3F8F56C6-ED01-4A6A-B2F4-DBA44C3CB6A7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "return-result",
          "isFirstElement": false,
          "blockDefinitionId": "return-result",
          "position": {
            "x": 116.51503351761039,
            "y": 548.9686390245987
          }
        },
        "flowElementId": "84CA191B-BF9A-43DB-8A73-E0A8264268C9",
        "groupId": null,
        "id": "5DAB3626-9457-400E-A05A-AF951F348037",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "contentType": "application/json",
          "data": [
            {
              "id": null,
              "name": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "status"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              },
              "nameType": "DYNAMIC",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "clear"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "id": null,
              "name": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "summary"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              },
              "nameType": "DYNAMIC",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "flags",
                    "subPathSegments": [
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "id": null,
              "name": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "rows"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              },
              "nameType": "DYNAMIC",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "flags",
                    "subPathSegments": [
                      {
                        "key": "table",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "releaseCaller": false,
          "resultAlias": "clear",
          "singleData": null,
          "storeResult": true
        },
        "name": "All clear",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "COMPOSE_RESULT"
      },
      {
        "clientMetadata": {
          "elementId": "execution-name",
          "isFirstElement": true,
          "blockDefinitionId": "execution-name",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default"
          },
          "position": {
            "x": 130.78888937914343,
            "y": 127.6901234023174
          }
        },
        "flowElementId": "C5F9D6A9-08E4-4168-B923-E06719F9FD56",
        "groupId": null,
        "id": "D6484B68-31DA-4FB1-B18D-8416544B3049",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "enabled": true,
          "executionName": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Vaccination check: "
              },
              {
                "id": "INITIAL_DATA",
                "label": null,
                "subPathSegments": [
                  {
                    "key": "travellerName",
                    "optional": false
                  }
                ],
                "type": "EXECUTION_CONTEXT_PATH",
                "value": "executionContext.initialData",
                "valueSegments": [
                  {
                    "key": "executionContext",
                    "optional": false
                  },
                  {
                    "key": "initialData",
                    "optional": false
                  }
                ]
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "runName",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "SET_EXECUTION_NAME",
          "type": "SYSTEM"
        },
        "name": "Name the run",
        "nextElementIds": [
          "C22F535F-BF64-4BEA-8D5A-B9BD5BCF0C9E"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "List the vaccines to look for Result"
          },
          "position": {
            "x": 398.2135874917863,
            "y": 126.8160467135524
          }
        },
        "flowElementId": "9204F711-F6C6-4905-9E2D-BD9E2B9FCD40",
        "groupId": null,
        "id": "C22F535F-BF64-4BEA-8D5A-B9BD5BCF0C9E",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "imageUrl",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "INITIAL_DATA",
                    "label": null,
                    "subPathSegments": [
                      {
                        "key": "imageUrl",
                        "optional": false
                      }
                    ],
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.initialData",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "initialData",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "// The 16 vaccines the clinic gives, as in TypeSafe's cookbook.\nconst VACCINES = [\"Hepatitis A\", \"Hepatitis B\", \"Hepatitis A and B combined\", \"Typhoid\", \"Hepatitis A and typhoid combined\", \"Yellow fever\", \"Rabies\", \"Japanese encephalitis\", \"Tick-borne encephalitis\", \"Cholera\", \"MenACWY\", \"MenB\", \"Tetanus, diphtheria and polio (Td/IPV)\", \"MMR\", \"Varicella\", \"Influenza\"];\n\n// One question about vaccines outside the list, then a yes/no and a box per vaccine.\nconst questions = {\n  unlisted: {\n    type: \"noul\",\n    instructions: {\n      question: \"Does the vaccines table in the scan in `images` record any vaccine that is not in this list?\",\n      list: VACCINES\n    }\n  }\n};\nVACCINES.forEach((vaccine, i) => {\n  const key = \"vac_\" + String(i).padStart(2, \"0\");\n  questions[key] = { type: \"noul\", instructions: \"Is \" + vaccine + \" recorded in the vaccines table in the scan in `images`, with exactly this name?\" };\n  questions[key + \"|box\"] = { type: \"box\", instructions: \"the whole \" + vaccine + \" row of the vaccines table in the scan in `images`\" };\n});\n\nreturn { vaccines: VACCINES, questions, imageUrls: [imageUrl] };"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "prep",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "List the vaccines to look for",
        "nextElementIds": [
          "D253B98F-DC37-48E0-A282-18B23943B97D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Asks Jev several typed questions about the same content in one request (yes/no, choice, score and, in preview, box), written in the TypeSafe API format. Answers come back keyed by the names you choose. Use it to combine questions, or for structured criteria the other actions do not offer.",
          "elementId": "EXTENSION:::SHARED:::default:::jev:::askQuestions",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "model": {
              "jev-1.14.0": "jev-1.14.0"
            }
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check each dose covers the trip Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::jev:::askQuestions",
          "legacyElementId": null,
          "methodName": "askQuestions",
          "position": {
            "x": 371.4249365890381,
            "y": 245.30505373895772
          }
        },
        "flowElementId": "5273DEF9-5562-49B5-8451-D8C0FFFD93C8",
        "groupId": null,
        "id": "A280A358-7043-4D04-A94E-25BD23E7B821",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "model",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "jev-1.14.0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "questions",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "dates",
                    "subPathSegments": [
                      {
                        "key": "questions",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E677F2E4-8EE1-4E18-BDA6-EC5588237E32"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "text",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "data",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "dates",
                    "subPathSegments": [
                      {
                        "key": "data",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "E677F2E4-8EE1-4E18-BDA6-EC5588237E32"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "longContext",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "askQuestions",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "check",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "jev",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Check each dose covers the trip",
        "nextElementIds": [
          "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends a direct message to a user on Slack with optional Block Kit rich layouts. Supports plain text with Slack formatting, or advanced Block Kit JSON for buttons, menus, and interactive elements. Returns the message timestamp and channel ID for later updates or tracking.",
          "elementId": "EXTENSION:::SHARED:::default:::slack:::sendDirectMessage",
          "isFirstElement": false,
          "dynamicOptionLabels": {
            "userId": {}
          },
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask the nurse in Slack Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::slack:::sendDirectMessage",
          "legacyElementId": "JS###v1###Slack###sendDirectMessage",
          "methodName": "sendDirectMessage",
          "position": {
            "x": 511.37950114875593,
            "y": 516.338274718793
          }
        },
        "flowElementId": "1441B5FB-DC54-4B2E-83B4-73F0C0B00286",
        "groupId": null,
        "id": "11085FDA-FECE-4A8D-B1C6-36C509709762",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "userId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "messageText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "flags",
                    "subPathSegments": [
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "threadId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sendAsBot",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "botIcon",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "replyBroadcast",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "imageURL",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "blocks",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "flags",
                    "subPathSegments": [
                      {
                        "key": "slackBlocks",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "sendDirectMessage",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "askNurse",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "slack",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask the nurse in Slack",
        "nextElementIds": [
          "5F0B33BF-D633-4A4A-B815-C7298EAB23D4"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "return-result",
          "isFirstElement": false,
          "blockDefinitionId": "return-result",
          "position": {
            "x": 836.0276501139949,
            "y": 530.1975343048887
          }
        },
        "flowElementId": "D48D7D69-6F96-4BA2-907C-3EB4B3BB7AED",
        "groupId": null,
        "id": "5F0B33BF-D633-4A4A-B815-C7298EAB23D4",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "contentType": "application/json",
          "data": [
            {
              "id": null,
              "name": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "status"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              },
              "nameType": "DYNAMIC",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "sent to the nurse"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "id": null,
              "name": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "reviewId"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              },
              "nameType": "DYNAMIC",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "flags",
                    "subPathSegments": [
                      {
                        "key": "reviewId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "id": null,
              "name": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "summary"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              },
              "nameType": "DYNAMIC",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "flags",
                    "subPathSegments": [
                      {
                        "key": "summary",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "id": null,
              "name": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "rows"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              },
              "nameType": "DYNAMIC",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "flags",
                    "subPathSegments": [
                      {
                        "key": "table",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "releaseCaller": false,
          "resultAlias": "sent",
          "singleData": null,
          "storeResult": true
        },
        "name": "Sent to the nurse",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "COMPOSE_RESULT"
      },
      {
        "clientMetadata": {
          "notes": "Adds new data rows to Google Sheets for AI agents to store processed results, log user interactions, or collect data from automated workflows. Perfect for building databases, tracking metrics, saving form submissions, or creating data collection pipelines.",
          "elementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Log the review as pending Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::google-sheets:::addRow",
          "legacyElementId": "JS###v1###GoogleSheets###addRow",
          "methodName": "addRow",
          "position": {
            "x": 491.8699806410335,
            "y": 383.9828369095355
          }
        },
        "flowElementId": "50DB6A49-7183-48B9-8F1C-D931DE3C9F8B",
        "groupId": null,
        "id": "C7C5DDF2-1529-454E-AD57-316837EA102B",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "documentId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sheetId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 0
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "row",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "flags",
                    "subPathSegments": [
                      {
                        "key": "logRow",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "74735F54-0F4F-48FF-8978-D3DEDB78DEAB"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "connectionId": null,
          "enabled": true,
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "methodName": "addRow",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "logReview",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "google-sheets",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Log the review as pending",
        "nextElementIds": [
          "11085FDA-FECE-4A8D-B1C6-36C509709762"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "D6484B68-31DA-4FB1-B18D-8416544B3049",
    "groups": [],
    "id": "5B97143A-64DC-462D-AD9A-7D9CC693527E",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "The TypeSafe API key Jev runs on, chosen from the workspace's API Keys.",
          "error": null,
          "name": "Jev",
          "type": "API_KEY",
          "value": ""
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": true
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-11-13T02:29:04.761Z"
}
