{
  "elementsLearnedData": [],
  "elementsTestData": [],
  "flow": {
    "id": "25DC779E-EBCD-4B8F-BBBB-91D5CC6E49B7",
    "name": "Zendesk: pharmacy refill fax answered in a ticket"
  },
  "flowVersion": {
    "clientMetadata": {
      "viewport": {
        "x": -4,
        "y": 24,
        "zoom": 0.4
      },
      "autoSave": false,
      "descriptions": {
        "flow": "Holds each pharmacy refill or clarification fax from the Documo line in a Zendesk ticket in the prescriptions group, with the matched Healthie patient, the medication list and visits. When the prescriber solves the ticket with a Fax reply note, faxes that answer back to the pharmacy in the prescriber's name. Controlled substances are marked and never faxed back.",
        "initialData": "",
        "initialDataFields": {}
      }
    },
    "description": "Holds each pharmacy refill or clarification fax from the Documo line in a Zendesk ticket in the prescriptions group, with the matched Healthie patient, the medication list and visits. When the prescriber solves the ticket with a Fax reply note, faxes that answer back to the pharmacy in the prescriber's name. Controlled substances are marked and never faxed back.",
    "elements": [
      {
        "clientMetadata": {
          "notes": "Lists a patient's appointments in Healthie, with every provider: upcoming ones soonest first, or past ones newest first. Narrow them by dates, type, provider or status. The result says whether the patient has an upcoming appointment and which one is next, so a flow can check that a patient has booked.",
          "elementId": "EXTENSION:::SHARED:::default:::healthie:::listAppointments",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the last visit Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::healthie:::listAppointments",
          "legacyElementId": null,
          "methodName": "listAppointments",
          "position": {
            "x": 1329,
            "y": 680
          }
        },
        "flowElementId": "F926B16E-E4B4-4E1F-BBCF-32CC620C082C",
        "groupId": null,
        "id": "C547E0C6-6869-49AD-9B93-99C439FFFF42",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "patientId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": [
                      {
                        "key": "patientId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CF083DAA-91F3-481A-BBC3-0120A602581D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "timeframe",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "past"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fromDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "toDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "appointmentTypeId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "providerId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeCanceled",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortBy",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cursor",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "listAppointments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Last visit",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "healthie",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the last visit",
        "nextElementIds": [
          "6D7AC173-6792-44D4-8FC8-9A4941C01155"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new Zendesk ticket with a first comment. Supports setting priority, type, status, due date (tasks only), requester (by email, the user is created if it does not exist), assignee, group, tags, custom fields, and file attachments on the first comment (by file URL, or by tokens from Upload Attachment). Returns the created ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::createTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ticket: fax with no file Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::createTicket",
          "legacyElementId": "JS###v1###Zendesk###createTicket",
          "methodName": "createTicket",
          "position": {
            "x": 937,
            "y": 170
          }
        },
        "flowElementId": "8E0F97FD-E6AA-4B0D-9562-6F377EE5853F",
        "groupId": null,
        "id": "A4FD7EBA-FBC7-4070-863C-A174FA719D7D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Pharmacy line: fax arrived with no file"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "A fax arrived on the Documo line from caller ID "
                  },
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "faxCallerId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " at "
                  },
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "createdAt",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", but FlowRunner could not get its file ("
                  },
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "fileError",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "), so nobody has read it. Documo message ID: "
                  },
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". Open it in Documo, and if it is a pharmacy request, handle it by hand."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "priority",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "normal"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "task"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueAt",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "requesterEmail",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "requesterName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "assigneeId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "groupId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tags",
              "type": "SIMPLE_LIST",
              "value": [
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "pharmacy_rx"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "rx_unread"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                }
              ]
            },
            {
              "name": "customFields",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "createTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "No file ticket",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ticket: fax with no file",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Lists a patient's appointments in Healthie, with every provider: upcoming ones soonest first, or past ones newest first. Narrow them by dates, type, provider or status. The result says whether the patient has an upcoming appointment and which one is next, so a flow can check that a patient has booked.",
          "elementId": "EXTENSION:::SHARED:::default:::healthie:::listAppointments",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the next visit Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::healthie:::listAppointments",
          "legacyElementId": null,
          "methodName": "listAppointments",
          "position": {
            "x": 943,
            "y": 680
          }
        },
        "flowElementId": "AA5BB4BA-2C0C-4469-82DA-20EF29ADB973",
        "groupId": null,
        "id": "6D7AC173-6792-44D4-8FC8-9A4941C01155",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "patientId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": [
                      {
                        "key": "patientId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CF083DAA-91F3-481A-BBC3-0120A602581D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "timeframe",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "upcoming"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fromDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "toDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "appointmentTypeId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "providerId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "includeCanceled",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "sortBy",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 1
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cursor",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "listAppointments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Next visit",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "healthie",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the next visit",
        "nextElementIds": [
          "696806AB-43C9-4E68-BA91-3F41A503BC92"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Finds a provider or staff member of your Healthie organization by name or NPI and returns their Healthie user ID, name, NPI and email, so a faxed or emailed result that names its ordering provider can be matched to the ID that Record Lab Result's Ordering Provider takes. Healthie searches members by name only, so an NPI is compared with the NPI of each member found, 50 at a time until a page holds it, up to 1,000 members per run (the next cursor goes on from there). A member whose name equals the Name is returned first.",
          "elementId": "EXTENSION:::SHARED:::default:::healthie:::searchProviders",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the prescriber in Healthie Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::healthie:::searchProviders",
          "legacyElementId": null,
          "methodName": "searchProviders",
          "position": {
            "x": 119,
            "y": 340
          }
        },
        "flowElementId": "A5271C61-B7EC-4179-9F66-B3CDBD618165",
        "groupId": null,
        "id": "9CD8D0BC-CD6B-46A9-91E6-1A6F987B6387",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "prescriberName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "npi",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "prescriberNpi",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 25
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cursor",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "searchProviders",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Prescriber search",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "healthie",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the prescriber in Healthie",
        "nextElementIds": [
          "CF083DAA-91F3-481A-BBC3-0120A602581D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Looks for existing patients by first name, last name, date of birth and email, optionally narrowed by phone number, so an incoming referral is matched to the right chart before a new patient is created. Every term you fill in must match. Healthie does not search by phone number itself, so give at least one other term with it.",
          "elementId": "EXTENSION:::SHARED:::default:::healthie:::searchPatients",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Search by last name and birth date Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::healthie:::searchPatients",
          "legacyElementId": null,
          "methodName": "searchPatients",
          "position": {
            "x": 894,
            "y": 340
          }
        },
        "flowElementId": "8E7DF60F-B401-43F9-8393-6B8A6A8F9B96",
        "groupId": null,
        "id": "4BC40E0B-F8F5-4FB3-A77F-D7F8BB403CB8",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "firstName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lastName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "patientLastName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateOfBirth",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "patientDateOfBirth",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "email",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "phoneNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 25
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cursor",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "searchPatients",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "By last name",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "healthie",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Search by last name and birth date",
        "nextElementIds": [
          "8A912F80-F6F1-45A2-BD57-2D2731D97B36"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Fires when Documo finishes receiving a fax. The event carries the fax record (message ID, status, result code, fax number, caller ID, CSID, pages, times) and, for a successful fax, its PDF saved to FlowRunner file storage at workspace scope in \"file\" (URL, name, content type, size). \"file\" is null for a failed fax, or when the PDF could not be fetched, with the reason in \"fileError\"; use Download Fax with the message ID then. Optionally only fires for one receiving number or one outcome.",
          "elementId": "EXTENSION:::SHARED:::default:::documo:::onNewInboundFax",
          "isFirstElement": true,
          "blockDefinitionId": "api-service-trigger",
          "newElementId": "EXTENSION:::SHARED:::default:::documo:::onNewInboundFax",
          "legacyElementId": null,
          "methodName": "onNewInboundFax",
          "position": {
            "x": 152,
            "y": 40
          }
        },
        "flowElementId": "ECC09AA5-F7C9-40D6-ACCF-794F5381002C",
        "groupId": null,
        "id": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7",
        "metaInfo": {
          "callbackUrl": null,
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": null,
          "connectionId": null,
          "eventName": "onNewInboundFax",
          "hostType": "SHARED",
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": null
          },
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Fax",
          "scope": "SINGLE_APP",
          "serviceId": "documo",
          "slaConditions": [],
          "staticData": {},
          "storeResult": true,
          "subtype": "REALTIME",
          "type": "CUSTOM"
        },
        "name": "New fax received",
        "nextElementIds": [
          "FCF5C065-0A9C-47E8-BE6F-E9AB8323B7CC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "TRIGGER"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new Zendesk ticket with a first comment. Supports setting priority, type, status, due date (tasks only), requester (by email, the user is created if it does not exist), assignee, group, tags, custom fields, and file attachments on the first comment (by file URL, or by tokens from Upload Attachment). Returns the created ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::createTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ticket: fax could not be read Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::createTicket",
          "legacyElementId": "JS###v1###Zendesk###createTicket",
          "methodName": "createTicket",
          "position": {
            "x": 1666,
            "y": 40
          }
        },
        "flowElementId": "A6543CF0-8994-461E-82C2-BC5CBDC64026",
        "groupId": null,
        "id": "0AF576E6-EA62-4EB1-9662-0743F7AF5D3F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "Pharmacy line: fax could not be read"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "A fax arrived on the Documo line from caller ID "
                  },
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "faxCallerId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " at "
                  },
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "createdAt",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ", "
                  },
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "pagesCount",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " pages, and FlowRunner could not tell what it is. The fax is attached. Documo message ID: "
                  },
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": ". If it is a pharmacy request, handle it by hand."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "priority",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "normal"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "task"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueAt",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "requesterEmail",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "requesterName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "assigneeId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "groupId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tags",
              "type": "SIMPLE_LIST",
              "value": [
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "pharmacy_rx"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                {
                  "expression": [
                    {
                      "id": "TEXT",
                      "label": null,
                      "type": "INPUT",
                      "value": "rx_unread"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                }
              ]
            },
            {
              "name": "customFields",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE_LIST",
              "value": [
                {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Fax",
                      "subPathSegments": [
                        {
                          "key": "file",
                          "optional": false
                        },
                        {
                          "key": "url",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                }
              ]
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "createTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Unread ticket",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ticket: fax could not be read",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Looks for existing patients by first name, last name, date of birth and email, optionally narrowed by phone number, so an incoming referral is matched to the right chart before a new patient is created. Every term you fill in must match. Healthie does not search by phone number itself, so give at least one other term with it.",
          "elementId": "EXTENSION:::SHARED:::default:::healthie:::searchPatients",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Search by first name and birth date Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::healthie:::searchPatients",
          "legacyElementId": null,
          "methodName": "searchPatients",
          "position": {
            "x": 494,
            "y": 340
          }
        },
        "flowElementId": "CAD9306F-B2B4-480F-B06B-15B04D5364ED",
        "groupId": null,
        "id": "8A912F80-F6F1-45A2-BD57-2D2731D97B36",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "firstName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "patientFirstName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lastName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateOfBirth",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "patientDateOfBirth",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "email",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "phoneNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 25
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cursor",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "searchPatients",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "By first name",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "healthie",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Search by first name and birth date",
        "nextElementIds": [
          "9CD8D0BC-CD6B-46A9-91E6-1A6F987B6387"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "ai-agent",
          "isFirstElement": false,
          "blockDefinitionId": "ai-agent",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the pharmacy request Result"
          },
          "tools": {},
          "position": {
            "x": 918,
            "y": 49
          }
        },
        "flowElementId": "E2D6C425-B807-436A-9194-823FB5C7BE65",
        "groupId": null,
        "id": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65",
        "metaInfo": {
          "aiApiKey": null,
          "aiModel": "claude-sonnet-5",
          "aiProvider": "ANTHROPIC",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "dynamicAiApiKey": {
            "expression": [
              {
                "id": "PLACEHOLDER_DATA",
                "label": "Anthropic key",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_STATIC_DATA",
                "value": "Anthropic key"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "files": [
            {
              "mimeType": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "file",
                        "optional": false
                      },
                      {
                        "key": "contentType",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              },
              "url": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": [
                      {
                        "key": "file",
                        "optional": false
                      },
                      {
                        "key": "url",
                        "optional": false
                      }
                    ],
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": "STRING"
              }
            }
          ],
          "forceParsedOutput": true,
          "langSmithSettings": {
            "enabled": false,
            "apiKey": null,
            "projectName": null,
            "label": "FlowRunner AI-Agent",
            "accountCluster": "US"
          },
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "messagesHistoryEnabled": false,
          "messagesHistoryLimit": 15,
          "onFailElemId": null,
          "resultAlias": "Request",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "systemPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "You read faxes that arrive at a prescribing practice and decide whether a fax is a pharmacy's refill request or a pharmacy's clarification request about a prescription. You copy what the fax says. You never judge whether a refill should be given, never suggest an answer, and never decide whether a drug is a controlled substance. From the attached fax, reply with JSON only, with these fields:\nkind: \"refill\" when a pharmacy asks to refill or renew a prescription; \"clarification\" when a pharmacy asks a question about a prescription, such as the quantity, strength, directions, a substitution, or a drug not covered with an alternative; \"other\" for anything else, such as a referral, a lab result, a prior authorization request, a new prescription or an advertisement; \"unreadable\" when you cannot read enough of the fax to tell\npharmacyName: the pharmacy's name, or empty text\npharmacyPhone: the pharmacy's phone number, or empty text\npharmacyFax: the reply fax number printed on the request, or empty text\npatientFirstName: the patient's first name as written\npatientLastName: the patient's last name as written\npatientDateOfBirth: the patient's date of birth as YYYY-MM-DD, or empty text\ndrug: the drug name as printed\nstrength: the strength as printed, or empty text\nquantity: the quantity as printed, or empty text\ndaysSupply: the days supply as printed, or empty text\ndirections: the directions (sig) as printed, or empty text\nrefillsRequested: the number of refills requested as printed, or empty text\nlastFillDate: the last fill date as YYYY-MM-DD, or empty text\nrxNumber: the pharmacy's prescription number, or empty text\nprescriberName: the prescriber named on the request, first and last name without a title, or empty text\nprescriberNpi: the prescriber's 10-digit NPI, or empty text\nschedulePrinted: the controlled substance schedule exactly as printed on the fax, such as C-II, CIV or Schedule II, or empty text when no schedule is printed. Report only what is printed.\nquestion: for a clarification, the pharmacy's question in its own words; empty text for a refill\noptionsOffered: a list of the options or alternatives the pharmacy offered, each in its own words; an empty list when there are none\nsummary: one plain sentence saying what the pharmacy asks\nNever guess a value that is not on the fax; use empty text."
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "tools": [],
          "type": "AI_AGENT",
          "userPrompt": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "Fax received from caller ID "
              },
              {
                "id": "RESULT",
                "label": "Fax",
                "subPathSegments": [
                  {
                    "key": "faxCallerId",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " at "
              },
              {
                "id": "RESULT",
                "label": "Fax",
                "subPathSegments": [
                  {
                    "key": "createdAt",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": ", "
              },
              {
                "id": "RESULT",
                "label": "Fax",
                "subPathSegments": [
                  {
                    "key": "pagesCount",
                    "optional": false
                  }
                ],
                "type": "TRIGGER_DATA",
                "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
              },
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": " pages. The fax is attached."
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Read the pharmacy request",
        "nextElementIds": [
          "86286E03-9C94-464C-9884-90664F7AEBE1"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "5cbbd863-71f0-4ddb-acf8-3e8e47d010c5": "ENUM_LIST",
            "b1916a09-6542-403e-aabe-4605ccfd33e4": "SIMPLE",
            "2dd27acf-f2a6-42b1-9726-19bc26cc4d86": "SIMPLE"
          },
          "position": {
            "x": 1327,
            "y": 49
          }
        },
        "flowElementId": "65C06BE8-2E9C-4922-88E1-7BB4858EA911",
        "groupId": null,
        "id": "86286E03-9C94-464C-9884-90664F7AEBE1",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Kind",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "5cbbd863-71f0-4ddb-acf8-3e8e47d010c5",
              "label": "Refill or clarification",
              "nextComponents": [
                {
                  "componentId": "F0FCD192-6A92-4B5F-8DBD-4E3A74A6851E",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "ENUM",
              "values": {
                "type": "LIST",
                "value": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "refill"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  },
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "clarification"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            },
            {
              "defaultCase": false,
              "id": "b1916a09-6542-403e-aabe-4605ccfd33e4",
              "label": "Could not be read",
              "nextComponents": [
                {
                  "componentId": "0AF576E6-EA62-4EB1-9662-0743F7AF5D3F",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "unreadable"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "2dd27acf-f2a6-42b1-9726-19bc26cc4d86",
              "label": "Another kind of document",
              "nextComponents": [],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "other"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": true,
              "id": "c3e2f102-43a0-499f-9049-baa9de9e8560",
              "label": "Everything Else",
              "nextComponents": [
                {
                  "componentId": "0AF576E6-EA62-4EB1-9662-0743F7AF5D3F",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "ELEMENT_RESULT",
                "label": "Request",
                "subPathSegments": [
                  {
                    "key": "output",
                    "optional": false
                  },
                  {
                    "key": "kind",
                    "optional": false
                  }
                ],
                "type": "ELEMENT_LINK",
                "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Refill or clarification?",
        "nextElementIds": [
          "F0FCD192-6A92-4B5F-8DBD-4E3A74A6851E",
          "0AF576E6-EA62-4EB1-9662-0743F7AF5D3F"
        ],
        "nextGroupIds": [],
        "type": "VALUE_ROUTER"
      },
      {
        "clientMetadata": {
          "notes": "Searches users by name, email, phone, or other identity. Also supports Zendesk search filters like \"role:agent\" or \"organization:57542\" combined with keywords. Returns up to 100 users per page.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::searchUsers",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the prescriber in Zendesk Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::searchUsers",
          "legacyElementId": "JS###v1###Zendesk###searchUsers",
          "methodName": "searchUsers",
          "position": {
            "x": 510,
            "y": 510
          }
        },
        "flowElementId": "425BC90B-4EBE-4F0B-9F25-C4FF8B9E812F",
        "groupId": null,
        "id": "24D04CEE-0577-49E1-91D3-5405D1473228",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "query",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": [
                      {
                        "key": "zendeskQuery",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CF083DAA-91F3-481A-BBC3-0120A602581D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "perPage",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 100
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "searchUsers",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Zendesk prescriber",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the prescriber in Zendesk",
        "nextElementIds": [
          "682F80C9-9791-4BFB-ADBF-C4C483F606F7"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the ticket Result"
          },
          "position": {
            "x": 544,
            "y": 689
          }
        },
        "flowElementId": "C66EFAA9-E395-47AF-BFF6-4FDC1B167128",
        "groupId": null,
        "id": "696806AB-43C9-4E68-BA91-3F41A503BC92",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "request",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "match",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "CF083DAA-91F3-481A-BBC3-0120A602581D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fax",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "RESULT",
                    "label": "Fax",
                    "subPathSegments": null,
                    "type": "TRIGGER_DATA",
                    "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "agents",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Zendesk prescriber",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "24D04CEE-0577-49E1-91D3-5405D1473228"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "meds",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Medications",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "40B2B829-5873-40AD-B17A-29194A25228A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lastVisit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Last visit",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "C547E0C6-6869-49AD-9B93-99C439FFFF42"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "nextVisit",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Next visit",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "6D7AC173-6792-44D4-8FC8-9A4941C01155"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const esc = (s) => String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\nconst fmt = (d) => { const m = /^(\\d{4})-(\\d{2})-(\\d{2})/.exec(d || ''); return m ? `${m[2]}/${m[3]}/${m[1]}` : (d || 'not given'); };\nconst digits = (s) => String(s || '').replace(/\\D/g, '').replace(/^1(?=\\d{10}$)/, '');\nconst show = (s) => { const d = digits(s); return d.length === 10 ? `(${d.slice(0, 3)}) ${d.slice(3, 6)}-${d.slice(6)}` : ''; };\nconst r = request || {};\nconst m = match || {};\nconst f = fax || {};\nconst chartLink = 'https://secure.gethealthie.com/users/';\nconst isClar = r.kind === 'clarification';\nconst controlled = String(r.schedulePrinted || '').trim();\nconst name = [r.patientFirstName, r.patientLastName].filter(Boolean).join(' ') || 'unknown patient';\nconst drugLine = [r.drug, r.strength].filter(Boolean).join(' ') || 'drug not given';\nconst senderFax = show(f.faxCallerId);\nconst printedFax = show(r.pharmacyFax);\nconst email = String(m.prescriberEmail || '').toLowerCase();\nconst agent = ((agents && agents.users) || []).find((u) => email && String(u.email || '').toLowerCase() === email && u.role !== 'end-user');\nconst assigneeId = agent ? String(agent.id) : '';\nconst medsList = ((meds && meds.medications) || []).map((x) => [x.name, x.dosage, x.directions].filter(Boolean).join(', '));\nconst past = ((lastVisit && lastVisit.appointments) || [])[0];\nconst next = nextVisit && nextVisit.has_upcoming ? nextVisit.next_appointment : null;\nconst visit = (a) => (a ? [fmt(a.date), a.appointment_type && a.appointment_type.name, a.provider && a.provider.full_name && `with ${a.provider.full_name}`].filter(Boolean).join(', ') : 'none on the chart');\nconst subject = `${controlled ? `Controlled substance (${controlled}) ` : ''}${isClar ? 'Pharmacy clarification' : 'Refill request'}: ${name}, born ${fmt(r.patientDateOfBirth)}, ${drugLine}`.slice(0, 150);\nconst opts = (Array.isArray(r.optionsOffered) ? r.optionsOffered : []).filter(Boolean);\nconst paras = [];\nparas.push(`${isClar ? 'Clarification request' : 'Refill request'} from ${r.pharmacyName || 'a pharmacy'}${r.pharmacyPhone ? `, phone ${r.pharmacyPhone}` : ''}. Faxed ${f.createdAt || ''}. The fax is attached.`);\nparas.push([\n  `Patient: ${name}, born ${fmt(r.patientDateOfBirth)}`,\n  `Prescription: ${drugLine}`,\n  `Quantity: ${r.quantity || 'not given'}${r.daysSupply ? `, ${r.daysSupply} days supply` : ''}`,\n  `Directions: ${r.directions || 'not given'}`,\n  `Refills requested: ${r.refillsRequested || 'not given'}`,\n  `Last filled: ${r.lastFillDate ? fmt(r.lastFillDate) : 'not given'}`,\n  r.rxNumber ? `Rx number: ${r.rxNumber}` : '',\n  `Prescriber on the request: ${r.prescriberName || 'not given'}${r.prescriberNpi ? `, NPI ${r.prescriberNpi}` : ''}`,\n].filter(Boolean).join('\\n'));\nparas.push([`The pharmacy asks: ${(isClar && r.question) || r.summary || 'see the fax'}`, ...(opts.length ? ['Options the pharmacy offered:', ...opts.map((o) => `- ${o}`)] : [])].join('\\n'));\nif (controlled) paras.push(`Controlled substance: the request prints schedule ${controlled}. FlowRunner will not fax an answer to this request. Answer through your e-prescribing system, then solve this ticket.`);\nif (m.patientId) {\n  paras.push([\n    `Healthie chart: ${chartLink}${m.patientId}`,\n    'Medications on the chart:',\n    ...(medsList.length ? medsList.map((x) => `- ${x}`) : ['- none listed']),\n    `Last visit: ${visit(past)}`,\n    `Next visit: ${visit(next)}`,\n  ].join('\\n'));\n} else {\n  const cands = m.candidates || [];\n  paras.push([\n    `Chart not matched: ${m.chartReason || 'no exact match'}. Check the patient's chart by hand before you answer.`,\n    ...(cands.length ? ['Charts that may be this patient:', ...cands.map((p) => `- ${p.name}, born ${fmt(p.dob)}, chart ID ${p.id} (${p.reasons.join(', ')}): ${chartLink}${p.id}`)] : ['No chart in Healthie looks like this patient.']),\n  ].join('\\n'));\n}\nif (!m.prescriberFound) paras.push('The prescriber on the request was not found in Healthie. Assign this ticket to the prescriber who should answer.');\nelse if (!assigneeId) paras.push(`${m.prescriberName} has no Zendesk agent with the email ${m.prescriberEmail}. Assign this ticket to the prescriber who should answer.`);\nelse paras.push(`Assigned to ${m.prescriberName}${m.prescriberNpi ? `, NPI ${m.prescriberNpi}` : ''}.`);\nif (!controlled) {\n  paras.push('How to answer: the assigned prescriber adds an internal note that starts with \"Fax reply:\" followed by the answer exactly as the pharmacy should read it, then solves the ticket. FlowRunner faxes that answer to the pharmacy in the prescriber\\'s name. To answer the pharmacy another way, start the note with \"No fax:\" instead.');\n  if (senderFax) paras.push(`The answer goes to ${senderFax}, the number this request came from.${printedFax && printedFax !== senderFax ? ` The request prints a different reply number, ${printedFax}. To use it instead, add a line \"Fax to: ${printedFax}\" to your note.` : ''}`);\n  else paras.push(`This fax came with no caller ID. ${printedFax ? `To fax the answer to ${printedFax}, the number printed on the request, add a line \"Fax to: ${printedFax}\" to your note.` : 'No reply number is printed on it either, so answer the pharmacy another way and start your note with \"No fax:\".'}`);\n}\nconst text = paras.join('\\n\\n');\nconst html = paras.map((p) => `<p>${esc(p).replace(/\\n/g, '<br>').replace(/(https:\\/\\/[^\\s<]+)/g, '<a href=\"$1\">$1</a>')}</p>`).join('');\nconst tags = ['pharmacy_rx', isClar ? 'rx_clarification' : 'rx_refill', controlled && 'controlled_substance', !m.patientId && 'chart_check', !assigneeId && 'prescriber_unassigned'].filter(Boolean);\nreturn { subject, text, html, tags, assigneeId, controlled: controlled ? 'yes' : 'no', senderFax: digits(f.faxCallerId), printedFax: digits(r.pharmacyFax) };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Ticket text",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the ticket",
        "nextElementIds": [
          "998BBFF2-C7D3-4869-95E6-9B842720F60A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Match the patient and prescriber Result"
          },
          "position": {
            "x": 110,
            "y": 519
          }
        },
        "flowElementId": "2720900D-5E56-4D3B-A69D-8D2258DE1028",
        "groupId": null,
        "id": "CF083DAA-91F3-481A-BBC3-0120A602581D",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "request",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "exact",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Exact search",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "F0FCD192-6A92-4B5F-8DBD-4E3A74A6851E"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "byLastName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "By last name",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "4BC40E0B-F8F5-4FB3-A77F-D7F8BB403CB8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "byFirstName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "By first name",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "8A912F80-F6F1-45A2-BD57-2D2731D97B36"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "prescribers",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Prescriber search",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "9CD8D0BC-CD6B-46A9-91E6-1A6F987B6387"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "const norm = (s) => String(s || '').trim().toLowerCase();\nconst digits = (s) => String(s || '').replace(/\\D/g, '');\nconst r = request || {};\nconst dob = String(r.patientDateOfBirth || '').trim();\n// Match on name plus birth date only. A search with an empty birth date returns everyone with the name, so those searches only count when the request has one.\nconst exactList = ((exact && exact.patients) || []).filter((p) => dob && norm(p.first_name) === norm(r.patientFirstName) && norm(p.last_name) === norm(r.patientLastName) && String(p.dob || '') === dob);\nconst found = new Map();\nconst add = (result, why) => {\n  for (const p of (result && result.patients) || []) {\n    if (!p || !p.id) continue;\n    const id = String(p.id);\n    const c = found.get(id) || { id, name: p.full_name || [p.first_name, p.last_name].filter(Boolean).join(' '), dob: p.dob || '', reasons: [] };\n    if (!c.reasons.includes(why)) c.reasons.push(why);\n    found.set(id, c);\n  }\n};\nif (dob) {\n  add({ patients: exactList }, 'same name and birth date');\n  add(byLastName, 'same last name and birth date');\n  add(byFirstName, 'same first name and birth date');\n}\nconst candidates = [...found.values()].sort((a, b) => b.reasons.length - a.reasons.length).slice(0, 5);\nlet chartReason = '';\nif (!dob) chartReason = 'no birth date on the request';\nelse if (exactList.length > 1) chartReason = 'more than one chart has this name and birth date';\nelse if (exactList.length === 0 && candidates.length) chartReason = 'a chart looks like the same patient, but the name or birth date differs';\nelse if (exactList.length === 0) chartReason = 'no chart in Healthie has this name and birth date';\nconst patient = exactList.length === 1 ? exactList[0] : null;\n// The prescriber: the NPI printed on the request, or exactly one provider with the same name.\nconst list = (prescribers && prescribers.providers) || [];\nconst npi = digits(r.prescriberNpi);\nlet prescriber = npi ? list.find((p) => digits(p.npi) === npi) || null : null;\nif (!prescriber && r.prescriberName) {\n  const same = list.filter((p) => norm(p.full_name) === norm(r.prescriberName));\n  if (same.length === 1) prescriber = same[0];\n}\nconst email = prescriber && prescriber.email ? String(prescriber.email) : '';\nreturn {\n  patientId: patient ? String(patient.id) : '',\n  chartReason,\n  candidates,\n  prescriberFound: !!prescriber,\n  prescriberName: prescriber ? (prescriber.full_name || '') : '',\n  prescriberNpi: prescriber ? (prescriber.npi || '') : '',\n  prescriberEmail: email,\n  zendeskQuery: email || 'role:agent',\n};\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Match",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Match the patient and prescriber",
        "nextElementIds": [
          "24D04CEE-0577-49E1-91D3-5405D1473228"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 544,
            "y": 49
          }
        },
        "flowElementId": "3894F2A3-B735-4306-8A70-8CC4CFAB59CD",
        "groupId": null,
        "id": "FCF5C065-0A9C-47E8-BE6F-E9AB8323B7CC",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "4c3db2fd-b761-4e11-9b5d-72f21565dfd2",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Fax",
                      "subPathSegments": [
                        {
                          "key": "file",
                          "optional": false
                        },
                        {
                          "key": "url",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "4c3db2fd-b761-4e11-9b5d-72f21565dfd2"
            ]
          },
          "elseComponent": {
            "componentId": "A4FD7EBA-FBC7-4070-863C-A174FA719D7D",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Has file",
          "storeResult": false,
          "thenComponent": {
            "componentId": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65",
            "componentType": "ELEMENT"
          }
        },
        "name": "Fax has a file?",
        "nextElementIds": [
          "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65",
          "A4FD7EBA-FBC7-4070-863C-A174FA719D7D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 943,
            "y": 519
          }
        },
        "flowElementId": "D0B1E3A6-C071-4436-87C3-5CF51A1C721E",
        "groupId": null,
        "id": "682F80C9-9791-4BFB-ADBF-C4C483F606F7",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "47c98ef2-99ab-470c-8e92-b496f4bdb2ed",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Match",
                      "subPathSegments": [
                        {
                          "key": "patientId",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "CF083DAA-91F3-481A-BBC3-0120A602581D"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "47c98ef2-99ab-470c-8e92-b496f4bdb2ed"
            ]
          },
          "elseComponent": {
            "componentId": "696806AB-43C9-4E68-BA91-3F41A503BC92",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "One chart",
          "storeResult": false,
          "thenComponent": {
            "componentId": "40B2B829-5873-40AD-B17A-29194A25228A",
            "componentType": "ELEMENT"
          }
        },
        "name": "One exact chart?",
        "nextElementIds": [
          "696806AB-43C9-4E68-BA91-3F41A503BC92",
          "40B2B829-5873-40AD-B17A-29194A25228A"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Looks for existing patients by first name, last name, date of birth and email, optionally narrowed by phone number, so an incoming referral is matched to the right chart before a new patient is created. Every term you fill in must match. Healthie does not search by phone number itself, so give at least one other term with it.",
          "elementId": "EXTENSION:::SHARED:::default:::healthie:::searchPatients",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the patient's chart Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::healthie:::searchPatients",
          "legacyElementId": null,
          "methodName": "searchPatients",
          "position": {
            "x": 1319,
            "y": 340
          }
        },
        "flowElementId": "97E3BF14-F279-431D-BB5C-78B23A75176C",
        "groupId": null,
        "id": "F0FCD192-6A92-4B5F-8DBD-4E3A74A6851E",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "firstName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "patientFirstName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "lastName",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "patientLastName",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dateOfBirth",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      },
                      {
                        "key": "patientDateOfBirth",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "email",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "phoneNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 25
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cursor",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "searchPatients",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Exact search",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "healthie",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Find the patient's chart",
        "nextElementIds": [
          "4BC40E0B-F8F5-4FB3-A77F-D7F8BB403CB8"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 145,
            "y": 859
          }
        },
        "flowElementId": "0D9800F4-B3C6-4112-96CD-ECD2AA38A96A",
        "groupId": null,
        "id": "B8769086-B3EE-497B-A266-17164EE3E2EF",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "691feb60-cc3c-4b81-ad64-e7959e08a4c9",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Ticket text",
                      "subPathSegments": [
                        {
                          "key": "controlled",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "696806AB-43C9-4E68-BA91-3F41A503BC92"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "yes"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "691feb60-cc3c-4b81-ad64-e7959e08a4c9"
            ]
          },
          "elseComponent": {
            "componentId": "238D7B7B-EACD-4725-94D7-347B8447FF2F",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Is controlled",
          "storeResult": false,
          "thenComponent": null
        },
        "name": "Controlled substance?",
        "nextElementIds": [
          "238D7B7B-EACD-4725-94D7-347B8447FF2F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Lists the medications on a patient's Healthie chart: name, dosage, directions, frequency, route, dates and whether each is active.",
          "elementId": "EXTENSION:::SHARED:::default:::healthie:::listMedications",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the medication list Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::healthie:::listMedications",
          "legacyElementId": null,
          "methodName": "listMedications",
          "position": {
            "x": 1316,
            "y": 510
          }
        },
        "flowElementId": "EF4B5052-A44A-4297-9BFC-5CF25D2725EC",
        "groupId": null,
        "id": "40B2B829-5873-40AD-B17A-29194A25228A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "patientId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": [
                      {
                        "key": "patientId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CF083DAA-91F3-481A-BBC3-0120A602581D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "activeOnly",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_TRUE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": true
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 50
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cursor",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "listMedications",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Medications",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "healthie",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the medication list",
        "nextElementIds": [
          "C547E0C6-6869-49AD-9B93-99C439FFFF42"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Creates a new Zendesk ticket with a first comment. Supports setting priority, type, status, due date (tasks only), requester (by email, the user is created if it does not exist), assignee, group, tags, custom fields, and file attachments on the first comment (by file URL, or by tokens from Upload Attachment). Returns the created ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::createTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Open the prescriptions ticket Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::createTicket",
          "legacyElementId": "JS###v1###Zendesk###createTicket",
          "methodName": "createTicket",
          "position": {
            "x": 123,
            "y": 680
          }
        },
        "flowElementId": "C539637A-3A29-4203-89EC-EB154F1FA30C",
        "groupId": null,
        "id": "998BBFF2-C7D3-4869-95E6-9B842720F60A",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "subject",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "696806AB-43C9-4E68-BA91-3F41A503BC92"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "696806AB-43C9-4E68-BA91-3F41A503BC92"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "html",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "696806AB-43C9-4E68-BA91-3F41A503BC92"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "priority",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "normal"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "type",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "task"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "dueAt",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "requesterEmail",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "requesterName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "assigneeId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "assigneeId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "696806AB-43C9-4E68-BA91-3F41A503BC92"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "groupId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "tags",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": [
                      {
                        "key": "tags",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "696806AB-43C9-4E68-BA91-3F41A503BC92"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customFields",
              "type": "COMPLEX_LIST",
              "value": []
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE_LIST",
              "value": [
                {
                  "expression": [
                    {
                      "id": "RESULT",
                      "label": "Fax",
                      "subPathSegments": [
                        {
                          "key": "file",
                          "optional": false
                        },
                        {
                          "key": "url",
                          "optional": false
                        }
                      ],
                      "type": "TRIGGER_DATA",
                      "value": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                }
              ]
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "createTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Ticket",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Open the prescriptions ticket",
        "nextElementIds": [
          "B8769086-B3EE-497B-A266-17164EE3E2EF"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "break-repeat",
          "isFirstElement": false,
          "blockDefinitionId": "break-repeat",
          "position": {
            "x": 110,
            "y": 939
          }
        },
        "flowElementId": "60D0739D-F6CF-4A27-89D4-E6C949E34D70",
        "groupId": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "id": "C1073327-F6B1-49E6-8D35-7014549DB1CC",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "brk",
          "storeResult": true
        },
        "name": "Stop waiting",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "BREAK"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 710,
            "y": 769
          }
        },
        "flowElementId": "A0EA1A71-AC46-4A33-A1EE-914E8DC1D2CF",
        "groupId": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "id": "41AE15D2-D581-481E-80E9-6840A0F42D0D",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "6ffb3d36-46bd-4559-aff8-69edd87cb943",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Ticket now",
                      "subPathSegments": [
                        {
                          "key": "status",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "3CFB5B92-F9A4-4327-AC0C-DB75FAB631B8"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "solved"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              },
              {
                "id": "619191db-92d5-4fd9-868f-d46cfaf3ad47",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Ticket now",
                      "subPathSegments": [
                        {
                          "key": "status",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "3CFB5B92-F9A4-4327-AC0C-DB75FAB631B8"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "closed"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "6ffb3d36-46bd-4559-aff8-69edd87cb943",
              "OR",
              "619191db-92d5-4fd9-868f-d46cfaf3ad47"
            ]
          },
          "elseComponent": null,
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Is solved",
          "storeResult": false,
          "thenComponent": {
            "componentId": "C11B1344-6E4D-4244-998A-27C088B67CC6",
            "componentType": "ELEMENT"
          }
        },
        "name": "Ticket solved?",
        "nextElementIds": [
          "C11B1344-6E4D-4244-998A-27C088B67CC6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a comment (public reply or private internal note) to an existing ticket, optionally with file attachments (by file URL, or by tokens from Upload Attachment) and a new ticket status in the same update. Returns the updated ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Ask for the answer Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "legacyElementId": "JS###v1###Zendesk###addCommentToTicket",
          "methodName": "addCommentToTicket",
          "position": {
            "x": 410,
            "y": 1060
          }
        },
        "flowElementId": "88B8B83C-C530-40F0-9712-61914EB72073",
        "groupId": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "id": "B353F9D0-E322-4D2D-9353-2708AD9F16F7",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Answer",
                    "subPathSegments": [
                      {
                        "key": "reason",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6609048-D640-4F30-9620-19E44F239343"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "open"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "addCommentToTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Reopened ticket",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Ask for the answer",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 710,
            "y": 939
          }
        },
        "flowElementId": "1923FECA-84E6-4BB0-8E8F-1ACF6AF57C52",
        "groupId": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "id": "9FDCF4D2-2B59-456D-964B-5460807B0337",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "8fcdd14b-7041-4bb5-a90d-4de80e39bbd0",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Answer",
                      "subPathSegments": [
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "A6609048-D640-4F30-9620-19E44F239343"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "8fcdd14b-7041-4bb5-a90d-4de80e39bbd0"
            ]
          },
          "elseComponent": {
            "componentId": "B353F9D0-E322-4D2D-9353-2708AD9F16F7",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Has answer",
          "storeResult": false,
          "thenComponent": {
            "componentId": "8F104483-4D8F-4FC4-94BD-EB49F58773AB",
            "componentType": "ELEMENT"
          }
        },
        "name": "Answer found?",
        "nextElementIds": [
          "B353F9D0-E322-4D2D-9353-2708AD9F16F7",
          "8F104483-4D8F-4FC4-94BD-EB49F58773AB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Lists all comments on a ticket in chronological order, including each comment's author, plain-text and HTML bodies, public/private flag, and attachments.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::listTicketComments",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the ticket notes Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::listTicketComments",
          "legacyElementId": "JS###v1###Zendesk###listTicketComments",
          "methodName": "listTicketComments",
          "position": {
            "x": 1035,
            "y": 760
          }
        },
        "flowElementId": "911166AA-61AE-4921-8238-282EB93FFF1A",
        "groupId": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "id": "C11B1344-6E4D-4244-998A-27C088B67CC6",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "perPage",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 100
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "page",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "listTicketComments",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Ticket notes",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Read the ticket notes",
        "nextElementIds": [
          "A6609048-D640-4F30-9620-19E44F239343"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single Zendesk ticket by ID, including subject, description, status, priority, requester, assignee, group, tags, and custom fields.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::getTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check the ticket Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::getTicket",
          "legacyElementId": "JS###v1###Zendesk###getTicket",
          "methodName": "getTicket",
          "position": {
            "x": 410,
            "y": 760
          }
        },
        "flowElementId": "D6808211-06D3-429E-B8F0-EEED27E02B8F",
        "groupId": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "id": "3CFB5B92-F9A4-4327-AC0C-DB75FAB631B8",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "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": "getTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Ticket now",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Check the ticket",
        "nextElementIds": [
          "41AE15D2-D581-481E-80E9-6840A0F42D0D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Find the prescriber's answer Result"
          },
          "position": {
            "x": 1010,
            "y": 939
          }
        },
        "flowElementId": "D1D69439-435C-4665-B4C0-447C267B521D",
        "groupId": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "id": "A6609048-D640-4F30-9620-19E44F239343",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "comments",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket notes",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "C11B1344-6E4D-4244-998A-27C088B67CC6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "now",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket now",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "3CFB5B92-F9A4-4327-AC0C-DB75FAB631B8"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "ticketText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "696806AB-43C9-4E68-BA91-3F41A503BC92"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "// The answer is the assigned prescriber's latest note that starts with \"Fax reply:\" or \"No fax:\". The first comment is the flow's own ticket text.\nconst digits = (s) => String(s || '').replace(/\\D/g, '').replace(/^1(?=\\d{10}$)/, '');\nconst t = ticketText || {};\nconst assignee = now && now.assignee_id ? String(now.assignee_id) : '';\nconst list = ((comments && comments.comments) || []).slice(1);\nconst marked = list.filter((c) => /^(fax reply|no fax)\\s*:/i.test(String(c.body || '').trim()));\nconst mine = marked.filter((c) => assignee && String(c.author_id) === assignee);\nconst last = mine[mine.length - 1];\nconst wait = ' FlowRunner is still waiting.';\nif (!assignee) return { decision: '', reason: 'This ticket was solved with no prescriber assigned, so nothing was faxed. Assign the prescriber, have them add an internal note that starts with \"Fax reply:\" or \"No fax:\", then solve the ticket again.' + wait };\nif (!last) return { decision: '', reason: (marked.length ? 'This ticket was solved, but the \"Fax reply:\" note is not from the assigned prescriber, so nothing was faxed. The assigned prescriber adds their own note that starts with \"Fax reply:\" or \"No fax:\", then solves the ticket again.' : 'This ticket was solved, but no internal note starts with \"Fax reply:\" or \"No fax:\", so nothing was faxed. The assigned prescriber adds one, then solves the ticket again.') + wait };\nconst body = String(last.body || '').trim();\nif (/^no fax\\s*:/i.test(body)) return { decision: 'nofax', answer: '', faxTo: '', authorId: assignee, reason: '' };\nconst lines = body.replace(/^fax reply\\s*:\\s*/i, '').split(/\\r?\\n/);\nconst faxLine = lines.find((l) => /^\\s*fax to\\s*:/i.test(l));\nconst answer = lines.filter((l) => l !== faxLine).join('\\n').trim();\nif (!answer) return { decision: '', reason: 'The \"Fax reply:\" note has no answer after it, so nothing was faxed. Add the answer to the note, then solve the ticket again.' + wait };\nconst sender = digits(t.senderFax);\nconst printed = digits(t.printedFax);\nlet to = sender.length === 10 ? sender : '';\nif (faxLine) {\n  const asked = digits(faxLine.split(':').slice(1).join(':'));\n  if (asked && (asked === sender || asked === printed)) to = asked;\n  else return { decision: '', reason: 'The \"Fax to:\" line names a number that is neither the one this request came from nor the one printed on it, so nothing was faxed. Correct it, then solve the ticket again.' + wait };\n}\nif (to.length !== 10) return { decision: '', reason: 'There is no number to fax the answer to, because the request came with no caller ID. Add a \"Fax to:\" line with the number printed on the request, or start the note with \"No fax:\" and answer the pharmacy another way, then solve the ticket again.' + wait };\nreturn { decision: 'fax', answer, faxTo: '+1' + to, authorId: assignee, reason: '' };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Answer",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Find the prescriber's answer",
        "nextElementIds": [
          "9FDCF4D2-2B59-456D-964B-5460807B0337"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "decision": "07d486ce-c06f-42a8-b34e-343783342a9b",
            "answer": "5f69fe62-9e0f-4ee4-b9c8-a7f3dda0af21",
            "faxTo": "3bc7f76c-2ae1-4d91-a28d-eff651870084",
            "answeredBy": "c0c1f5bb-8951-4c64-9075-c11c2ba9063c"
          },
          "position": {
            "x": 943,
            "y": 859
          }
        },
        "flowElementId": "77528339-94F1-4675-95E8-C616E0588635",
        "groupId": null,
        "id": "7E8767A2-E579-4724-B1A0-7CB7D417D72F",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "decision",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "waiting"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answer",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EMPTY_STRING",
                    "label": null,
                    "type": "KEYWORD",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "faxTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EMPTY_STRING",
                    "label": null,
                    "type": "KEYWORD",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answeredBy",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EMPTY_STRING",
                    "label": null,
                    "type": "KEYWORD",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "startw",
          "storeResult": true
        },
        "name": "Start waiting",
        "nextElementIds": [],
        "nextGroupIds": [
          "A1DAEA59-03C9-449F-9392-627FD910A244"
        ],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "decision": "2cd7f5f8-c08d-4559-994a-32820569163d",
            "answer": "01636a38-e47b-48fd-85a5-ca627934e4d8",
            "faxTo": "8636492b-55ad-46cb-81ac-e37c2e93b239",
            "answeredBy": "8682a5b4-b6fc-4eae-b480-a2d7dcdfdc91"
          },
          "position": {
            "x": 410,
            "y": 939
          }
        },
        "flowElementId": "83DE02E8-4734-45EC-AFD3-00411AF0E5B8",
        "groupId": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "id": "8F104483-4D8F-4FC4-94BD-EB49F58773AB",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "decision",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Answer",
                    "subPathSegments": [
                      {
                        "key": "decision",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6609048-D640-4F30-9620-19E44F239343"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answer",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Answer",
                    "subPathSegments": [
                      {
                        "key": "answer",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6609048-D640-4F30-9620-19E44F239343"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "faxTo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Answer",
                    "subPathSegments": [
                      {
                        "key": "faxTo",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6609048-D640-4F30-9620-19E44F239343"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answeredBy",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Answer",
                    "subPathSegments": [
                      {
                        "key": "authorId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "A6609048-D640-4F30-9620-19E44F239343"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "keep",
          "storeResult": true
        },
        "name": "Keep the answer",
        "nextElementIds": [
          "C1073327-F6B1-49E6-8D35-7014549DB1CC"
        ],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "wait",
          "isFirstElement": true,
          "blockDefinitionId": "wait",
          "mode": "SIMPLE",
          "position": {
            "x": 110,
            "y": 769
          }
        },
        "flowElementId": "71A98BA0-9EAC-4CE3-9121-7EE66ACCF070",
        "groupId": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "id": "D0C49EE2-6A65-433A-8FB0-281BDDC8461F",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "delay": {
            "expression": [
              {
                "id": "NUMBER",
                "label": null,
                "type": "INPUT",
                "value": 900
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": "DOUBLE"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "w15",
          "storeResult": true
        },
        "name": "Wait 15 minutes",
        "nextElementIds": [
          "3CFB5B92-F9A4-4327-AC0C-DB75FAB631B8"
        ],
        "nextGroupIds": [],
        "type": "WAIT"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Write the fax Result"
          },
          "position": {
            "x": 152,
            "y": 1289
          }
        },
        "flowElementId": "0109AFF8-E3EA-4B20-93F3-7590586D8469",
        "groupId": null,
        "id": "CD88291B-A6EC-4524-B240-B606BAC1EAC0",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "user",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Answerer",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "AA5971D9-0B2E-45F0-9D6D-A2EB8753BC60"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "providers",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Answerer in Healthie",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "3EF7C9C8-4294-4A7B-A12C-50779496EE8C"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "request",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Request",
                    "subPathSegments": [
                      {
                        "key": "output",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "DB6423AC-070F-4B24-B0D0-4BBCF4E45E65"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answer",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - answer",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.answer",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "answer",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "answeredBy",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - answeredBy",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.answeredBy",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "answeredBy",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "ticketText",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket text",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "696806AB-43C9-4E68-BA91-3F41A503BC92"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "match",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Match",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "CF083DAA-91F3-481A-BBC3-0120A602581D"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "// The fax carries only the prescriber's own answer, as written, in their name.\n// The request's prescriber must have been identified in Healthie, and the person who answered must be that prescriber: a Healthie member with an NPI, assigned this ticket.\nconst norm = (s) => String(s || '').trim().toLowerCase();\nconst fmt = (d) => { const m = /^(\\d{4})-(\\d{2})-(\\d{2})/.exec(d || ''); return m ? `${m[2]}/${m[3]}/${m[1]}` : (d || 'not given'); };\nconst u = user || {};\nconst r = request || {};\nconst t = ticketText || {};\nconst mt = match || {};\nconst p = ((providers && providers.providers) || []).find((x) => u.email && norm(x.email) === norm(u.email));\nconst who0 = u.name || 'The person who answered';\nlet why = '';\nif (!mt.prescriberFound) why = 'the prescriber on this request could not be identified in Healthie';\nelse if (!p) why = `${who0} is not a member of your Healthie account with the email ${u.email || 'on their Zendesk profile'}`;\nelse if (!String(p.npi || '').trim()) why = `${p.full_name || who0} has no NPI in Healthie, so FlowRunner does not treat them as a prescriber`;\nelse if (t.assigneeId && String(answeredBy) !== String(t.assigneeId)) why = `the answer came from ${who0}, not the prescriber FlowRunner assigned this ticket to`;\nelse if (!t.assigneeId && (!mt.prescriberEmail || norm(u.email) !== norm(mt.prescriberEmail))) why = `the answer came from ${who0}, not ${mt.prescriberName}, the prescriber named on the request`;\nif (why) return { text: '', prescriber: u.name || '', note: `Nothing was faxed: ${why}. Have the prescriber answer, or answer the pharmacy by hand.` };\nconst who = [p.full_name || u.name, p.qualifications].filter(Boolean).join(', ');\nconst patient = [r.patientFirstName, r.patientLastName].filter(Boolean).join(' ');\nconst text = [\n  `To: ${r.pharmacyName || 'the pharmacy'}`,\n  `Re: your ${r.kind === 'clarification' ? 'clarification' : 'refill'} request${r.rxNumber ? ` for Rx ${r.rxNumber}` : ''}`,\n  `Patient: ${patient}, date of birth ${fmt(r.patientDateOfBirth)}`,\n  `Medication: ${[r.drug, r.strength].filter(Boolean).join(' ')}${r.quantity ? `, quantity ${r.quantity}` : ''}`,\n  '',\n  `Answer from ${who}, NPI ${p.npi}:`,\n  '',\n  String(answer || ''),\n].join('\\n');\nreturn { text, prescriber: p.full_name || u.name || '', note: '' };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Fax text",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Write the fax",
        "nextElementIds": [
          "D8DA6E50-D7D7-488C-A1FD-C8A3028E1DBB"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 146,
            "y": 1589
          }
        },
        "flowElementId": "A971ABCE-6ED4-46A3-8E34-8236774795C6",
        "groupId": null,
        "id": "D8DA6E50-D7D7-488C-A1FD-C8A3028E1DBB",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "060b8ae7-11cc-42eb-bf5a-e132159377ea",
                "nestedOperation": null,
                "operation": "isNotEmpty",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Fax text",
                      "subPathSegments": [
                        {
                          "key": "text",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "CD88291B-A6EC-4524-B240-B606BAC1EAC0"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": []
              }
            ],
            "grouping": [
              "060b8ae7-11cc-42eb-bf5a-e132159377ea"
            ]
          },
          "elseComponent": {
            "componentId": "D374A804-D151-45F0-9B68-3C976702167D",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Is prescriber",
          "storeResult": false,
          "thenComponent": {
            "componentId": "9AAC3915-9D5E-49FE-B77B-0853E4BCE930",
            "componentType": "ELEMENT"
          }
        },
        "name": "Prescriber confirmed?",
        "nextElementIds": [
          "9AAC3915-9D5E-49FE-B77B-0853E4BCE930",
          "D374A804-D151-45F0-9B68-3C976702167D"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a comment (public reply or private internal note) to an existing ticket, optionally with file attachments (by file URL, or by tokens from Upload Attachment) and a new ticket status in the same update. Returns the updated ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Reopen: fax not delivered Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "legacyElementId": "JS###v1###Zendesk###addCommentToTicket",
          "methodName": "addCommentToTicket",
          "position": {
            "x": 544,
            "y": 1880
          }
        },
        "flowElementId": "6A2F4190-49DD-4B82-B6A5-0B93F02B6F54",
        "groupId": null,
        "id": "FD2B033F-EB98-4204-869F-9554C7A30A7C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "The fax of "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Fax text",
                    "subPathSegments": [
                      {
                        "key": "prescriber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CD88291B-A6EC-4524-B240-B606BAC1EAC0"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "'s answer to "
                  },
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - faxTo",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.faxTo",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "faxTo",
                        "optional": false
                      }
                    ]
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " failed (Documo: "
                  },
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - faxInfo",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.faxInfo",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "faxInfo",
                        "optional": false
                      }
                    ]
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "). Check it in Documo and resend it, or call the pharmacy."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "open"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "addCommentToTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Fail note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Reopen: fax failed",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Sends one or more files as a fax to a fax number, with an optional cover page. Files are given as URLs (for example FlowRunner file URLs from an earlier step); each is downloaded and faxed in the order listed. Text written in the step (Text Page) is faxed as pages of its own, before the files, with no length limit beyond Documo's file limits. Returns the new fax record with its message ID and status (\"processing\" until delivery finishes; use Get Fax or the fax history to follow it).",
          "elementId": "EXTENSION:::SHARED:::default:::documo:::sendFax",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Fax the answer to the pharmacy Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::documo:::sendFax",
          "legacyElementId": null,
          "methodName": "sendFax",
          "position": {
            "x": 505,
            "y": 1580
          }
        },
        "flowElementId": "B73AAFD5-2081-4FA1-A99B-3D9CFA1AA182",
        "groupId": null,
        "id": "9AAC3915-9D5E-49FE-B77B-0853E4BCE930",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "faxNumber",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - faxTo",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.faxTo",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "faxTo",
                        "optional": false
                      }
                    ]
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "fileUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "text",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Fax text",
                    "subPathSegments": [
                      {
                        "key": "text",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CD88291B-A6EC-4524-B240-B606BAC1EAC0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "coverPage",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "coverPageId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "recipientName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "senderName",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "subject",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "notes",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "callerId",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "scheduledDate",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "optimizeFax",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "customFields",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "sendFax",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Sent fax",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "documo",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Fax the answer to the pharmacy",
        "nextElementIds": [
          "B54FCAC1-C2D0-42A1-8B6A-3D5E0F081CDC"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Retrieves a single Zendesk user by ID, including name, email, role, phone, organization, and tags.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::getUser",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Who answered Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::getUser",
          "legacyElementId": "JS###v1###Zendesk###getUser",
          "methodName": "getUser",
          "position": {
            "x": 943,
            "y": 1280
          }
        },
        "flowElementId": "61314CCD-93BE-4848-A955-22C1052B5362",
        "groupId": null,
        "id": "AA5971D9-0B2E-45F0-9D6D-A2EB8753BC60",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "userId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - answeredBy",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.answeredBy",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "answeredBy",
                        "optional": false
                      }
                    ]
                  }
                ],
                "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": "getUser",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Answerer",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Who answered",
        "nextElementIds": [
          "3EF7C9C8-4294-4A7B-A12C-50779496EE8C"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Finds a provider or staff member of your Healthie organization by name or NPI and returns their Healthie user ID, name, NPI and email, so a faxed or emailed result that names its ordering provider can be matched to the ID that Record Lab Result's Ordering Provider takes. Healthie searches members by name only, so an NPI is compared with the NPI of each member found, 50 at a time until a page holds it, up to 1,000 members per run (the next cursor goes on from there). A member whose name equals the Name is returned first.",
          "elementId": "EXTENSION:::SHARED:::default:::healthie:::searchProviders",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Confirm the prescriber in Healthie Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::healthie:::searchProviders",
          "legacyElementId": null,
          "methodName": "searchProviders",
          "position": {
            "x": 499,
            "y": 1280
          }
        },
        "flowElementId": "0CBF150F-8245-4629-AD93-C358B02C1156",
        "groupId": null,
        "id": "3EF7C9C8-4294-4A7B-A12C-50779496EE8C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "name",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Answerer",
                    "subPathSegments": [
                      {
                        "key": "name",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "AA5971D9-0B2E-45F0-9D6D-A2EB8753BC60"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "npi",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "pageSize",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "NUMBER",
                    "label": null,
                    "type": "INPUT",
                    "value": 25
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "cursor",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "searchProviders",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Answerer in Healthie",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "healthie",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Confirm the prescriber in Healthie",
        "nextElementIds": [
          "CD88291B-A6EC-4524-B240-B606BAC1EAC0"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a comment (public reply or private internal note) to an existing ticket, optionally with file attachments (by file URL, or by tokens from Upload Attachment) and a new ticket status in the same update. Returns the updated ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note no fax was asked for Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "legacyElementId": "JS###v1###Zendesk###addCommentToTicket",
          "methodName": "addCommentToTicket",
          "position": {
            "x": 924,
            "y": 1410
          }
        },
        "flowElementId": "C92CBE7D-7681-4258-9AC9-C09B60D60648",
        "groupId": null,
        "id": "5A3874A9-4577-4AFC-8F2F-D9E87E9D0437",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "The prescriber's note starts with \"No fax:\", so FlowRunner sent nothing to the pharmacy."
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "addCommentToTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "No fax note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note no fax was asked for",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a comment (public reply or private internal note) to an existing ticket, optionally with file attachments (by file URL, or by tokens from Upload Attachment) and a new ticket status in the same update. Returns the updated ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note the wait ran out Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "legacyElementId": "JS###v1###Zendesk###addCommentToTicket",
          "methodName": "addCommentToTicket",
          "position": {
            "x": 941,
            "y": 1150
          }
        },
        "flowElementId": "6D773899-96C5-4A3E-BFE6-A1E0D56F63F2",
        "groupId": null,
        "id": "335E6974-02F1-400A-8D89-15CFD5DF552C",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "FlowRunner stopped waiting for the prescriber's answer after 7 days and faxed nothing. If the pharmacy still needs an answer, send it by hand."
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "open"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "addCommentToTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Timeout note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note the wait ran out",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a comment (public reply or private internal note) to an existing ticket, optionally with file attachments (by file URL, or by tokens from Upload Attachment) and a new ticket status in the same update. Returns the updated ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note the fax was sent Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "legacyElementId": "JS###v1###Zendesk###addCommentToTicket",
          "methodName": "addCommentToTicket",
          "position": {
            "x": 938,
            "y": 1580
          }
        },
        "flowElementId": "65E1D12E-86A6-4CEB-BDE6-11F1818FF788",
        "groupId": null,
        "id": "B54FCAC1-C2D0-42A1-8B6A-3D5E0F081CDC",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "FlowRunner faxed "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Fax text",
                    "subPathSegments": [
                      {
                        "key": "prescriber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CD88291B-A6EC-4524-B240-B606BAC1EAC0"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "'s answer to "
                  },
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - faxTo",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.faxTo",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "faxTo",
                        "optional": false
                      }
                    ]
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " through Documo (message ID "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sent fax",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AAC3915-9D5E-49FE-B77B-0853E4BCE930"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "). It checks delivery every 5 minutes for up to 30 minutes."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "addCommentToTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Sent note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note the fax was sent",
        "nextElementIds": [
          "2FC1AAD4-5639-47CD-ABBD-1152372282A9"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a comment (public reply or private internal note) to an existing ticket, optionally with file attachments (by file URL, or by tokens from Upload Attachment) and a new ticket status in the same update. Returns the updated ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note nothing was faxed Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "legacyElementId": "JS###v1###Zendesk###addCommentToTicket",
          "methodName": "addCommentToTicket",
          "position": {
            "x": 533,
            "y": 1710
          }
        },
        "flowElementId": "933D9F25-E12E-4809-8086-151AB07A4561",
        "groupId": null,
        "id": "D374A804-D151-45F0-9B68-3C976702167D",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Fax text",
                    "subPathSegments": [
                      {
                        "key": "note",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CD88291B-A6EC-4524-B240-B606BAC1EAC0"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "open"
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "addCommentToTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Not faxed note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note nothing was faxed",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "6db0be8b-b3ff-436d-a182-74ada15bd72f": "SIMPLE",
            "ade0be1d-fee8-4ae9-8442-65768a85d42d": "SIMPLE",
            "9eaa3970-96af-4081-b4e8-87f357821cd4": "SIMPLE"
          },
          "position": {
            "x": 1326,
            "y": 1289
          }
        },
        "flowElementId": "EC7372CB-96AF-496F-80E4-076D464150A0",
        "groupId": null,
        "id": "FFA6998C-22FE-43C0-8C7B-5E96386880C9",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Decision",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "6db0be8b-b3ff-436d-a182-74ada15bd72f",
              "label": "Fax reply",
              "nextComponents": [
                {
                  "componentId": "AA5971D9-0B2E-45F0-9D6D-A2EB8753BC60",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "fax"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "ade0be1d-fee8-4ae9-8442-65768a85d42d",
              "label": "No fax",
              "nextComponents": [
                {
                  "componentId": "5A3874A9-4577-4AFC-8F2F-D9E87E9D0437",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "nofax"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "9eaa3970-96af-4081-b4e8-87f357821cd4",
              "label": "No answer in 7 days",
              "nextComponents": [
                {
                  "componentId": "335E6974-02F1-400A-8D89-15CFD5DF552C",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "waiting"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": true,
              "id": "3d70f921-98ee-4e9c-964e-9493dcecbc3e",
              "label": "Everything Else",
              "nextComponents": [],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                "label": "Default - decision",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_PATH",
                "value": "executionContext.dataBuckets.Default.decision",
                "valueSegments": [
                  {
                    "key": "executionContext",
                    "optional": false
                  },
                  {
                    "key": "dataBuckets",
                    "optional": false
                  },
                  {
                    "key": "Default",
                    "optional": false
                  },
                  {
                    "key": "decision",
                    "optional": false
                  }
                ]
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Prescriber's answer?",
        "nextElementIds": [
          "AA5971D9-0B2E-45F0-9D6D-A2EB8753BC60",
          "5A3874A9-4577-4AFC-8F2F-D9E87E9D0437",
          "335E6974-02F1-400A-8D89-15CFD5DF552C"
        ],
        "nextGroupIds": [],
        "type": "VALUE_ROUTER"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "faxState": "502f9cfb-4aea-42e9-8b59-47a6d3feacbc",
            "faxInfo": "ec5ff0e2-6239-4391-b4fe-8cdabafbeb8d"
          },
          "position": {
            "x": 1323,
            "y": 1589
          }
        },
        "flowElementId": "484EE6EA-E923-4395-9E25-33C947B3C4CD",
        "groupId": null,
        "id": "2FC1AAD4-5639-47CD-ABBD-1152372282A9",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "faxState",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "processing"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "faxInfo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "EMPTY_STRING",
                    "label": null,
                    "type": "KEYWORD",
                    "value": ""
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "startf",
          "storeResult": true
        },
        "name": "Start checking the fax",
        "nextElementIds": [],
        "nextGroupIds": [
          "E5E11F2E-4883-4672-B799-E7F0E51F82F7"
        ],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "elementId": "router",
          "isFirstElement": false,
          "blockDefinitionId": "router",
          "casesViewMode": {
            "c26b3b5a-ad7b-4b36-b6c6-f269f155dff8": "SIMPLE",
            "12914abf-73d3-448b-bae5-ab7a8ca8a5c0": "SIMPLE",
            "2272dbe8-6382-4e2b-a6f5-60850f5096d8": "SIMPLE"
          },
          "position": {
            "x": 943,
            "y": 1889
          }
        },
        "flowElementId": "868B4B3D-8078-43E1-AFC2-25EB3A332D4D",
        "groupId": null,
        "id": "41320CCB-CE53-4AB5-ACA4-3A46F4131041",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Fax outcome",
          "storeResult": true,
          "switchCases": [
            {
              "defaultCase": false,
              "id": "c26b3b5a-ad7b-4b36-b6c6-f269f155dff8",
              "label": "Failed",
              "nextComponents": [
                {
                  "componentId": "FD2B033F-EB98-4204-869F-9554C7A30A7C",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "failed"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "12914abf-73d3-448b-bae5-ab7a8ca8a5c0",
              "label": "Still sending after 30 minutes",
              "nextComponents": [
                {
                  "componentId": "A443DC05-F21E-43AF-A615-6A5D12C219F9",
                  "componentType": "ELEMENT"
                }
              ],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "processing"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": false,
              "id": "2272dbe8-6382-4e2b-a6f5-60850f5096d8",
              "label": "Delivered",
              "nextComponents": [],
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "delivered"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "defaultCase": true,
              "id": "9bd6b399-ed5b-4a0c-963f-1c6c4be85d06",
              "label": "Everything Else",
              "nextComponents": [],
              "type": "SIMPLE",
              "value": null
            }
          ],
          "switchExpression": {
            "expression": [
              {
                "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                "label": "Default - faxState",
                "subPathSegments": null,
                "type": "EXECUTION_CONTEXT_PATH",
                "value": "executionContext.dataBuckets.Default.faxState",
                "valueSegments": [
                  {
                    "key": "executionContext",
                    "optional": false
                  },
                  {
                    "key": "dataBuckets",
                    "optional": false
                  },
                  {
                    "key": "Default",
                    "optional": false
                  },
                  {
                    "key": "faxState",
                    "optional": false
                  }
                ]
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          }
        },
        "name": "Fax result?",
        "nextElementIds": [
          "FD2B033F-EB98-4204-869F-9554C7A30A7C",
          "A443DC05-F21E-43AF-A615-6A5D12C219F9"
        ],
        "nextGroupIds": [],
        "type": "VALUE_ROUTER"
      },
      {
        "clientMetadata": {
          "elementId": "custom-cloud-code",
          "isFirstElement": false,
          "blockDefinitionId": "custom-cloud-code",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Read the fax result Result"
          },
          "position": {
            "x": 710,
            "y": 1039
          }
        },
        "flowElementId": "CEB1DBF2-E401-4704-8019-F0D9023BCDFF",
        "groupId": "E5E11F2E-4883-4672-B799-E7F0E51F82F7",
        "id": "2BC630B9-6DFF-4527-AA21-59971D8EBAB6",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "codeArguments": [
            {
              "name": "fax",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Fax status",
                    "subPathSegments": null,
                    "type": "ELEMENT_LINK",
                    "value": "66A8F504-2F27-4E92-9B69-55C2DDC0B25F"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "codeBody": {
            "expression": [
              {
                "id": "TEXT",
                "label": null,
                "type": "INPUT",
                "value": "// Documo's result code 0 means delivered, once the fax is no longer processing.\nconst f = fax || {};\nconst status = String(f.status || '').toLowerCase();\nconst code = f.resultCode == null ? '' : String(f.resultCode).trim();\nconst info = [f.status, f.resultCode != null ? `result code ${f.resultCode}` : '', f.resultInfo].filter(Boolean).join(', ');\nconst stillGoing = !status || ['processing', 'queued', 'pending', 'sending', 'in_progress', 'inprogress'].includes(status) || (!f.resolvedDate && !code);\nif (stillGoing) return { state: 'processing', info };\nif (code === '0') return { state: 'delivered', info };\nreturn { state: 'failed', info };\n"
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": null
          },
          "enabled": true,
          "logging": {
            "input": {
              "logData": false,
              "message": null
            },
            "output": {
              "logData": false,
              "message": null
            }
          },
          "onFailElemId": null,
          "resultAlias": "Fax result",
          "retryPolicy": null,
          "saveToVariable": null,
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "type": "CUSTOM_CLOUD_CODE"
        },
        "name": "Read the fax result",
        "nextElementIds": [
          "2C3B88F1-B9AC-4D30-9425-8AECE0120725"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "wait",
          "isFirstElement": true,
          "blockDefinitionId": "wait",
          "mode": "SIMPLE",
          "position": {
            "x": 110,
            "y": 1039
          }
        },
        "flowElementId": "F259033C-6AA5-4D7D-B7A7-538957CF7E2E",
        "groupId": "E5E11F2E-4883-4672-B799-E7F0E51F82F7",
        "id": "A2B707CE-EBC6-4255-8782-CB9973C01F92",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "delay": {
            "expression": [
              {
                "id": "NUMBER",
                "label": null,
                "type": "INPUT",
                "value": 300
              }
            ],
            "mode": "EXPRESSION",
            "parseJsonString": false,
            "resultType": "DOUBLE"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "w5",
          "storeResult": true
        },
        "name": "Wait 5 minutes",
        "nextElementIds": [
          "66A8F504-2F27-4E92-9B69-55C2DDC0B25F"
        ],
        "nextGroupIds": [],
        "type": "WAIT"
      },
      {
        "clientMetadata": {
          "notes": "Adds a comment (public reply or private internal note) to an existing ticket, optionally with file attachments (by file URL, or by tokens from Upload Attachment) and a new ticket status in the same update. Returns the updated ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note the fax is still sending Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "legacyElementId": "JS###v1###Zendesk###addCommentToTicket",
          "methodName": "addCommentToTicket",
          "position": {
            "x": 522,
            "y": 2010
          }
        },
        "flowElementId": "06437BBA-F5F7-4F23-82A3-D0E620D8216D",
        "groupId": null,
        "id": "A443DC05-F21E-43AF-A615-6A5D12C219F9",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "The fax of "
                  },
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Fax text",
                    "subPathSegments": [
                      {
                        "key": "prescriber",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "CD88291B-A6EC-4524-B240-B606BAC1EAC0"
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "'s answer to "
                  },
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - faxTo",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.faxTo",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "faxTo",
                        "optional": false
                      }
                    ]
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": " was still sending after 30 minutes (Documo: "
                  },
                  {
                    "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                    "label": "Default - faxInfo",
                    "subPathSegments": null,
                    "type": "EXECUTION_CONTEXT_PATH",
                    "value": "executionContext.dataBuckets.Default.faxInfo",
                    "valueSegments": [
                      {
                        "key": "executionContext",
                        "optional": false
                      },
                      {
                        "key": "dataBuckets",
                        "optional": false
                      },
                      {
                        "key": "Default",
                        "optional": false
                      },
                      {
                        "key": "faxInfo",
                        "optional": false
                      }
                    ]
                  },
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "). Check it in Documo before resending, so the pharmacy does not get the answer twice."
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "addCommentToTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Sending note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note the fax is still sending",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "data-bucket",
          "isFirstElement": false,
          "blockDefinitionId": "data-bucket",
          "fieldKeys": {
            "faxState": "81fd8a7b-401b-470f-80b5-b3e76ee08bf2",
            "faxInfo": "928be0e8-c69d-4d01-bb20-cb50b013029a"
          },
          "position": {
            "x": 1010,
            "y": 1039
          }
        },
        "flowElementId": "6F059ED4-E799-44EA-A771-C11678D2A776",
        "groupId": "E5E11F2E-4883-4672-B799-E7F0E51F82F7",
        "id": "2C3B88F1-B9AC-4D30-9425-8AECE0120725",
        "metaInfo": {
          "bucketName": "Default",
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "fields": [
            {
              "name": "faxState",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Fax result",
                    "subPathSegments": [
                      {
                        "key": "state",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2BC630B9-6DFF-4527-AA21-59971D8EBAB6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "faxInfo",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Fax result",
                    "subPathSegments": [
                      {
                        "key": "info",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "2BC630B9-6DFF-4527-AA21-59971D8EBAB6"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            }
          ],
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "fkeep",
          "storeResult": true
        },
        "name": "Keep the fax result",
        "nextElementIds": [],
        "nextGroupIds": [],
        "type": "DATA_BUCKET"
      },
      {
        "clientMetadata": {
          "notes": "Gets a sent or received fax: its status, result code (0 means delivered), pages, numbers, timing, tags and users.",
          "elementId": "EXTENSION:::SHARED:::default:::documo:::getFax",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Check the fax Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::documo:::getFax",
          "legacyElementId": null,
          "methodName": "getFax",
          "position": {
            "x": 410,
            "y": 1030
          }
        },
        "flowElementId": "A0640E4D-CEA3-47BF-9A47-B6ACE1336AD3",
        "groupId": "E5E11F2E-4883-4672-B799-E7F0E51F82F7",
        "id": "66A8F504-2F27-4E92-9B69-55C2DDC0B25F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "messageId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Sent fax",
                    "subPathSegments": [
                      {
                        "key": "messageId",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "9AAC3915-9D5E-49FE-B77B-0853E4BCE930"
                  }
                ],
                "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": "getFax",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "Fax status",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "documo",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Check the fax",
        "nextElementIds": [
          "2BC630B9-6DFF-4527-AA21-59971D8EBAB6"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      },
      {
        "clientMetadata": {
          "elementId": "condition",
          "isFirstElement": false,
          "blockDefinitionId": "condition",
          "position": {
            "x": 541,
            "y": 859
          }
        },
        "flowElementId": "6C4E10D8-F614-4E87-AF3C-61AAF6332B2D",
        "groupId": null,
        "id": "238D7B7B-EACD-4725-94D7-347B8447FF2F",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "cf9092ed-eaed-4718-ac4c-a0ee73314af6",
                "nestedOperation": null,
                "operation": "isTrue",
                "property": {
                  "expression": [
                    {
                      "id": "ELEMENT_RESULT",
                      "label": "Match",
                      "subPathSegments": [
                        {
                          "key": "prescriberFound",
                          "optional": false
                        }
                      ],
                      "type": "ELEMENT_LINK",
                      "value": "CF083DAA-91F3-481A-BBC3-0120A602581D"
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "BOOLEAN",
                "values": []
              }
            ],
            "grouping": [
              "cf9092ed-eaed-4718-ac4c-a0ee73314af6"
            ]
          },
          "elseComponent": {
            "componentId": "D465C8B6-BA47-4553-A748-68410474D12F",
            "componentType": "ELEMENT"
          },
          "logging": null,
          "onFailElemId": null,
          "resultAlias": "Prescriber identified",
          "storeResult": false,
          "thenComponent": {
            "componentId": "7E8767A2-E579-4724-B1A0-7CB7D417D72F",
            "componentType": "ELEMENT"
          }
        },
        "name": "Prescriber identified?",
        "nextElementIds": [
          "7E8767A2-E579-4724-B1A0-7CB7D417D72F",
          "D465C8B6-BA47-4553-A748-68410474D12F"
        ],
        "nextGroupIds": [],
        "serverFields": {
          "preferredDateFormats": []
        },
        "type": "CONDITION"
      },
      {
        "clientMetadata": {
          "notes": "Adds a comment (public reply or private internal note) to an existing ticket, optionally with file attachments (by file URL, or by tokens from Upload Attachment) and a new ticket status in the same update. Returns the updated ticket.",
          "elementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "isFirstElement": false,
          "blockDefinitionId": "api-service-method",
          "setResultToVariable": false,
          "saveToVariable": {
            "dataBucket": "Default",
            "variable": "Note the prescriber is unknown Result"
          },
          "newElementId": "EXTENSION:::SHARED:::default:::zendesk:::addCommentToTicket",
          "legacyElementId": "JS###v1###Zendesk###addCommentToTicket",
          "methodName": "addCommentToTicket",
          "position": {
            "x": 906,
            "y": 980
          }
        },
        "flowElementId": "5A14D550-40F5-46A9-94C1-E489B725DDF5",
        "groupId": null,
        "id": "D465C8B6-BA47-4553-A748-68410474D12F",
        "metaInfo": {
          "bodyParams": [
            {
              "name": "ticketId",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "ELEMENT_RESULT",
                    "label": "Ticket",
                    "subPathSegments": [
                      {
                        "key": "id",
                        "optional": false
                      }
                    ],
                    "type": "ELEMENT_LINK",
                    "value": "998BBFF2-C7D3-4869-95E6-9B842720F60A"
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "commentBody",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "TEXT",
                    "label": null,
                    "type": "INPUT",
                    "value": "FlowRunner could not identify the prescriber on this request in Healthie (no matching NPI, or more than one provider with that name). It will not fax any answer from this ticket. Answer the pharmacy yourselves."
                  }
                ],
                "mode": "BASIC",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "htmlBody",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "publicComment",
              "type": "SIMPLE",
              "value": {
                "expression": [
                  {
                    "id": "K_FALSE",
                    "label": null,
                    "type": "KEYWORD",
                    "value": false
                  }
                ],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "status",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "attachmentUrls",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "mode": "EXPRESSION",
                "parseJsonString": false,
                "resultType": null
              }
            },
            {
              "name": "uploadTokens",
              "type": "SIMPLE",
              "value": {
                "expression": [],
                "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": "addCommentToTicket",
          "onFailElemId": null,
          "packageId": "default",
          "resultAlias": "No prescriber note",
          "retryPolicy": null,
          "saveToVariable": null,
          "serviceId": "zendesk",
          "simulationResult": null,
          "slaConditions": [],
          "storeResult": true,
          "subtype": "API_SERVICE",
          "type": "EXTENSION"
        },
        "name": "Note the prescriber is unknown",
        "nextElementIds": [],
        "nextGroupIds": [],
        "serverFields": {
          "learningStatus": "OFF"
        },
        "type": "ACTION"
      }
    ],
    "firstElementId": "2FC637B0-8748-4BF2-A95F-A39E2B94F2D7",
    "groups": [
      {
        "clientMetadata": {
          "elementId": "repeat",
          "isFirstElement": false,
          "blockDefinitionId": "repeat",
          "viewport": {
            "x": -70,
            "y": -720,
            "zoom": 1
          },
          "position": {
            "x": 1302,
            "y": 859
          }
        },
        "flowElementId": "70ED7D82-8480-4A6E-9A59-A9F3E92CFB3D",
        "groupId": null,
        "id": "A1DAEA59-03C9-449F-9392-627FD910A244",
        "loopType": "REPEAT",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "8df4f923-8df9-49ef-b97c-f7f1cc5ae26c",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                      "label": "Default - decision",
                      "subPathSegments": null,
                      "type": "EXECUTION_CONTEXT_PATH",
                      "value": "executionContext.dataBuckets.Default.decision",
                      "valueSegments": [
                        {
                          "key": "executionContext",
                          "optional": false
                        },
                        {
                          "key": "dataBuckets",
                          "optional": false
                        },
                        {
                          "key": "Default",
                          "optional": false
                        },
                        {
                          "key": "decision",
                          "optional": false
                        }
                      ]
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "waiting"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "8df4f923-8df9-49ef-b97c-f7f1cc5ae26c"
            ]
          },
          "enabled": true,
          "firstElementId": "D0C49EE2-6A65-433A-8FB0-281BDDC8461F",
          "maxIterations": 672,
          "onFailElemId": null,
          "resultAlias": "loop",
          "storeResult": true
        },
        "name": "Until the prescriber answers",
        "nextElementIds": [
          "FFA6998C-22FE-43C0-8C7B-5E96386880C9"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      },
      {
        "clientMetadata": {
          "elementId": "repeat",
          "isFirstElement": false,
          "blockDefinitionId": "repeat",
          "viewport": {
            "x": -70,
            "y": -990,
            "zoom": 1
          },
          "position": {
            "x": 1291,
            "y": 1889
          }
        },
        "flowElementId": "D3E96484-B4E7-40A9-B00E-D455D0109B11",
        "groupId": null,
        "id": "E5E11F2E-4883-4672-B799-E7F0E51F82F7",
        "loopType": "REPEAT",
        "metaInfo": {
          "clientValidationState": {
            "errorMessage": null,
            "valid": true
          },
          "condition": {
            "conditionParts": [
              {
                "id": "fc3ef6e7-161c-4838-9548-fa825d68df11",
                "nestedOperation": null,
                "operation": "equal",
                "property": {
                  "expression": [
                    {
                      "id": "EXECUTION_CONTEXT_DATA_BUCKET_VARIABLE",
                      "label": "Default - faxState",
                      "subPathSegments": null,
                      "type": "EXECUTION_CONTEXT_PATH",
                      "value": "executionContext.dataBuckets.Default.faxState",
                      "valueSegments": [
                        {
                          "key": "executionContext",
                          "optional": false
                        },
                        {
                          "key": "dataBuckets",
                          "optional": false
                        },
                        {
                          "key": "Default",
                          "optional": false
                        },
                        {
                          "key": "faxState",
                          "optional": false
                        }
                      ]
                    }
                  ],
                  "mode": "EXPRESSION",
                  "parseJsonString": false,
                  "resultType": null
                },
                "propertyType": "STRING",
                "values": [
                  {
                    "expression": [
                      {
                        "id": "TEXT",
                        "label": null,
                        "type": "INPUT",
                        "value": "processing"
                      }
                    ],
                    "mode": "EXPRESSION",
                    "parseJsonString": false,
                    "resultType": null
                  }
                ]
              }
            ],
            "grouping": [
              "fc3ef6e7-161c-4838-9548-fa825d68df11"
            ]
          },
          "enabled": true,
          "firstElementId": "A2B707CE-EBC6-4255-8782-CB9973C01F92",
          "maxIterations": 6,
          "onFailElemId": null,
          "resultAlias": "floop",
          "storeResult": true
        },
        "name": "Until the fax is delivered or fails",
        "nextElementIds": [
          "41320CCB-CE53-4AB5-ACA4-3A46F4131041"
        ],
        "nextGroupIds": [],
        "type": "LOOP"
      }
    ],
    "id": "459E83C4-1877-4669-9B97-3CBCE4B8BEC7",
    "metaInfo": {
      "clientValidationState": {
        "errorMessage": null,
        "valid": true
      },
      "errorMessage": null,
      "executionStaticData": [
        {
          "description": "Your Anthropic API key, used to read the faxes.",
          "error": null,
          "name": "Anthropic key",
          "type": "API_KEY",
          "value": null
        }
      ],
      "initialData": null,
      "initialDataDefaultValues": {},
      "ownerFlowVersionId": null,
      "schedule": null,
      "sharedMemory": {
        "anchor": {
          "missingAnchorPolicy": null,
          "path": null,
          "type": "FLOW_MEMORY"
        },
        "expirationInSec": null
      },
      "wasLive": false
    }
  },
  "slaCalendars": [],
  "slaGoals": [],
  "subFlows": [],
  "exportDate": "2026-12-03T04:11:44.935Z"
}
