Extraction de données cliniques à partir de documents médicaux via PDF Vector et conformité HIPAA
Ceci est unDocument Extraction, AI Summarization, Multimodal AIworkflow d'automatisation du domainecontenant 9 nœuds.Utilise principalement des nœuds comme If, Code, Postgres, GoogleDrive, ManualTrigger. Extraire des données cliniques de documents médicaux avec PDF Vector et conformité HIPAA
- •Informations de connexion à la base de données PostgreSQL
- •Informations d'identification Google Drive API
Nœuds utilisés (9)
{
"meta": {
"instanceId": "placeholder"
},
"nodes": [
{
"id": "overview-note",
"name": "Aperçu 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": "Exigences de sécurité",
"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": "Codes cliniques",
"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": "Déclencheur manuel",
"type": "n8n-nodes-base.manualTrigger",
"notes": "Process medical record",
"position": [
250,
300
],
"parameters": {},
"typeVersion": 1
},
{
"id": "google-drive",
"name": "Google Drive - Obtenir dossier médical",
"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 - Extraire les données médicales",
"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": "Traiter et valider les données",
"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": "Enregistrement valide ?",
"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": "Stocker dans une base de données sécurisée",
"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
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Intermédiaire - Extraction de documents, Résumé IA, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
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.
Partager ce workflow