PDF VectorとHIPAA準拠で医療文書から臨床データを抽出
中級
これはDocument Extraction, AI Summarization, Multimodal AI分野の自動化ワークフローで、9個のノードを含みます。主にIf, Code, Postgres, GoogleDrive, ManualTriggerなどのノードを使用。 PDF Vector と HIPAA 準拠を使用して医療文書から臨床データを抽出
前提条件
- •PostgreSQLデータベース接続情報
- •Google Drive API認証情報
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"meta": {
"instanceId": "placeholder"
},
"nodes": [
{
"id": "overview-note",
"name": "HIPAA概要",
"type": "n8n-nodes-base.stickyNote",
"position": [
50,
50
],
"parameters": {
"color": 1,
"width": 350,
"height": 200,
"content": "## 🏥 Medical Records Processor\n\n⚠️ **HIPAA COMPLIANT WORKFLOW**\n\n• **Secure** SFTP intake only\n• **Extracts** clinical data with PHI removal\n• **Codes** ICD-10 & CPT automatically\n• **Formats** HL7 FHIR standard\n• **Integrates** with Epic/Cerner"
},
"typeVersion": 1
},
{
"id": "security-note",
"name": "セキュリティ要件",
"type": "n8n-nodes-base.stickyNote",
"position": [
50,
270
],
"parameters": {
"color": 1,
"width": 280,
"height": 180,
"content": "## 🔐 Security Setup\n\n**REQUIRED:**\n• Encryption at rest\n• TLS 1.3 minimum\n• Audit logging ON\n• PHI de-identification\n• Access controls\n\n⚠️ Review with compliance!"
},
"typeVersion": 1
},
{
"id": "coding-note",
"name": "臨床コード",
"type": "n8n-nodes-base.stickyNote",
"position": [
650,
450
],
"parameters": {
"width": 260,
"height": 150,
"content": "## 📋 Clinical Coding\n\n**Automatic mapping:**\n• Diagnoses → ICD-10\n• Procedures → CPT\n• Medications → NDC\n\n💡 No PHI in logs!"
},
"typeVersion": 1
},
{
"id": "manual-trigger",
"name": "手動トリガー",
"type": "n8n-nodes-base.manualTrigger",
"notes": "Process medical record",
"position": [
250,
300
],
"parameters": {},
"typeVersion": 1
},
{
"id": "google-drive",
"name": "Google Drive - 医療記録取得",
"type": "n8n-nodes-base.googleDrive",
"notes": "Retrieve record from Drive",
"position": [
450,
300
],
"parameters": {
"fileId": "={{ $json.fileId }}",
"operation": "download"
},
"typeVersion": 3
},
{
"id": "pdfvector-extract",
"name": "PDF Vector - 医療データ抽出",
"type": "n8n-nodes-pdfvector.pdfVector",
"notes": "Extract medical information",
"position": [
650,
300
],
"parameters": {
"prompt": "Extract medical information from this document or image including patient ID (not name), visit date, chief complaint, diagnoses with ICD codes, medications with dosages, vital signs, lab results with values and reference ranges, procedures performed, and follow-up instructions. Do not extract patient names, SSN, or other identifying information. Use OCR if this is a scanned document or medical image.",
"schema": "{\"type\":\"object\",\"properties\":{\"patientRecord\":{\"type\":\"object\",\"properties\":{\"patientId\":{\"type\":\"string\"},\"visitDate\":{\"type\":\"string\"},\"visitType\":{\"type\":\"string\"},\"provider\":{\"type\":\"string\"},\"facility\":{\"type\":\"string\"}}},\"clinicalData\":{\"type\":\"object\",\"properties\":{\"chiefComplaint\":{\"type\":\"string\"},\"historyOfPresentIllness\":{\"type\":\"string\"},\"reviewOfSystems\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}},\"diagnoses\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"description\":{\"type\":\"string\"},\"icdCode\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"},\"status\":{\"type\":\"string\"}}}},\"medications\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"dosage\":{\"type\":\"string\"},\"frequency\":{\"type\":\"string\"},\"route\":{\"type\":\"string\"},\"startDate\":{\"type\":\"string\"},\"status\":{\"type\":\"string\"}}}},\"vitalSigns\":{\"type\":\"object\",\"properties\":{\"bloodPressure\":{\"type\":\"string\"},\"heartRate\":{\"type\":\"string\"},\"temperature\":{\"type\":\"string\"},\"respiratoryRate\":{\"type\":\"string\"},\"oxygenSaturation\":{\"type\":\"string\"},\"weight\":{\"type\":\"string\"},\"height\":{\"type\":\"string\"},\"bmi\":{\"type\":\"string\"}}},\"labResults\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"testName\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"},\"unit\":{\"type\":\"string\"},\"referenceRange\":{\"type\":\"string\"},\"flag\":{\"type\":\"string\"},\"collectionDate\":{\"type\":\"string\"}}}},\"procedures\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"cptCode\":{\"type\":\"string\"},\"date\":{\"type\":\"string\"}}}},\"plan\":{\"type\":\"object\",\"properties\":{\"followUp\":{\"type\":\"string\"},\"instructions\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"referrals\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}}},\"required\":[\"patientRecord\",\"diagnoses\"],\"additionalProperties\":false}",
"resource": "document",
"inputType": "file",
"operation": "extract",
"binaryPropertyName": "data"
},
"typeVersion": 1
},
{
"id": "process-validate",
"name": "データ処理・検証",
"type": "n8n-nodes-base.code",
"notes": "Validate and prepare data",
"position": [
850,
300
],
"parameters": {
"jsCode": "// Process and validate medical data\nconst medicalData = $input.first().json.data;\n\n// Create audit log entry\nconst auditLog = {\n action: 'Medical Record Processed',\n timestamp: new Date().toISOString(),\n recordType: 'Clinical Document',\n patientId: medicalData.patientRecord.patientId,\n userId: 'system-automated',\n ipAddress: 'internal-process'\n};\n\n// Validate critical fields\nconst validationResults = {\n hasPatientId: !!medicalData.patientRecord?.patientId,\n hasVisitDate: !!medicalData.patientRecord?.visitDate,\n hasDiagnoses: medicalData.diagnoses?.length > 0,\n hasValidIcdCodes: true\n};\n\n// Validate ICD codes format\nif (medicalData.diagnoses) {\n medicalData.diagnoses.forEach(diagnosis => {\n if (diagnosis.icdCode && !diagnosis.icdCode.match(/^[A-Z][0-9]{2}(\\.[0-9]{1,2})?$/)) {\n validationResults.hasValidIcdCodes = false;\n }\n });\n}\n\n// Flag abnormal lab results\nconst abnormalLabs = [];\nif (medicalData.labResults) {\n medicalData.labResults.forEach(lab => {\n if (lab.flag && (lab.flag === 'H' || lab.flag === 'L' || lab.flag === 'Critical')) {\n abnormalLabs.push({\n test: lab.testName,\n value: lab.value,\n flag: lab.flag\n });\n }\n });\n}\n\n// Check for drug interactions (simplified)\nconst medications = medicalData.medications || [];\nconst potentialInteractions = [];\n// This is a simplified check - in production, use a proper drug interaction API\nif (medications.length > 1) {\n // Example: Check for common dangerous combinations\n const medNames = medications.map(m => m.name.toLowerCase());\n if (medNames.some(m => m.includes('warfarin')) && medNames.some(m => m.includes('aspirin'))) {\n potentialInteractions.push('Warfarin + Aspirin: Increased bleeding risk');\n }\n}\n\n// Prepare processed record\nconst processedRecord = {\n // Core data\n patientRecord: medicalData.patientRecord,\n clinicalData: medicalData.clinicalData,\n diagnoses: medicalData.diagnoses,\n medications: medicalData.medications,\n vitalSigns: medicalData.vitalSigns,\n labResults: medicalData.labResults,\n procedures: medicalData.procedures,\n plan: medicalData.plan,\n \n // Analysis results\n alerts: {\n abnormalLabs,\n potentialInteractions\n },\n \n // Metadata\n validation: validationResults,\n processedAt: new Date().toISOString(),\n dataClassification: 'PHI - Protected Health Information',\n retentionYears: 7,\n \n // Compliance\n auditLog\n};\n\nreturn [{ json: processedRecord }];"
},
"typeVersion": 2
},
{
"id": "check-valid",
"name": "有効な記録?",
"type": "n8n-nodes-base.if",
"position": [
1050,
300
],
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $json.validation.hasPatientId }}",
"value2": true
},
{
"value1": "={{ $json.validation.hasDiagnoses }}",
"value2": true
}
]
},
"combineOperation": "all"
},
"typeVersion": 1
},
{
"id": "secure-storage",
"name": "セキュアデータベースに保存",
"type": "n8n-nodes-base.postgres",
"notes": "HIPAA-compliant storage",
"position": [
1250,
250
],
"parameters": {
"table": "medical_records",
"columns": "patient_id,visit_date,diagnoses,medications,lab_results,processed_at,data_classification",
"operation": "insert"
},
"typeVersion": 1
}
],
"connections": {
"check-valid": {
"main": [
[
{
"node": "secure-storage",
"type": "main",
"index": 0
}
],
[]
]
},
"manual-trigger": {
"main": [
[
{
"node": "google-drive",
"type": "main",
"index": 0
}
]
]
},
"process-validate": {
"main": [
[
{
"node": "check-valid",
"type": "main",
"index": 0
}
]
]
},
"google-drive": {
"main": [
[
{
"node": "pdfvector-extract",
"type": "main",
"index": 0
}
]
]
},
"pdfvector-extract": {
"main": [
[
{
"node": "process-validate",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - 文書抽出, AI要約, マルチモーダルAI
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
PDFベクトル、Google Drive、データベースを使用した領秤データの抽出と保存
PDFベクトル、Google Drive、データベースを使って領収書データを抽出・保存する
If
Code
Slack
+
If
Code
Slack
26 ノードPDF Vector
請求書処理
PDF Vector と Google Drive を使用した自動領収書処理と税務分類
PDF Vector と Google Drive を使った自動化領収書処理と税区分
Code
Google Drive
Google Sheets
+
Code
Google Drive
Google Sheets
9 ノードPDF Vector
請求書処理
エンタープライズ契約ライフサイクル管理とAIによるリスク分析
エンタープライズ契約ライフサイクル管理とAIリスク解析
If
Code
Merge
+
If
Code
Merge
20 ノードPDF Vector
文書抽出
PDF Vector AIで文書から法律引用を抽出・検証
PDF Vector AIでドキュメントから法引用を抽出し、検証する
If
Code
Google Drive
+
If
Code
Google Drive
8 ノードPDF Vector
文書抽出
GPT-4と複数のデータベース検索を使った学術文献综述の自動化
GPT-4と複数のデータベース検索を使った学術文献レビューの自動化
If
Set
Code
+
If
Set
Code
13 ノードPDF Vector
文書抽出
GPT-4、PDFVector、PostgreSQLエクスポートを使用して文書からデータを抽出
ドキュメントからデータをGPT-4、PDFVector、PostgreSQLで出力する
Code
Open Ai
Switch
+
Code
Open Ai
Switch
9 ノードPDF Vector
文書抽出
ワークフロー情報
難易度
中級
ノード数9
カテゴリー3
ノードタイプ7
作成者
PDF Vector
@pdfvectorA fully featured PDF APIs for developers - Parse any PDF or Word document, extract structured data, and access millions of academic papers - all through simple APIs.
外部リンク
n8n.ioで表示 →
このワークフローを共有