AI症状チェックと医師推薦

中級

これはSupport Chatbot, Multimodal AI分野の自動化ワークフローで、15個のノードを含みます。主にIf, Code, Webhook, EmailSend, HttpRequestなどのノードを使用。 Ollama AIとWhatsAppで医療症状分析と医師の推奨

前提条件
  • HTTP Webhookエンドポイント(n8nが自動生成)
  • ターゲットAPIの認証情報が必要な場合あり
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "dIL4vZA7RjcU07qx",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "AI Symptom Checker & Doctor Suggestion",
  "tags": [],
  "nodes": [
    {
      "id": "73fc058d-d6ff-477d-826a-c1e050312f13",
      "name": "医療AIモデル",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "position": [
        240,
        1480
      ],
      "parameters": {
        "model": "=llama3.2-16000:latest",
        "options": {}
      },
      "credentials": {
        "ollamaApi": {
          "id": "7td3WzXCW2wNhraP",
          "name": "Ollama - test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "388c6212-65d0-47a4-a28a-f7bf9dd5c789",
      "name": "症状入力 Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -80,
        1260
      ],
      "webhookId": "2837e22a-d927-40c4-bc43-7c2ec38cfdcf",
      "parameters": {
        "path": "2837e22a-d927-40c4-bc43-7c2ec38cfdcf",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 1
    },
    {
      "id": "d0f553ed-cb9f-458e-b4be-9facd5a9ce8a",
      "name": "AI症状分析",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        140,
        1260
      ],
      "parameters": {
        "text": "={{ $json.body.symptoms }}",
        "options": {
          "systemMessage": "You are a medical AI assistant that analyzes symptoms and provides preliminary assessments. IMPORTANT: Always emphasize that this is not a substitute for professional medical advice.\n\nAnalyze the symptoms and provide a JSON response with:\n{\n  \"urgency_level\": \"low/medium/high/emergency\",\n  \"possible_conditions\": [\"condition1\", \"condition2\", \"condition3\"],\n  \"specialist_needed\": \"General Practitioner/Cardiologist/Dermatologist/Neurologist/Orthopedist/Gastroenterologist/Pulmonologist/Emergency\",\n  \"severity_assessment\": \"brief description\",\n  \"recommended_actions\": [\"action1\", \"action2\"],\n  \"red_flags\": [\"warning sign if any\"]\n}\n\nSymptoms to analyze: {{ $json.body.symptoms }}\n\nPatient details:\n- Age: {{ $json.body.age || 'Not provided' }}\n- Gender: {{ $json.body.gender || 'Not provided' }}\n- Duration: {{ $json.body.duration || 'Not provided' }}\n- Additional info: {{ $json.body.additional_info || 'None' }}"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "ce5d7cce-602e-4ca1-a565-15256a13fc6a",
      "name": "医療分析の解析",
      "type": "n8n-nodes-base.code",
      "position": [
        520,
        1260
      ],
      "parameters": {
        "jsCode": "// Parse the AI response and extract medical assessment\nconst aiResponse = items[0].json.output;\nconst originalData = $node[\"Symptom Input Webhook\"].json.body;\n\ntry {\n  // Try to parse JSON response from AI\n  let analysis;\n  if (aiResponse.includes('{')) {\n    const jsonStart = aiResponse.indexOf('{');\n    const jsonEnd = aiResponse.lastIndexOf('}') + 1;\n    const jsonStr = aiResponse.substring(jsonStart, jsonEnd);\n    analysis = JSON.parse(jsonStr);\n  } else {\n    // Fallback if AI doesn't return proper JSON\n    analysis = {\n      urgency_level: \"medium\",\n      possible_conditions: [\"General symptoms requiring medical evaluation\"],\n      specialist_needed: \"General Practitioner\",\n      severity_assessment: aiResponse,\n      recommended_actions: [\"Consult with a healthcare provider\"],\n      red_flags: []\n    };\n  }\n\n  return [{\n    json: {\n      ...originalData,\n      analysis: analysis,\n      timestamp: new Date().toISOString()\n    }\n  }];\n} catch (error) {\n  // Error handling - return basic assessment\n  return [{\n    json: {\n      ...originalData,\n      analysis: {\n        urgency_level: \"medium\",\n        possible_conditions: [\"Symptoms require medical evaluation\"],\n        specialist_needed: \"General Practitioner\",\n        severity_assessment: \"Unable to analyze symptoms properly. Please consult a healthcare provider.\",\n        recommended_actions: [\"Schedule appointment with doctor\", \"Monitor symptoms\"],\n        red_flags: [\"Seek immediate care if symptoms worsen\"]\n      },\n      timestamp: new Date().toISOString()\n    }\n  }];\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "15555bde-19dc-4278-b32b-e7601807cc6c",
      "name": "緊急度確認",
      "type": "n8n-nodes-base.if",
      "position": [
        740,
        1260
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.analysis.urgency_level }}",
              "value2": "emergency"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "87c59d4b-098d-4884-80d8-297a4bd99e9e",
      "name": "医師検索",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        960,
        1360
      ],
      "parameters": {
        "url": "https://api.betterdoctor.com/2016-03-01/doctors",
        "options": {},
        "queryParametersUi": {
          "parameter": [
            {
              "name": "specialty_uid",
              "value": "={{ $json.analysis.specialist_needed === 'Cardiologist' ? 'cardiologist' : $json.analysis.specialist_needed === 'Dermatologist' ? 'dermatologist' : $json.analysis.specialist_needed === 'Neurologist' ? 'neurologist' : $json.analysis.specialist_needed === 'Orthopedist' ? 'orthopedic-surgeon' : $json.analysis.specialist_needed === 'Gastroenterologist' ? 'gastroenterologist' : $json.analysis.specialist_needed === 'Pulmonologist' ? 'pulmonologist' : 'family-practitioner' }}"
            },
            {
              "name": "location",
              "value": "={{ $json.location || 'New York, NY' }}"
            },
            {
              "name": "limit",
              "value": "5"
            },
            {
              "name": "user_key",
              "value": "YOUR_BETTERDOCTOR_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a30ea8a7-1943-4549-9da1-a0d2372979db",
      "name": "緊急対応作成",
      "type": "n8n-nodes-base.code",
      "position": [
        1180,
        1160
      ],
      "parameters": {
        "jsCode": "// Create emergency response\nconst patientData = items[0].json;\nconst symptoms = patientData.symptoms;\nconst analysis = patientData.analysis;\n\nconst emergencyMessage = `🚨 *URGENT MEDICAL ATTENTION NEEDED* 🚨\\n\\n` +\n  `⚠️ Based on your symptoms, you may need immediate medical care.\\n\\n` +\n  `📋 *Your Symptoms:*\\n${symptoms}\\n\\n` +\n  `🏥 *PLEASE DO ONE OF THE FOLLOWING IMMEDIATELY:*\\n` +\n  `• Call emergency services (911/108)\\n` +\n  `• Go to nearest emergency room\\n` +\n  `• Contact your doctor immediately\\n\\n` +\n  `⚠️ *This is an automated assessment. Trust your instincts - if you feel something is seriously wrong, seek immediate medical attention.*\\n\\n` +\n  `📱 Emergency Contact: 911 (US) | 108 (India)`;\n\nreturn [{\n  json: {\n    phone_number: patientData.phone,\n    email: patientData.email,\n    message: emergencyMessage,\n    type: 'emergency',\n    patient_data: patientData\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "1dbb9438-396b-4fc5-9a4a-7d493db64c47",
      "name": "医療応答のフォーマット",
      "type": "n8n-nodes-base.code",
      "position": [
        1180,
        1360
      ],
      "parameters": {
        "jsCode": "// Format doctor recommendations and medical advice\nconst patientData = $node[\"Parse Medical Analysis\"].json;\nconst doctorsData = items[0].json;\nconst analysis = patientData.analysis;\n\n// Format doctors list\nlet doctorsList = '';\nif (doctorsData.data && doctorsData.data.length > 0) {\n  doctorsList = doctorsData.data.slice(0, 3).map((doctor, index) => {\n    const name = `${doctor.profile.first_name} ${doctor.profile.last_name}`;\n    const specialty = doctor.specialties[0]?.name || 'General Practice';\n    const phone = doctor.practices[0]?.phones[0]?.number || 'Not available';\n    const address = doctor.practices[0]?.visit_address ? \n      `${doctor.practices[0].visit_address.street}, ${doctor.practices[0].visit_address.city}` : \n      'Address not available';\n    \n    return `${index + 1}. *Dr. ${name}*\\n` +\n           `   🏥 ${specialty}\\n` +\n           `   📞 ${phone}\\n` +\n           `   📍 ${address}\\n`;\n  }).join('\\n');\n} else {\n  doctorsList = 'No doctors found in your area. Please search online or contact your local healthcare directory.';\n}\n\n// Create comprehensive medical response\nconst urgencyEmoji = {\n  'low': '🟢',\n  'medium': '🟡', \n  'high': '🟠',\n  'emergency': '🔴'\n};\n\nconst message = `🏥 *Medical Assessment Results*\\n\\n` +\n  `📋 *Your Symptoms:*\\n${patientData.symptoms}\\n\\n` +\n  `${urgencyEmoji[analysis.urgency_level]} *Urgency Level:* ${analysis.urgency_level.toUpperCase()}\\n\\n` +\n  `🔍 *Possible Conditions:*\\n${analysis.possible_conditions.map(condition => `• ${condition}`).join('\\n')}\\n\\n` +\n  `👨‍⚕️ *Recommended Specialist:* ${analysis.specialist_needed}\\n\\n` +\n  `💡 *Assessment:*\\n${analysis.severity_assessment}\\n\\n` +\n  `✅ *Recommended Actions:*\\n${analysis.recommended_actions.map(action => `• ${action}`).join('\\n')}\\n\\n`;\n\nlet fullMessage = message;\n\nif (analysis.red_flags && analysis.red_flags.length > 0) {\n  fullMessage += `⚠️ *Warning Signs:*\\n${analysis.red_flags.map(flag => `• ${flag}`).join('\\n')}\\n\\n`;\n}\n\nfullMessage += `👩‍⚕️ *Recommended Doctors Near You:*\\n${doctorsList}\\n\\n` +\n  `⚠️ *Important Disclaimer:*\\n` +\n  `This is an AI-generated assessment and should NOT replace professional medical advice. ` +\n  `Always consult with qualified healthcare providers for proper diagnosis and treatment.\\n\\n` +\n  `🆘 *If you experience severe symptoms or feel this is an emergency, ` +\n  `call emergency services immediately.*`;\n\nreturn [{\n  json: {\n    phone_number: patientData.phone,\n    email: patientData.email,\n    message: fullMessage,\n    type: 'medical_advice',\n    patient_data: patientData,\n    doctors: doctorsData.data || []\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "e88d7db7-1932-49dd-8899-b655fa35309a",
      "name": "WhatsApp 利用可否確認",
      "type": "n8n-nodes-base.if",
      "position": [
        1400,
        1260
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.phone_number }}",
              "operation": "isNotEmpty"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a96b2f32-8df3-4788-85d5-ced36ff2a9d0",
      "name": "WhatsApp メッセージ準備",
      "type": "n8n-nodes-base.code",
      "position": [
        1620,
        1160
      ],
      "parameters": {
        "jsCode": "// Prepare WhatsApp message payload\nconst data = items[0].json;\n\nreturn [{\n  json: {\n    messaging_product: \"whatsapp\",\n    to: data.phone_number,\n    type: \"text\",\n    text: {\n      body: data.message\n    }\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "d9824a6d-3782-4653-b492-088b4fb2689a",
      "name": "WhatsApp 応答送信",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1840,
        1160
      ],
      "parameters": {
        "url": "https://graph.facebook.com/v17.0/YOUR_PHONE_NUMBER_ID/messages",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "df7d3ba7-fd59-4c61-849d-f6b378f091d1",
      "name": "メール応答送信",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1840,
        1360
      ],
      "parameters": {
        "html": "={{ $json.message.replace(/\\n/g, '<br>').replace(/\\*/g, '') }}",
        "options": {
          "allowUnauthorizedCerts": true
        },
        "subject": "🏥 Your Medical Assessment & Doctor Recommendations",
        "toEmail": "={{ $json.email }}",
        "fromEmail": "medical-bot@yourdomain.com"
      },
      "credentials": {
        "smtp": {
          "id": "G1kyF8cSWTZ4vouN",
          "name": "SMTP -test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "38d61048-6dce-417e-ac59-8343bfea7851",
      "name": "成功応答",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2060,
        1260
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={{ { \"status\": \"success\", \"message\": \"Medical assessment sent successfully\", \"urgency_level\": $json.patient_data ? $json.patient_data.analysis.urgency_level : 'unknown', \"timestamp\": new Date().toISOString() } }}"
      },
      "typeVersion": 1
    },
    {
      "id": "e8bf4043-7a7a-45bb-93e0-f821f5f1febe",
      "name": "医療ボット概要",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        700
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 400,
        "content": "## 🏥 AI Symptom Checker & Doctor Suggestion\n\n**Complete Medical Assistant Workflow:**\n\n🔍 **Symptom Analysis** - AI analyzes symptoms with urgency assessment\n👨‍⚕️ **Doctor Matching** - Finds relevant specialists in user's area\n📱 **Multi-Channel Delivery** - Sends via WhatsApp + Email\n🚨 **Emergency Detection** - Identifies urgent cases automatically\n📊 **Data Logging** - Tracks consultations for analytics\n\n✅ HIPAA-compliant data handling\n✅ Professional medical disclaimers\n✅ Emergency response protocols"
      },
      "typeVersion": 1
    },
    {
      "id": "13fa264a-485b-4fa1-8458-2d8f1b74c1a5",
      "name": "セットアップガイド",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        260
      ],
      "parameters": {
        "color": 7,
        "width": 680,
        "height": 560,
        "content": "## 🛠️ Setup Requirements:\n\n**APIs & Services:**\n1. **BetterDoctor API** - Doctor directory (free tier)\n2. **WhatsApp Business API** - Meta Developer account\n3. **SMTP Email** - For email notifications\n4. **Ollama** - Local AI model\n\n**Input Format (Webhook):**\n```json\n{\n  \"symptoms\": \"headache, fever, nausea\",\n  \"age\": 30,\n  \"gender\": \"male\",\n  \"duration\": \"2 days\",\n  \"phone\": \"+1234567890\",\n  \"email\": \"user@email.com\",\n  \"location\": \"New York, NY\"\n}\n```\n\n**Test URL:**\nPOST https://your-n8n-instance.com/webhook/symptom-checker-webhook"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "27ec8d81-3686-4bf6-b767-b808b5328bf6",
  "connections": {
    "87c59d4b-098d-4884-80d8-297a4bd99e9e": {
      "main": [
        [
          {
            "node": "1dbb9438-396b-4fc5-9a4a-7d493db64c47",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "15555bde-19dc-4278-b32b-e7601807cc6c": {
      "main": [
        [
          {
            "node": "a30ea8a7-1943-4549-9da1-a0d2372979db",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "87c59d4b-098d-4884-80d8-297a4bd99e9e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "73fc058d-d6ff-477d-826a-c1e050312f13": {
      "ai_languageModel": [
        [
          {
            "node": "d0f553ed-cb9f-458e-b4be-9facd5a9ce8a",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "d0f553ed-cb9f-458e-b4be-9facd5a9ce8a": {
      "main": [
        [
          {
            "node": "ce5d7cce-602e-4ca1-a565-15256a13fc6a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "df7d3ba7-fd59-4c61-849d-f6b378f091d1": {
      "main": [
        [
          {
            "node": "38d61048-6dce-417e-ac59-8343bfea7851",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "388c6212-65d0-47a4-a28a-f7bf9dd5c789": {
      "main": [
        [
          {
            "node": "d0f553ed-cb9f-458e-b4be-9facd5a9ce8a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ce5d7cce-602e-4ca1-a565-15256a13fc6a": {
      "main": [
        [
          {
            "node": "15555bde-19dc-4278-b32b-e7601807cc6c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d9824a6d-3782-4653-b492-088b4fb2689a": {
      "main": [
        [
          {
            "node": "38d61048-6dce-417e-ac59-8343bfea7851",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1dbb9438-396b-4fc5-9a4a-7d493db64c47": {
      "main": [
        [
          {
            "node": "e88d7db7-1932-49dd-8899-b655fa35309a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e88d7db7-1932-49dd-8899-b655fa35309a": {
      "main": [
        [
          {
            "node": "a96b2f32-8df3-4788-85d5-ced36ff2a9d0",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "df7d3ba7-fd59-4c61-849d-f6b378f091d1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a96b2f32-8df3-4788-85d5-ced36ff2a9d0": {
      "main": [
        [
          {
            "node": "d9824a6d-3782-4653-b492-088b4fb2689a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a30ea8a7-1943-4549-9da1-a0d2372979db": {
      "main": [
        [
          {
            "node": "e88d7db7-1932-49dd-8899-b655fa35309a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - サポートチャットボット, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

関連ワークフロー

WhatsApp上のAI映画推薦ツール
WhatsApp上のAI映画推薦アシスタント
If
Set
Code
+
If
Set
Code
20 ノードOneclick AI Squad
サポートチャットボット
AIを活用した書籍おすすめエンジン
メールベースの書籍推薦システム(Ollama LLM と OpenLibrary API 使用)
If
Set
Code
+
If
Set
Code
21 ノードOneclick AI Squad
サポートチャットボット
財務・会計向けAI駆動型請求書リマインダーと支払い追跡ツール
財務・会計業務向けに設計されたAIベースの請求書リマインダーと支払い追跡ツール
If
Set
Code
+
If
Set
Code
35 ノードOneclick AI Squad
請求書処理
スマートなアクティビティフォローとソーシャルアシスタント
マルチチャネルアプローチ(GPT-4、LinkedIn、HubSpot)によるイベントフォローアップの自動化
Code
Filter
Hubspot
+
Code
Filter
Hubspot
25 ノードOneclick AI Squad
リードナーチャリング
AIを活用したリード生成による不動産権益メールと電話販売
Llama AI、VAPIコール、Gmailマーケティングで不動産マーケティングを自動化する
Code
Wait
Gmail
+
Code
Wait
Gmail
23 ノードOneclick AI Squad
リードナーチャリング
AI ソーシャルメディア自動返信プラグイン(Instagram、Facebook、WhatsApp)
Instagram、Facebook、WhatsApp をサポートする Llama 3.2 ベースの AI によるソーシャルメディアメッセージ自動返信システム
Code
Switch
Webhook
+
Code
Switch
Webhook
12 ノードOneclick AI Squad
サポートチャットボット
ワークフロー情報
難易度
中級
ノード数15
カテゴリー2
ノードタイプ9
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

作成者
Oneclick AI Squad

Oneclick AI Squad

@oneclick-ai

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34