{
  "version": "1.0.0",
  "exportedAt": "2026-06-10T03:53:28.504Z",
  "workflow": {
    "name": "HIMSS - Agentic Intake & EVBV",
    "description": "Patient Intake Agentic approach and then Stedi integration for Eligibility and Benefits verification"
  },
  "flow": {
    "tab": {
      "id": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
      "type": "tab",
      "label": "HIMSS - Agentic Intake & EVBV",
      "disabled": false,
      "info": "Patient Intake Agentic approach and then Stedi integration for Eligibility and Benefits verification"
    },
    "nodes": [
      {
        "id": "1fe9fa535a0fde9f",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "style": {
          "stroke": "#999999",
          "stroke-opacity": "1",
          "fill": "none",
          "fill-opacity": "1",
          "label": true,
          "label-position": "nw",
          "color": "#a4a4a4"
        },
        "nodes": [
          "295b8e73e2576b3f",
          "8cf0cc5afed2f1ff",
          "8624b4f53c54179c",
          "ccd260164c564b23",
          "9f1934b6338a6320"
        ],
        "x": 28,
        "y": 39,
        "w": 2064,
        "h": 548
      },
      {
        "id": "9e64427b4b761edf",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "style": {
          "stroke": "#999999",
          "stroke-opacity": "1",
          "fill": "none",
          "fill-opacity": "1",
          "label": true,
          "label-position": "nw",
          "color": "#a4a4a4"
        },
        "nodes": [
          "a9533d08ad6224d3",
          "f6441d4ab06d70b9",
          "a510816749698b5f",
          "7bb05fae61a5e046"
        ],
        "x": 38,
        "y": 673,
        "w": 1894,
        "h": 594
      },
      {
        "id": "8cf0cc5afed2f1ff",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "1fe9fa535a0fde9f",
        "name": "",
        "style": {
          "label": true,
          "stroke": "#addb7b",
          "fill": "#e3f3d3",
          "color": "#000000"
        },
        "nodes": [
          "d1cee3dcb3792398",
          "96948dd94215f919",
          "34a89e0b41653e90",
          "d20ec7cf4258c19c",
          "821e153d9f64d9ec",
          "7d82ffe2241ee368",
          "88943ef749290f17"
        ],
        "x": 54,
        "y": 119,
        "w": 1102,
        "h": 202
      },
      {
        "id": "8624b4f53c54179c",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "1fe9fa535a0fde9f",
        "name": "Stedi Realtime EVBV Check",
        "style": {
          "stroke": "#9363b7",
          "fill": "#dbcbe7",
          "label": true,
          "color": "#6f2fa0"
        },
        "nodes": [
          "493414af912fe182",
          "9a550901f4c6e0cc",
          "0b1ca7e67f0cb0d9"
        ],
        "x": 1214,
        "y": 139,
        "w": 732,
        "h": 142
      },
      {
        "id": "ccd260164c564b23",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "1fe9fa535a0fde9f",
        "name": "Mapping and Write Back ",
        "style": {
          "label": true,
          "stroke": "#3f93cf",
          "fill": "#bfdbef",
          "color": "#0070c0",
          "label-position": "n"
        },
        "nodes": [
          "e61e833a6511c36a",
          "c2086647b104bc1e",
          "6e493f2ae2afc459",
          "48d067f831f3e4ce"
        ],
        "x": 1384,
        "y": 379,
        "w": 682,
        "h": 182
      },
      {
        "id": "9f1934b6338a6320",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "1fe9fa535a0fde9f",
        "name": "",
        "style": {
          "label": true,
          "stroke": "#addb7b",
          "fill": "#e3f3d3",
          "color": "#000000"
        },
        "nodes": [
          "6eaed98538e3573c",
          "df93a432465246b4",
          "04ee8c8e57ead3cf",
          "694c9df0d78b8029",
          "11df640be329e60e",
          "6110cf3ccb74c0fd",
          "02cb551f9e1ac8ae"
        ],
        "x": 54,
        "y": 359,
        "w": 1122,
        "h": 202
      },
      {
        "id": "a510816749698b5f",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "9e64427b4b761edf",
        "name": "",
        "style": {
          "stroke": "#6f2fa0",
          "stroke-opacity": "0.91",
          "fill": "#dbcbe7",
          "label": true
        },
        "nodes": [
          "c92636cfd28daecb",
          "6563943bbdf0e9bf",
          "6b0e70abb6f088b0",
          "cd89762edf07b438",
          "ea0bf5ca71abf4b6",
          "e9b3f96c181559d1",
          "c1f44178c33062ea",
          "93011e5a14d47b1d",
          "230ec4d3b87da968"
        ],
        "x": 804,
        "y": 739,
        "w": 1062,
        "h": 282
      },
      {
        "id": "a9533d08ad6224d3",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "9e64427b4b761edf",
        "name": "",
        "style": {
          "stroke": "#0070c0",
          "fill": "#bfdbef",
          "label": true
        },
        "nodes": [
          "d4f6bb46f64613c4",
          "e293e4e00dfd59c0",
          "e307dd1fdf6c5cd1"
        ],
        "x": 74,
        "y": 699,
        "w": 682,
        "h": 162
      },
      {
        "id": "f6441d4ab06d70b9",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "9e64427b4b761edf",
        "name": "",
        "style": {
          "stroke": "#6f2fa0",
          "fill": "#dbcbe7",
          "fill-opacity": "0.23",
          "label": true
        },
        "nodes": [
          "c0f0c26aae3ff2b8",
          "82b972c11d1fe16d",
          "f7b257b21bce2336"
        ],
        "x": 64,
        "y": 939,
        "w": 692,
        "h": 162
      },
      {
        "id": "7bb05fae61a5e046",
        "type": "group",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "9e64427b4b761edf",
        "name": "",
        "style": {
          "label": true,
          "stroke": "#7fb7df",
          "fill": "#bfdbef",
          "color": "#3f93cf",
          "label-position": "n",
          "fill-opacity": "0.3"
        },
        "nodes": [
          "dfa57c8f884bfda9",
          "0269391fa5810530",
          "c319c762dd047445",
          "ff8d07def202ba08",
          "85f8e8b82308a24b",
          "3a160fc79a26ccb3"
        ],
        "x": 1044,
        "y": 1059,
        "w": 862,
        "h": 182
      },
      {
        "id": "295b8e73e2576b3f",
        "type": "comment",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "1fe9fa535a0fde9f",
        "name": "Step: A New Appointment Triggers This",
        "info": "## # This workflow processes appointm****ent booking messages and performs real-time eligibility verification",
        "x": 350,
        "y": 80,
        "wires": []
      },
      {
        "id": "d1cee3dcb3792398",
        "type": "http in",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "8cf0cc5afed2f1ff",
        "name": "POST /eligibility-check",
        "url": "/eligibility-check",
        "method": "post",
        "upload": false,
        "swaggerDoc": "",
        "x": 250,
        "y": 220,
        "wires": [
          [
            "96948dd94215f919"
          ]
        ]
      },
      {
        "id": "96948dd94215f919",
        "type": "ec-hl7-parser",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "8cf0cc5afed2f1ff",
        "name": "Read Appointment Details",
        "outputField": "",
        "outputFieldType": "msg",
        "x": 540,
        "y": 220,
        "wires": [
          [
            "34a89e0b41653e90",
            "821e153d9f64d9ec"
          ]
        ]
      },
      {
        "id": "34a89e0b41653e90",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "d": true,
        "g": "8cf0cc5afed2f1ff",
        "name": "Log Appointment Data",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 660,
        "y": 160,
        "wires": []
      },
      {
        "id": "d20ec7cf4258c19c",
        "type": "inject",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "8cf0cc5afed2f1ff",
        "name": "Appointment Scheduling ",
        "props": [
          {
            "p": "payload"
          }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "MSH|^~\\&|MESA_OP|XYZ_HOSPITAL|iFW|ABC_HOSPITAL|20110613061611||SIU^S12|24916560|P|2.3||||||| SCH|10345^10345|2196178^2196178|||10345|OFFICE^Office visit|reason for the appointment|OFFICE|60|m|^^60^20110617084500^20110617093000|||||9^DENT^ARTHUR^||||9^DENT^COREY^|||||Scheduled PID|1||AETNA9wcSu||Doe^John||19781012|M|||1 Broadway Ave^^Fort Wayne^IN^46804||(260)555-1234|||S||999999999|||||||||||||||||||| IN1|1||60054||Provider Name||||||||||||Doe^John||19781012|1 Broadway Ave^^Fort Wayne^IN^46804||||||||||||||||||||||||AETNA9wcSu|||||||M|||||||||1999999984 PID|2||AETNA9wcSu||Doe^Jordan||20010714|U|||||||||||||||||||||||||||||||| PV1|1|O|||||1^Smith^Miranda^A^MD^^^^|2^Withers^Peter^D^MD^^^^||||||||||30||||||||||||||||||||||||||||||||99158|| RGS|1|A AIG|1|A|1^White, Charles|D^^ AIL|1|A|OFFICE^^^OFFICE|^Main Office||20110614084500|||45|m^Minutes||Scheduled AIP|1|A|1^White^Charles^A^MD^^^^|D^White, Douglas||20110614084500|||45|m^Minutes||Scheduled",
        "payloadType": "str",
        "x": 240,
        "y": 280,
        "wires": [
          [
            "96948dd94215f919"
          ]
        ]
      },
      {
        "id": "821e153d9f64d9ec",
        "type": "ec-hl7-mapper",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "8cf0cc5afed2f1ff",
        "name": "Build Eligibility Request",
        "templateType": "custom",
        "template": "{% assign pidSegmentLists = hl7v2Data | get_segment_lists: 'PID' -%}\n{% assign firstPID = pidSegmentLists.PID[0] -%}\n{% assign in1SegmentLists = hl7v2Data | get_related_segment_list: firstPID, 'IN1' -%}\n{% assign firstIN1 = in1SegmentLists.IN1[0] -%}\n{% assign pv1SegmentLists = hl7v2Data | get_related_segment_list: firstPID, 'PV1' -%}\n{% assign firstPV1 = pv1SegmentLists.PV1[0] -%}\n{\n    \"tradingPartnerServiceId\": \"{{ firstIN1.3.1.Value }}\",\n    \"provider\": {\n        \"organizationName\": \"Provider Name\",\n        \"npi\": \"1999999984\"\n    },\n    \"subscriber\": {\n        \"firstName\": \"{{ firstPID.5.2.Value }}\",\n        \"lastName\": \"{{ firstPID.5.1.Value }}\",\n        \"memberId\": \"{{ firstPID.3.1.Value }}\"\n    },\n    \"dependents\": [\n        {% if pidSegmentLists.PID.size > 1 -%}\n        {% assign dependentPID = pidSegmentLists.PID[1] -%}\n        {\n            \"firstName\": \"{{ dependentPID.5.2.Value }}\",\n            \"lastName\": \"{{ dependentPID.5.1.Value }}\",\n            \"dateOfBirth\": \"{{ dependentPID.7.1.Value }}\"\n        }\n        {% endif -%}\n    ],\n    \"encounter\": {\n        \"serviceTypeCodes\": [\"30\"]\n    }\n}",
        "outputFormat": "json",
        "inputField": "payload",
        "inputFieldType": "msg",
        "outputField": "payload",
        "outputFieldType": "msg",
        "x": 890,
        "y": 220,
        "wires": [
          [
            "7d82ffe2241ee368",
            "9a550901f4c6e0cc"
          ]
        ]
      },
      {
        "id": "7d82ffe2241ee368",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "d": true,
        "g": "8cf0cc5afed2f1ff",
        "name": "Log Extracted Patient Info",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1010,
        "y": 280,
        "wires": []
      },
      {
        "id": "493414af912fe182",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "8624b4f53c54179c",
        "name": "Stedi's Response",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1810,
        "y": 180,
        "wires": []
      },
      {
        "id": "9a550901f4c6e0cc",
        "type": "change",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "8624b4f53c54179c",
        "name": "Set Patient Insurance Data",
        "rules": [
          {
            "t": "set",
            "p": "payload.ins",
            "pt": "msg",
            "to": "payload",
            "tot": "msg",
            "dc": true
          }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1360,
        "y": 240,
        "wires": [
          [
            "0b1ca7e67f0cb0d9"
          ]
        ]
      },
      {
        "id": "0b1ca7e67f0cb0d9",
        "type": "ec-stedi-eligibility",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "8624b4f53c54179c",
        "name": "Stedi Eligibility Check",
        "interface": "stedi",
        "integrationId": "",
        "integrationMetadata": {
          "ehr": "stedi",
          "type": "stedi",
          "scopes": ""
        },
        "customApiUrl": "",
        "outputField": "",
        "outputFieldType": "msg",
        "x": 1570,
        "y": 180,
        "wires": [
          [
            "e61e833a6511c36a",
            "493414af912fe182"
          ]
        ]
      },
      {
        "id": "e61e833a6511c36a",
        "type": "function",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "ccd260164c564b23",
        "name": "Format Eligibility Response",
        "func": "// Format Stedi eligibility response into comprehensive text report\nconst response = msg.payload;\n\nlet resultText = \"\\n═══════════════════════════════════════════════════════════\\n\";\nresultText += \"  ELIGIBILITY & BENEFITS VERIFICATION RESULTS\\n\";\nresultText += \"═══════════════════════════════════════════════════════════\\n\\n\";\n\n// Check for errors first\nif (response.errors && response.errors.length > 0) {\n    resultText += \"❌ ERRORS DETECTED\\n\";\n    resultText += \"─────────────────────────────────────────────────────────\\n\";\n    response.errors.forEach((error, index) => {\n        resultText += `${index + 1}. ${error.description || error.message || JSON.stringify(error)}\\n`;\n    });\n    resultText += \"\\n\";\n}\n\n// Subscriber Information\nresultText += \"👤 SUBSCRIBER INFORMATION\\n\";\nresultText += \"─────────────────────────────────────────────────────────\\n\";\nif (response.subscriber) {\n    const sub = response.subscriber;\n    resultText += `Name: ${sub.firstName || ''} ${sub.middleName || ''} ${sub.lastName || ''}\\n`.replace(/\\s+/g, ' ');\n    resultText += `Member ID: ${sub.memberId || 'N/A'}\\n`;\n    if (sub.groupNumber) {\n        resultText += `Group Number: ${sub.groupNumber}\\n`;\n    }\n    if (sub.entityIdentifier) {\n        resultText += `Entity: ${sub.entityIdentifier}\\n`;\n    }\n}\nresultText += \"\\n\";\n\n// Dependent Information\nif (response.dependents && response.dependents.length > 0) {\n    resultText += \"👨‍👩‍👧‍👦 DEPENDENT INFORMATION\\n\";\n    resultText += \"─────────────────────────────────────────────────────────\\n\";\n    response.dependents.forEach((dep, idx) => {\n        resultText += `\\nDependent ${idx + 1}:\\n`;\n        resultText += `  Name: ${dep.firstName || ''} ${dep.middleName || ''} ${dep.lastName || ''}\\n`.replace(/\\s+/g, ' ');\n        if (dep.dateOfBirth) {\n            resultText += `  Date of Birth: ${dep.dateOfBirth}\\n`;\n        }\n        if (dep.gender) {\n            resultText += `  Gender: ${dep.gender}\\n`;\n        }\n        if (dep.relationToSubscriber) {\n            resultText += `  Relationship: ${dep.relationToSubscriber}\\n`;\n        }\n        if (dep.address) {\n            resultText += `  Address: ${dep.address.address1 || ''}${dep.address.address2 ? ', ' + dep.address.address2 : ''}\\n`;\n            resultText += `           ${dep.address.city || ''}, ${dep.address.state || ''} ${dep.address.postalCode || ''}\\n`;\n        }\n    });\n    resultText += \"\\n\";\n}\n\n// Provider Information\nresultText += \"🏥 PROVIDER INFORMATION\\n\";\nresultText += \"─────────────────────────────────────────────────────────\\n\";\nif (response.provider) {\n    const prov = response.provider;\n    resultText += `Name: ${prov.providerName || 'N/A'}\\n`;\n    if (prov.npi) {\n        resultText += `NPI: ${prov.npi}\\n`;\n    }\n    if (prov.entityIdentifier) {\n        resultText += `Type: ${prov.entityIdentifier}\\n`;\n    }\n}\nresultText += \"\\n\";\n\n// Payer Information\nresultText += \"💳 PAYER INFORMATION\\n\";\nresultText += \"─────────────────────────────────────────────────────────\\n\";\nif (response.payer) {\n    const payer = response.payer;\n    resultText += `Name: ${payer.name || 'N/A'}\\n`;\n    if (payer.payorIdentification) {\n        resultText += `Payor ID: ${payer.payorIdentification}\\n`;\n    }\n}\nresultText += \"\\n\";\n\n// Plan Information\nresultText += \"📋 PLAN INFORMATION\\n\";\nresultText += \"═════════════════════════════════════════════════════════\\n\";\nif (response.planInformation) {\n    if (response.planInformation.planNumber) {\n        resultText += `Plan Number: ${response.planInformation.planNumber}\\n`;\n    }\n}\nif (response.planDateInformation) {\n    const dates = response.planDateInformation;\n    if (dates.planBegin) {\n        resultText += `Plan Begin: ${dates.planBegin}\\n`;\n    }\n    if (dates.eligibilityBegin) {\n        resultText += `Eligibility Begin: ${dates.eligibilityBegin}\\n`;\n    }\n    if (dates.service) {\n        resultText += `Service Date: ${dates.service}\\n`;\n    }\n}\nresultText += \"\\n\";\n\n// Plan Status\nif (response.planStatus && response.planStatus.length > 0) {\n    resultText += \"✅ PLAN STATUS\\n\";\n    resultText += \"─────────────────────────────────────────────────────────\\n\";\n    response.planStatus.forEach((status, idx) => {\n        resultText += `${idx + 1}. ${status.status || 'Unknown'}\\n`;\n        if (status.planDetails) {\n            resultText += `   Plan: ${status.planDetails}\\n`;\n        }\n        if (status.serviceTypeCodes && status.serviceTypeCodes.length > 0) {\n            resultText += `   Service Codes: ${status.serviceTypeCodes.join(', ')}\\n`;\n        }\n    });\n    resultText += \"\\n\";\n}\n\n// Benefits Summary - Group by benefit type\nif (response.benefitsInformation && response.benefitsInformation.length > 0) {\n    resultText += \"💰 BENEFITS INFORMATION\\n\";\n    resultText += \"═════════════════════════════════════════════════════════\\n\\n\";\n    \n    // Group benefits by code (A=Coinsurance, B=Copayment, C=Deductible, G=Out of Pocket, F=Limitations, H=Unlimited, I=Non-Covered)\n    const deductibles = response.benefitsInformation.filter(b => b.code === 'C');\n    const outOfPocket = response.benefitsInformation.filter(b => b.code === 'G');\n    const copayments = response.benefitsInformation.filter(b => b.code === 'B');\n    const coinsurance = response.benefitsInformation.filter(b => b.code === 'A');\n    const limitations = response.benefitsInformation.filter(b => b.code === 'F');\n    const unlimited = response.benefitsInformation.filter(b => b.code === 'H');\n    const nonCovered = response.benefitsInformation.filter(b => b.code === 'I');\n    \n    // Deductibles\n    if (deductibles.length > 0) {\n        resultText += \"🔹 DEDUCTIBLES\\n\";\n        resultText += \"─────────────────────────────────────────────────────────\\n\";\n        \n        // In-Network\n        const inNetworkDed = deductibles.filter(d => d.inPlanNetworkIndicatorCode === 'Y');\n        if (inNetworkDed.length > 0) {\n            resultText += \"\\nIn-Network:\\n\";\n            inNetworkDed.forEach(ded => {\n                const level = ded.coverageLevel || 'N/A';\n                const amount = ded.benefitAmount || '0';\n                const timeQual = ded.timeQualifier || '';\n                const services = ded.serviceTypes ? ded.serviceTypes.join(', ') : 'General';\n                resultText += `  ${level} - $${amount}`;\n                if (timeQual) resultText += ` (${timeQual})`;\n                resultText += ` - ${services}\\n`;\n            });\n        }\n        \n        // Out-of-Network\n        const outNetworkDed = deductibles.filter(d => d.inPlanNetworkIndicatorCode === 'N');\n        if (outNetworkDed.length > 0) {\n            resultText += \"\\nOut-of-Network:\\n\";\n            outNetworkDed.forEach(ded => {\n                const level = ded.coverageLevel || 'N/A';\n                const amount = ded.benefitAmount || '0';\n                const timeQual = ded.timeQualifier || '';\n                const services = ded.serviceTypes ? ded.serviceTypes.join(', ') : 'General';\n                resultText += `  ${level} - $${amount}`;\n                if (timeQual) resultText += ` (${timeQual})`;\n                resultText += ` - ${services}\\n`;\n            });\n        }\n        resultText += \"\\n\";\n    }\n    \n    // Out of Pocket\n    if (outOfPocket.length > 0) {\n        resultText += \"🔹 OUT OF POCKET MAXIMUM\\n\";\n        resultText += \"─────────────────────────────────────────────────────────\\n\";\n        \n        // In-Network\n        const inNetworkOOP = outOfPocket.filter(o => o.inPlanNetworkIndicatorCode === 'Y');\n        if (inNetworkOOP.length > 0) {\n            resultText += \"\\nIn-Network:\\n\";\n            inNetworkOOP.forEach(oop => {\n                const level = oop.coverageLevel || 'N/A';\n                const amount = oop.benefitAmount || '0';\n                const timeQual = oop.timeQualifier || '';\n                const services = oop.serviceTypes ? oop.serviceTypes.join(', ') : 'General';\n                resultText += `  ${level} - $${amount}`;\n                if (timeQual) resultText += ` (${timeQual})`;\n                resultText += ` - ${services}\\n`;\n                if (oop.additionalInformation && oop.additionalInformation.length > 0) {\n                    oop.additionalInformation.forEach(info => {\n                        resultText += `    ℹ️  ${info.description}\\n`;\n                    });\n                }\n            });\n        }\n        \n        // Out-of-Network\n        const outNetworkOOP = outOfPocket.filter(o => o.inPlanNetworkIndicatorCode === 'N');\n        if (outNetworkOOP.length > 0) {\n            resultText += \"\\nOut-of-Network:\\n\";\n            outNetworkOOP.forEach(oop => {\n                const level = oop.coverageLevel || 'N/A';\n                const amount = oop.benefitAmount || '0';\n                const timeQual = oop.timeQualifier || '';\n                resultText += `  ${level} - $${amount}`;\n                if (timeQual) resultText += ` (${timeQual})`;\n                resultText += \"\\n\";\n            });\n        }\n        resultText += \"\\n\";\n    }\n    \n    // Copayments\n    if (copayments.length > 0) {\n        resultText += \"🔹 COPAYMENTS (In-Network)\\n\";\n        resultText += \"─────────────────────────────────────────────────────────\\n\";\n        const inNetworkCopay = copayments.filter(c => c.inPlanNetworkIndicatorCode === 'Y');\n        \n        // Group by service type\n        const copayByService = {};\n        inNetworkCopay.forEach(copay => {\n            const services = copay.serviceTypes || ['General'];\n            services.forEach(service => {\n                if (!copayByService[service]) {\n                    copayByService[service] = [];\n                }\n                copayByService[service].push(copay);\n            });\n        });\n        \n        Object.keys(copayByService).forEach(service => {\n            resultText += `\\n${service}:\\n`;\n            copayByService[service].forEach(copay => {\n                const amount = copay.benefitAmount || '0';\n                resultText += `  $${amount}`;\n                if (copay.additionalInformation && copay.additionalInformation.length > 0) {\n                    const info = copay.additionalInformation.map(i => i.description).join(', ');\n                    resultText += ` - ${info}`;\n                }\n                resultText += \"\\n\";\n            });\n        });\n        resultText += \"\\n\";\n    }\n    \n    // Coinsurance\n    if (coinsurance.length > 0) {\n        resultText += \"🔹 COINSURANCE (In-Network)\\n\";\n        resultText += \"─────────────────────────────────────────────────────────\\n\";\n        const inNetworkCoins = coinsurance.filter(c => c.inPlanNetworkIndicatorCode === 'Y');\n        \n        // Group by service type\n        const coinsByService = {};\n        inNetworkCoins.forEach(coins => {\n            const services = coins.serviceTypes || ['General'];\n            services.forEach(service => {\n                if (!coinsByService[service]) {\n                    coinsByService[service] = [];\n                }\n                coinsByService[service].push(coins);\n            });\n        });\n        \n        Object.keys(coinsByService).forEach(service => {\n            resultText += `\\n${service}:\\n`;\n            coinsByService[service].forEach(coins => {\n                const percent = coins.benefitPercent || '0';\n                resultText += `  ${percent}% patient responsibility`;\n                if (coins.additionalInformation && coins.additionalInformation.length > 0) {\n                    const info = coins.additionalInformation.map(i => i.description).join(', ');\n                    resultText += ` - ${info}`;\n                }\n                resultText += \"\\n\";\n            });\n        });\n        resultText += \"\\n\";\n    }\n    \n    // Limitations\n    if (limitations.length > 0) {\n        resultText += \"⚠️  LIMITATIONS & RESTRICTIONS\\n\";\n        resultText += \"─────────────────────────────────────────────────────────\\n\";\n        limitations.forEach((lim, idx) => {\n            if (lim.additionalInformation && lim.additionalInformation.length > 0) {\n                lim.additionalInformation.forEach(info => {\n                    resultText += `• ${info.description}\\n`;\n                });\n            } else if (lim.benefitAmount) {\n                const services = lim.serviceTypes ? lim.serviceTypes.join(', ') : 'General';\n                resultText += `• ${services}: ${lim.benefitAmount}`;\n                if (lim.timeQualifier) resultText += ` per ${lim.timeQualifier}`;\n                resultText += \"\\n\";\n            }\n        });\n        resultText += \"\\n\";\n    }\n    \n    // Unlimited\n    if (unlimited.length > 0) {\n        resultText += \"♾️  UNLIMITED BENEFITS\\n\";\n        resultText += \"─────────────────────────────────────────────────────────\\n\";\n        unlimited.forEach(unlim => {\n            const services = unlim.serviceTypes ? unlim.serviceTypes.join(', ') : 'General';\n            resultText += `• ${services}\\n`;\n        });\n        resultText += \"\\n\";\n    }\n    \n    // Non-Covered\n    if (nonCovered.length > 0) {\n        resultText += \"❌ NON-COVERED SERVICES\\n\";\n        resultText += \"─────────────────────────────────────────────────────────\\n\";\n        nonCovered.forEach(nc => {\n            if (nc.additionalInformation && nc.additionalInformation.length > 0) {\n                nc.additionalInformation.forEach(info => {\n                    resultText += `• ${info.description}\\n`;\n                });\n            } else {\n                const services = nc.serviceTypes ? nc.serviceTypes.join(', ') : 'General';\n                resultText += `• ${services}\\n`;\n            }\n        });\n        resultText += \"\\n\";\n    }\n}\n\n// Transaction Details\nresultText += \"📊 TRANSACTION DETAILS\\n\";\nresultText += \"─────────────────────────────────────────────────────────\\n\";\nif (response.id) {\n    resultText += `Transaction ID: ${response.id}\\n`;\n}\nif (response.controlNumber) {\n    resultText += `Control Number: ${response.controlNumber}\\n`;\n}\nif (response.tradingPartnerServiceId) {\n    resultText += `Trading Partner Service ID: ${response.tradingPartnerServiceId}\\n`;\n}\nif (response.meta) {\n    if (response.meta.traceId) {\n        resultText += `Trace ID: ${response.meta.traceId}\\n`;\n    }\n    if (response.meta.applicationMode) {\n        resultText += `Mode: ${response.meta.applicationMode}\\n`;\n    }\n}\nresultText += `Timestamp: ${new Date().toISOString()}\\n`;\n\nresultText += \"\\n═══════════════════════════════════════════════════════════\\n\";\nresultText += \"  END OF ELIGIBILITY VERIFICATION REPORT\\n\";\nresultText += \"═══════════════════════════════════════════════════════════\\n\";\n\n// Set the formatted text as payload\nmsg.payload = resultText;\n\n// Keep the raw response for reference\nmsg.rawStediResponse = response;\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1530,
        "y": 420,
        "wires": [
          [
            "6e493f2ae2afc459",
            "c2086647b104bc1e",
            "48d067f831f3e4ce"
          ]
        ]
      },
      {
        "id": "c2086647b104bc1e",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "ccd260164c564b23",
        "name": "Generate Report for Health System",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1870,
        "y": 420,
        "wires": []
      },
      {
        "id": "6e493f2ae2afc459",
        "type": "http response",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "d": true,
        "g": "ccd260164c564b23",
        "name": "Return Eligibility Report",
        "statusCode": "200",
        "headers": {
          "content-type": "text/plain; charset=utf-8"
        },
        "x": 1900,
        "y": 520,
        "wires": []
      },
      {
        "id": "48d067f831f3e4ce",
        "type": "http request",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "ccd260164c564b23",
        "name": "Write To Health System",
        "method": "POST",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "https://your-health-system.example.com/webhook",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 1890,
        "y": 480,
        "wires": [
          []
        ]
      },
      {
        "id": "88943ef749290f17",
        "type": "comment",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "8cf0cc5afed2f1ff",
        "name": "Appointment Booking Done at Registration Desk   ",
        "info": "",
        "x": 270,
        "y": 160,
        "wires": []
      },
      {
        "id": "6eaed98538e3573c",
        "type": "http in",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "9f1934b6338a6320",
        "name": "POST /eligibility-check",
        "url": "/eligibility-check",
        "method": "post",
        "upload": false,
        "skipBodyParsing": false,
        "swaggerDoc": "",
        "x": 250,
        "y": 460,
        "wires": [
          [
            "df93a432465246b4"
          ]
        ]
      },
      {
        "id": "df93a432465246b4",
        "type": "ec-hl7-parser",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "9f1934b6338a6320",
        "name": "Parse ORM_O01 Message",
        "outputField": "",
        "outputFieldType": "msg",
        "x": 540,
        "y": 460,
        "wires": [
          [
            "04ee8c8e57ead3cf",
            "11df640be329e60e"
          ]
        ]
      },
      {
        "id": "04ee8c8e57ead3cf",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "d": true,
        "g": "9f1934b6338a6320",
        "name": "Log Appointment Data",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 660,
        "y": 400,
        "wires": []
      },
      {
        "id": "694c9df0d78b8029",
        "type": "inject",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "9f1934b6338a6320",
        "name": "Appointment Scheduling ",
        "props": [
          {
            "p": "payload"
          }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "MSH|^~\\&|MESA_OP|XYZ_HOSPITAL|iFW|ABC_RADIOLOGY|||ORM^O01|101104|P|2.3||||||||  PID|1||AETNA9wcSu||Doe^John||19781012|M|||1 Broadway Ave^^Fort Wayne^IN^46804||(260)555-1234|||S||999999999|||||||||||||||||||| IN1|1||60054||Provider Name||||||||||||Doe^John||19781012|1 Broadway Ave^^Fort Wayne^IN^46804||||||||||||||||||||||||AETNA9wcSu|||||||M|||||||||1999999984  PID|2||AETNA9wcSu||Doe^Jordan||20010714|U||||||||||||||||||||||||||||||||  IN1|1||60054||Provider Name||||||||||||Doe^John||19781012|1 Broadway Ave^^Fort Wayne^IN^46804||||||||||||||||||||||||AETNA9wcSu|||||||M|||||||||1999999984  PD1|||FACILITY(EAST)^^12345|63003abb-3924-46df-a75a-0a1f42733189^MATTHEWS^JAMES^A^^^  PV1|1|O|||||1^Smith^Miranda^A^MD^^^^|2^Withers^Peter^D^MD^^^^||||||||||30||||||||||||||||||||||||||||||||99158||RGS|1|A ORC|NW|987654^EPIC|76543^EPC||Final||^^^20140418170014^^^^||20140418173314|1148^PATTERSON^JAMES^^^^||63003abb-3924-46df-a75a-0a1f42733189^MATTHEWS^JAMES^A^^^|1133^^^222^^^^^|(618)222-1122||  OBR|1|3158620^EPC|1858^EPC|73610^X-RAY ANKLE 3+ VW^^^X-RAY ANKLE ||||||||||||63003abb-3924-46df-a75a-0a1f42733189^MATTHEWS^JAMES^A^^^|(608)258-8866||||||||Final||^^^20140418170014^^^^|||||6064^MANSFIELD^JEREMY^^^^||1148010^1A^EAST^X-RAY^^^|^|  DG1||I10|S82^ANKLE FRACTURE^I10|ANKLE FRACTURE||",
        "payloadType": "str",
        "x": 240,
        "y": 520,
        "wires": [
          [
            "df93a432465246b4"
          ]
        ]
      },
      {
        "id": "11df640be329e60e",
        "type": "ec-hl7-mapper",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "9f1934b6338a6320",
        "name": "Build Eligibility Request",
        "templateType": "custom",
        "template": "{% assign pidSegmentLists = hl7v2Data | get_segment_lists: 'PID' -%}\n{% assign firstPID = pidSegmentLists.PID[0] -%}\n{% assign in1SegmentLists = hl7v2Data | get_related_segment_list: firstPID, 'IN1' -%}\n{% assign firstIN1 = in1SegmentLists.IN1[0] -%}\n{% assign pv1SegmentLists = hl7v2Data | get_related_segment_list: firstPID, 'PV1' -%}\n{% assign firstPV1 = pv1SegmentLists.PV1[0] -%}\n{\n    \"tradingPartnerServiceId\": \"{{ firstIN1.3.1.Value }}\",\n    \"provider\": {\n        \"organizationName\": \"Provider Name\",\n        \"npi\": \"1999999984\"\n    },\n    \"subscriber\": {\n        \"firstName\": \"{{ firstPID.5.2.Value }}\",\n        \"lastName\": \"{{ firstPID.5.1.Value }}\",\n        \"memberId\": \"{{ firstPID.3.1.Value }}\"\n    },\n    \"dependents\": [\n        {% if pidSegmentLists.PID.size > 1 -%}\n        {% assign dependentPID = pidSegmentLists.PID[1] -%}\n        {\n            \"firstName\": \"{{ dependentPID.5.2.Value }}\",\n            \"lastName\": \"{{ dependentPID.5.1.Value }}\",\n            \"dateOfBirth\": \"{{ dependentPID.7.1.Value }}\"\n        }\n        {% endif -%}\n    ],\n    \"encounter\": {\n        \"serviceTypeCodes\": [\"30\"]\n    }\n}",
        "outputFormat": "json",
        "inputField": "payload",
        "inputFieldType": "msg",
        "outputField": "payload",
        "outputFieldType": "msg",
        "x": 890,
        "y": 460,
        "wires": [
          [
            "6110cf3ccb74c0fd",
            "9a550901f4c6e0cc"
          ]
        ]
      },
      {
        "id": "6110cf3ccb74c0fd",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "d": true,
        "g": "9f1934b6338a6320",
        "name": "Extract Data From ORM",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1020,
        "y": 520,
        "wires": []
      },
      {
        "id": "02cb551f9e1ac8ae",
        "type": "comment",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "9f1934b6338a6320",
        "name": "Appointment Booking Done by Referral",
        "info": "",
        "x": 240,
        "y": 400,
        "wires": []
      },
      {
        "id": "c92636cfd28daecb",
        "type": "ai-agent",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a510816749698b5f",
        "name": "AI Agent",
        "systemPrompt": "You are a Healthcare Patient Intake Helper AI Agent for a US healthcare provider. Your job is to collect patient intake information such as Patient Name, Date of Birth & Insurance Member ID .\n\nYour work is to fetch the data required for eligibility and benefits verification.\n\nYou must call the real-time eligibility tool with patient's name, date of birth and insurance member id \n\nOnce you get the response, you must summarize weather the patient has active plan or not then benefits of the insurance plan in a user friendly manner which can be presented to patient and provider.\n\nAlso the memberId is case sensitive, so make sure not to uppercase it\n\n\n",
        "responseType": "object",
        "maxRecursionDepth": "10",
        "streaming": false,
        "x": 1440,
        "y": 880,
        "wires": [
          [
            "cd89762edf07b438"
          ]
        ]
      },
      {
        "id": "6563943bbdf0e9bf",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a510816749698b5f",
        "name": "Fetch Patient Details  ",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1480,
        "y": 780,
        "wires": []
      },
      {
        "id": "6b0e70abb6f088b0",
        "type": "ai-tool-adapter",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a510816749698b5f",
        "name": "Real-time eligibility tool ",
        "toolIdentifier": "real_time_eligibility",
        "toolDescription": "This is a real-time eligibility tool, you'll need to collect patient demographics and insurance data such as Patient first name, last name, Date of birth and insurace member id as mentioned in the following format. Send everything as mentioned in the below example by hardcoding it and only make changes to the firstName, lastName,dateOfBirth and memberId. Also the memberId is case-sensitive.\n\nKeep the dependent as it is, do not change\n{\"tradingPartnerServiceId\":\"60054\",\"provider\":{\"organizationName\":\"Provider Name\",\"npi\":\"1999999984\"},\"subscriber\":{\"firstName\":\"John\",\"lastName\":\"Doe\",\"memberId\":\"AETNA9wcSu\"},\"dependents\":[{\"firstName\":\"Jordan\",\"lastName\":\"Doe\",\"dateOfBirth\":\"20010714\"}],\"encounter\":{\"serviceTypeCodes\":[\"30\"]}}",
        "parameters": [
          {
            "name": "data",
            "type": "object",
            "description": "main input for real-time eligibility",
            "required": true
          }
        ],
        "timeout": 30000,
        "validationCode": "",
        "x": 1130,
        "y": 880,
        "wires": [
          [
            "6563943bbdf0e9bf",
            "c92636cfd28daecb"
          ],
          [
            "ea0bf5ca71abf4b6",
            "0269391fa5810530"
          ]
        ]
      },
      {
        "id": "cd89762edf07b438",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a510816749698b5f",
        "name": "AI Agent EVBV Summary",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1710,
        "y": 880,
        "wires": []
      },
      {
        "id": "ea0bf5ca71abf4b6",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a510816749698b5f",
        "name": "Stedi Tool Input",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1480,
        "y": 960,
        "wires": []
      },
      {
        "id": "e9b3f96c181559d1",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a510816749698b5f",
        "name": "Log Agent API Key",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1110,
        "y": 960,
        "wires": []
      },
      {
        "id": "d4f6bb46f64613c4",
        "type": "inject",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a9533d08ad6224d3",
        "name": "Patient Calls for Appointment Booking   ",
        "props": [
          {
            "p": "payload.message",
            "v": "Hi, I'm a John Doe. My Date of birth is 14th July , 2001. And my member id is  AETNA9wcSu  , Also i want to book an appointment on 1st March, 2026 as i'm facing issues with while breathing and having some chest pains.  ",
            "vt": "str"
          }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 270,
        "y": 820,
        "wires": [
          [
            "e293e4e00dfd59c0"
          ]
        ]
      },
      {
        "id": "e293e4e00dfd59c0",
        "type": "ec-auth-backend",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a9533d08ad6224d3",
        "name": "Get Cerner Backend Auth",
        "integrationId": "",
        "integrationMetadata": {
          "ehr": "cerner",
          "type": "backend",
          "scopes": "system/Patient.crus system/DocumentReference.crus system/Encounter.crus system/Binary.r system/Condition.crus system/Observation.crus system/Appointment.crus"
        },
        "customScopes": "",
        "outputFormat": "full_response",
        "outputField": "",
        "outputFieldType": "msg",
        "x": 610,
        "y": 820,
        "wires": [
          [
            "c1f44178c33062ea"
          ]
        ]
      },
      {
        "id": "e307dd1fdf6c5cd1",
        "type": "comment",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a9533d08ad6224d3",
        "name": "Patient Calls for Appointment Booking  ",
        "info": "",
        "x": 250,
        "y": 740,
        "wires": []
      },
      {
        "id": "c0f0c26aae3ff2b8",
        "type": "inject",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "f6441d4ab06d70b9",
        "name": "Patient Submits Appointment Booking Form via Patient Portal  ",
        "props": [
          {
            "p": "payload.PatientName",
            "v": "John Doe",
            "vt": "str"
          },
          {
            "p": "payload.DOB",
            "v": "14th July, 2001",
            "vt": "str"
          },
          {
            "p": "payload.memberid",
            "v": "AETNA9wcSu",
            "vt": "str"
          },
          {
            "p": "payload.AppointmentDate",
            "v": "1st March, 2026 ",
            "vt": "str"
          },
          {
            "p": "payload.symptoms",
            "v": "i'm facing issues with while breathing and having some chest pains",
            "vt": "str"
          }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 340,
        "y": 1060,
        "wires": [
          [
            "82b972c11d1fe16d"
          ]
        ]
      },
      {
        "id": "82b972c11d1fe16d",
        "type": "ec-auth-backend",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "f6441d4ab06d70b9",
        "name": "Get Cerner Backend Auth",
        "integrationId": "",
        "integrationMetadata": {
          "ehr": "cerner",
          "type": "backend",
          "scopes": "system/Patient.crus system/DocumentReference.crus system/Encounter.crus system/Binary.r system/Condition.crus system/Observation.crus system/Appointment.crus system/Coverage.cruds"
        },
        "customScopes": "",
        "outputFormat": "full_response",
        "outputField": "",
        "outputFieldType": "msg",
        "x": 610,
        "y": 980,
        "wires": [
          [
            "c1f44178c33062ea"
          ]
        ]
      },
      {
        "id": "f7b257b21bce2336",
        "type": "comment",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "f6441d4ab06d70b9",
        "name": "Patient Books an Appointment via Portal  ",
        "info": "",
        "x": 250,
        "y": 980,
        "wires": []
      },
      {
        "id": "c1f44178c33062ea",
        "type": "ai-model",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a510816749698b5f",
        "name": "Bedrock LLM",
        "provider": "bedrock",
        "model": "global.anthropic.claude-haiku-4-5-20251001-v1:0",
        "temperature": 0.7,
        "maxTokens": 1000,
        "vertexProjectId": "",
        "vertexLocation": "us-central1",
        "awsRegion": "us-east-2",
        "bedrockAuthMethod": "apiKey",
        "x": 910,
        "y": 880,
        "wires": [
          [
            "6b0e70abb6f088b0",
            "230ec4d3b87da968"
          ]
        ]
      },
      {
        "id": "93011e5a14d47b1d",
        "type": "comment",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a510816749698b5f",
        "name": "AI-Transcribed Patient Intake Data",
        "info": "",
        "x": 970,
        "y": 780,
        "wires": []
      },
      {
        "id": "230ec4d3b87da968",
        "type": "function",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "a510816749698b5f",
        "name": "Read Agent API Key",
        "func": "msg.payload = (msg.aiagent && msg.aiagent.apiKey) || 'NOT FOUND';\n  return msg;    ",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 970,
        "y": 980,
        "wires": [
          [
            "e9b3f96c181559d1"
          ]
        ]
      },
      {
        "id": "dfa57c8f884bfda9",
        "type": "ai-tool-terminate",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "7bb05fae61a5e046",
        "name": "End Tool Call",
        "x": 1800,
        "y": 1180,
        "wires": []
      },
      {
        "id": "0269391fa5810530",
        "type": "change",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "7bb05fae61a5e046",
        "name": "Set patient data",
        "rules": [
          {
            "t": "set",
            "p": "payload.ins",
            "pt": "msg",
            "to": "toolInput.data",
            "tot": "msg",
            "dc": true
          }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1340,
        "y": 1100,
        "wires": [
          [
            "c319c762dd047445",
            "3a160fc79a26ccb3"
          ]
        ]
      },
      {
        "id": "c319c762dd047445",
        "type": "ec-stedi-eligibility",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "7bb05fae61a5e046",
        "name": "Stedi Real Time EVBV",
        "interface": "stedi",
        "integrationId": "",
        "integrationMetadata": {
          "ehr": "stedi",
          "type": "stedi",
          "scopes": ""
        },
        "customApiUrl": "",
        "outputField": "",
        "outputFieldType": "msg",
        "x": 1520,
        "y": 1180,
        "wires": [
          [
            "dfa57c8f884bfda9",
            "ff8d07def202ba08"
          ]
        ]
      },
      {
        "id": "ff8d07def202ba08",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "7bb05fae61a5e046",
        "name": "Stedi Response",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1780,
        "y": 1120,
        "wires": []
      },
      {
        "id": "85f8e8b82308a24b",
        "type": "comment",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "7bb05fae61a5e046",
        "name": "Real Time EVBV",
        "info": "",
        "x": 1150,
        "y": 1200,
        "wires": []
      },
      {
        "id": "3a160fc79a26ccb3",
        "type": "debug",
        "z": "workflow_7f8b7e4f-9408-4cc4-9453-92c03cec52de",
        "g": "7bb05fae61a5e046",
        "name": "Log Patient Data",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1490,
        "y": 1100,
        "wires": []
      }
    ]
  },
  "requirements": [
    {
      "ehr": "stedi",
      "type": "stedi"
    },
    {
      "ehr": "cerner",
      "type": "backend",
      "scopes": "system/Patient.crus system/DocumentReference.crus system/Encounter.crus system/Binary.r system/Condition.crus system/Observation.crus system/Appointment.crus"
    },
    {
      "ehr": "cerner",
      "type": "backend",
      "scopes": "system/Patient.crus system/DocumentReference.crus system/Encounter.crus system/Binary.r system/Condition.crus system/Observation.crus system/Appointment.crus system/Coverage.cruds"
    }
  ]
}