# workflow_versions

workflow_id: 2Hm7ZkoJgEsG9QBy
workflow_name: [TEST] Session Cleanup - Telemetry Test
trigger: full_update
created_at: 2025-11-12 16:00:19
workflow_snapshot:
  {"updatedAt":"2025-11-12T15:59:46.856Z","createdAt":"2025-10-13T09:14:55.735Z","id":"2Hm7ZkoJgEsG9QBy","name":"[TEST] Session Cleanup - Telemetry Test","active":false,"isArchived":false,"nodes":[{"id":"start-node","name":"Manual Trigger","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[250,300],"parameters":{}},{"id":"set-node","name":"Test Data","type":"n8n-nodes-base.set","typeVersion":3,"position":[450,300],"parameters":{"assignments":{"assignments":[{"id":"test-1","name":"message","value":"Version 12","type":"string"},{"id":"test-2","name":"version","value":"2.19.2","type":"string"}]}}}],"connections":{"Manual Trigger":{"main":[[{"node":"Test Data","type":"main","index":0}]]}},"settings":{"saveExecutionProgress":true,"saveManualExecutions":true,"saveDataErrorExecution":"all","saveDataSuccessExecution":"all","executionOrder":"v1"},"staticData":null,"meta":null,"pinData":null,"versionId":"cb6c9001-8663-43cb-bf6f-646f295712e8","versionCounter":4,"triggerCount":0,"shared":[{"updatedAt":"2025-10-13T09:14:55.738Z","createdAt":"2025-10-13T09:14:55.738Z","role":"workflow:owner","workflowId":"2Hm7ZkoJgEsG9QBy","projectId":"K0HtvGddtPI24Iyt","project":{"updatedAt":"2025-10-03T09:49:33.347Z","createdAt":"2025-10-03T09:48:05.062Z","id":"K0HtvGddtPI24Iyt","name":"Romuald Członkowski <romuald@n8n-mcp.com>","type":"personal","icon":null,"description":null,"projectRelations":[{"updatedAt":"2025-10-03T09:48:05.063Z","createdAt":"2025-10-03T09:48:05.063Z","userId":"ebb1bcfe-d103-4506-a994-9b18ef25e289","projectId":"K0HtvGddtPI24Iyt","user":{"updatedAt":"2025-11-12T12:53:40.000Z","createdAt":"2025-10-03T09:48:04.462Z","id":"ebb1bcfe-d103-4506-a994-9b18ef25e289","email":"romuald@n8n-mcp.com","firstName":"Romuald","lastName":"Członkowski","personalizationAnswers":{"version":"v4","personalization_survey_submitted_at":"2025-10-03T09:49:36.595Z","personalization_survey_n8n_version":"1.113.3"},"settings":{"userActivated":true,"firstSuccessfulWorkflowId":"DWyvSVPDFSSo9jwN","userActivatedAt":1759494619257,"easyAIWorkflowOnboarded":true,"npsSurvey":{"waitingForResponse":true,"ignoredCount":1,"lastShownAt":1762117185907}},"disabled":false,"mfaEnabled":false,"lastActiveAt":"2025-11-11","isPending":false}}]}}],"tags":[]}


workflow_id: bP0W2MsqeSbHYIXE
workflow_name: GET /patients - List All Patients
trigger: partial_update
created_at: 2025-11-12 16:24:14
workflow_snapshot:
  {"updatedAt":"2025-11-12T16:22:46.000Z","createdAt":"2025-10-17T15:12:23.346Z","id":"bP0W2MsqeSbHYIXE","name":"GET /patients - List All Patients","active":true,"isArchived":false,"nodes":[{"parameters":{"path":"patients","responseMode":"responseNode","options":{}},"id":"webhook_trigger","name":"GET /patients","type":"n8n-nodes-base.webhook","typeVersion":2.1,"position":[176,368],"webhookId":"2408796d-487b-4f69-8d3c-39aedd07c7f4","onError":"continueRegularOutput"},{"parameters":{"jsCode":"const webhookData = $('GET /patients').item.json;\nconst statusParam = webhookData.query?.status || 'active';\n\n// If status is 'all', don't filter by status\nif (statusParam === 'all') {\n  return [{\n    filter_by_status: false\n  }];\n}\n\nreturn [{\n  status: statusParam,\n  filter_by_status: true\n}];"},"id":"parse_query_params","name":"Parse Query Parameters","type":"n8n-nodes-base.code","typeVersion":2,"position":[1200,448],"onError":"continueRegularOutput"},{"parameters":{"url":"={{ 'https://xxciwnthnnywanbplqwg.supabase.co/rest/v1/patients?select=*,patient_approaches(approach_id,approaches(id,name,description))' + ($json.status ? '&status=eq.' + $json.status : '') }}","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Authorization","value":"={{ $('GET /patients').item.json.headers.authorization }}"},{"name":"apikey","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inh4Y2l3bnRobm55d2FuYnBscXdnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjAzMzM0NjYsImV4cCI6MjA3NTkwOTQ2Nn0.gVvLw4aHwKG3TFhoQv6MwvoennmFVgmbLTOOpZLBQO8"}]},"options":{"response":{"response":{"responseFormat":"json"}}}},"id":"get_patients","name":"Get Patients (HTTP)","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[1520,448],"alwaysOutputData":true},{"parameters":{"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"conditions":[{"id":"empty_check","leftValue":"={{ Array.isArray($json) ? $json.length === 0 : (Object.keys($json).length === 0 || $json === null || $json === undefined) }}","rightValue":true,"operator":{"type":"boolean","operation":"equals"}}],"combinator":"and"},"options":{}},"id":"check_empty_results","name":"Check If Patients Found","type":"n8n-nodes-base.if","typeVersion":2.2,"position":[2080,416],"onError":"continueErrorOutput"},{"parameters":{"respondWith":"json","responseBody":"={{ {\n  success: true,\n  data: [],\n  message: 'No patients found',\n  metadata: {\n    timestamp: new Date().toISOString(),\n    count: 0\n  }\n} }}","options":{}},"id":"empty_response","name":"Empty Results Response","type":"n8n-nodes-base.respondToWebhook","typeVersion":1.4,"position":[2560,352],"onError":"continueRegularOutput"},{"parameters":{"jsCode":"const patients = $input.all();\n\nreturn [{\n  success: true,\n  data: patients.map(p => {\n    const patient = p.json;\n    let approaches = [];\n    if (patient.patient_approaches && Array.isArray(patient.patient_approaches)) {\n      approaches = patient.patient_approaches.map(pa => ({\n        id: pa.approaches.id,\n        name: pa.approaches.name,\n        description: pa.approaches.description\n      }));\n    }\n    if (patient.patient_approaches) {\n      delete patient.patient_approaches;\n    }\n    return {\n      ...patient,\n      approaches: approaches\n    };\n  }),\n  message: 'Patients retrieved successfully',\n  metadata: {\n    timestamp: new Date().toISOString(),\n    count: patients.length\n  }\n}];"},"id":"format_response","name":"Format Response","type":"n8n-nodes-base.code","typeVersion":2,"position":[2560,560],"onError":"continueRegularOutput"},{"parameters":{"respondWith":"json","responseBody":"={{ JSON.stringify($json) }}","options":{}},"id":"success_response","name":"Success Response","type":"n8n-nodes-base.respondToWebhook","typeVersion":1.4,"position":[2784,560],"onError":"continueRegularOutput"},{"parameters":{"content":"**🌐 Punkt Wejścia - GET /patients**\n\nOdbiera żądanie GET do pobrania listy wszystkich pacjentów użytkownika.\n\n**Endpoint:** GET /webhook/631ffa3b-9085-43f9-96da-ce4e1262ee3a/patients\n\n**Parametry zapytania:**\n• status (opcjonalny): 'active' | 'archived' (domyślnie 'active')\n\n**Autoryzacja:** Bearer token (JWT)\n\n**Zwraca:** Dane z triggera → JWT Validation","height":860,"width":320,"color":2},"id":"03c0cab3-8ef1-4591-a0a2-68f09476da71","name":"📝 Dokumentacja: Webhook Trigger","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[96,-128]},{"parameters":{"content":"**🔧 Przetwarzanie Parametrów**\n\nParsuje parametry zapytania i przygotowuje filtr dla bazy danych.\n\n**Logika:**\n```javascript\nconst status = query.status || 'active';\nreturn {\n  userId: userData.user_id,\n  status: status\n};\n```\n\n**Domyślnie:** Zwraca tylko aktywnych pacjentów\n\n**Zwraca:** userId, status → Get Patients","height":864,"width":320,"color":3},"id":"03484625-3a56-4b62-b01e-07cfae522c92","name":"📝 Dokumentacja: Query Processing","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1104,-128]},{"parameters":{"content":"**💾 Pobieranie Pacjentów z Bazy**\n\nWykonuje zapytanie do Supabase REST API z JWT token.\n\n**Method:** GET\n**URL:** /rest/v1/patients\n**Headers:**\n• Authorization: User JWT token (enforces RLS)\n• apikey: Supabase anon key\n\n**Query:**\n• select=*\n• status=eq.{{status}} (optional)\n\n**RLS:** Automatycznie filtruje do pacjentów użytkownika przez JWT token\n\n**ZMIANA (2025-10-23):** Zastąpiono Supabase node → HTTP Request\n**Powód:** Supabase node używał service role key, który omijał RLS\n\n**Zwraca:** Array pacjentów (tylko użytkownika!)","height":864,"width":320,"color":7},"id":"3d7f520e-0a18-471d-9f07-3213b428a9dc","name":"📝 Dokumentacja: Database Query","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1440,-128]},{"parameters":{"content":"**✅ Sprawdzenie Wyniku**\n\nWeryfikuje czy znaleziono pacjentów.\n\n**Warunek:**\n• Output 0 (TRUE): Brak pacjentów → Empty Results Response\n• Output 1 (FALSE): Pacjenci znalezieni → Format Response\n\n**Logika:**\n```javascript\n$json.length === 0\n```\n\n**Zwraca:** Rozgałęzienie na podstawie wyniku","height":848,"width":320,"color":3},"id":"1480b847-b720-4103-9ae4-05fa8cc83e3b","name":"📝 Dokumentacja: Result Check","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1776,-112]},{"parameters":{"content":"**✨ Odpowiedzi HTTP**\n\n**Empty Results Response (200):**\n```json\n{\n  \"patients\": [],\n  \"count\": 0\n}\n```\n\n**Format Response:**\nFormatuje dane pacjentów:\n• id, name, pseudonym, age, status\n• approaches: [{id, name}]\n• created_at, updated_at\n\n**Success Response (200):**\n```json\n{\n  \"patients\": [...],\n  \"count\": N\n}\n```","height":848,"width":648,"color":4},"id":"f4fb7958-0241-48b1-9e4f-1bca2b6b4375","name":"📝 Dokumentacja: Responses","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[2128,-112]},{"parameters":{"content":"**🔐 Walidacja JWT i Autoryzacja**\n\nSprawdza ważność tokenu JWT i wydobywa dane użytkownika.\n\n**Sub-workflow:** JWT Validation Middleware (dL4gKHrO0Mtdhpmo)\n\n**Przepływ:**\n1. JWT Validation1 → sprawdza token\n2. Check JWT Error → weryfikuje błędy\n3. Jeśli błąd JWT → JWT Error Response (401)\n4. Jeśli auth error → Return Error (500)\n5. Jeśli sukces → Validate & Prepare Update\n\n**Output 0 (sukces):** userId, user data\n**Output 1 (błąd):** Error details\n\n**RLS:** Automatyczna weryfikacja własności pacjenta (user_id)","height":840,"width":736,"color":7},"id":"b742bdae-19cf-49a2-8694-6d3e5d5867d6","name":"📝 Dokumentacja: JWT Auth","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[416,-160]},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"strict"},"conditions":[{"leftValue":"={{ $json.error }}","rightValue":true,"operator":{"type":"boolean","operation":"equals"}}],"combinator":"and"},"options":{}},"id":"2a748c00-2892-470f-9df5-6274b7202c03","name":"Auth Failed?","type":"n8n-nodes-base.if","typeVersion":2,"position":[688,336]},{"parameters":{"respondWith":"json","responseBody":"={{ {\n  \"success\": false,\n  \"error\": {\n    \"code\": \"UNAUTHORIZED\",\n    \"message\": $json.error_message\n  },\n  \"metadata\": {\n    \"timestamp\": new Date().toISOString()\n  }\n} }}","options":{"responseCode":401}},"id":"342d6a34-6d71-4e49-a534-bea579fae1fb","name":"401 Unauthorized","type":"n8n-nodes-base.respondToWebhook","typeVersion":1.1,"position":[880,224]},{"parameters":{"respondWith":"json","responseBody":"={{ {\n  success: false,\n  error: {\n    code: 'UNAUTHORIZED',\n    message: 'Invalid or expired access token'\n  },\n  metadata: {\n    timestamp: new Date().toISOString()\n  }\n} }}","options":{"responseCode":401}},"id":"00b9aaec-4e74-4669-bc56-4b5b7386ad08","name":"Return Error","type":"n8n-nodes-base.respondToWebhook","typeVersion":1.4,"position":[688,544]},{"parameters":{"workflowId":{"__rl":true,"value":"dL4gKHrO0Mtdhpmo","mode":"list","cachedResultUrl":"/workflow/dL4gKHrO0Mtdhpmo","cachedResultName":"JWT Validation Middleware"},"workflowInputs":{"mappingMode":"defineBelow","value":{"headers":"={{ $json.headers }}","body":"={{ $json.body }}"},"matchingColumns":[],"schema":[{"id":"headers","displayName":"headers","required":false,"defaultMatch":false,"display":true,"canBeUsedToMatch":true,"type":"object"},{"id":"body","displayName":"body","required":false,"defaultMatch":false,"display":true,"canBeUsedToMatch":true},{"id":"params","displayName":"params","required":false,"defaultMatch":false,"display":true,"canBeUsedToMatch":true,"type":"object","removed":true}],"attemptToConvertTypes":false,"convertFieldsToString":true},"options":{}},"id":"5597ab35-f0f4-4379-8ece-319e8b9a65a0","name":"JWT Validation1","type":"n8n-nodes-base.executeWorkflow","typeVersion":1.3,"position":[512,432],"onError":"continueErrorOutput"},{"parameters":{"options":{}},"type":"n8n-nodes-base.httpRequest","typeVersion":4.3,"position":[1728,448],"id":"f08ccce7-2820-4a07-a6b6-d502903e39c0","name":"Get Thread Status (HTTP - Secure)"}],"connections":{"GET /patients":{"main":[[{"node":"JWT Validation1","type":"main","index":0}]]},"Parse Query Parameters":{"main":[[{"node":"Get Patients (HTTP)","type":"main","index":0}]]},"Get Patients (HTTP)":{"main":[[{"node":"Get Thread Status (HTTP - Secure)","type":"main","index":0}]]},"Check If Patients Found":{"main":[[{"node":"Empty Results Response","type":"main","index":0}],[{"node":"Format Response","type":"main","index":0}]]},"Format Response":{"main":[[{"node":"Success Response","type":"main","index":0}]]},"Auth Failed?":{"main":[[{"node":"401 Unauthorized","type":"main","index":0}],[{"node":"Parse Query Parameters","type":"main","index":0}]]},"JWT Validation1":{"main":[[{"node":"Auth Failed?","type":"main","index":0}],[{"node":"Return Error","type":"main","index":0}]]},"Get Thread Status (HTTP - Secure)":{"main":[[{"node":"Check If Patients Found","type":"main","index":0}]]}},"settings":{"saveExecutionProgress":true,"saveManualExecutions":true,"saveDataErrorExecution":"all","saveDataSuccessExecution":"all","executionOrder":"v1","callerPolicy":"workflowsFromSameOwner","availableInMCP":false,"errorWorkflow":"SR7ikNdko60G24uG"},"staticData":null,"meta":null,"pinData":{"GET /patients":[{"json":{"headers":{"host":"n8n.wooapp.eu","user-agent":"curl/8.7.1","accept":"*/*","authorization":"Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6ImgxRVRGRCtIYTBVN3MyNmciLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3h4Y2l3bnRobm55d2FuYnBscXdnLnN1cGFiYXNlLmNvL2F1dGgvdjEiLCJzdWIiOiI5M2M0NzAxNi0wY2FmLTQ1NjYtYWFkZS0yMDA4OGIyM2RhMTYiLCJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNzYwNzE4NjE5LCJpYXQiOjE3NjA3MTUwMTksImVtYWlsIjoicm9tdWFsZEBhaWFkdmlzb3JzLnBsIiwicGhvbmUiOiIiLCJhcHBfbWV0YWRhdGEiOnsicHJvdmlkZXIiOiJlbWFpbCIsInByb3ZpZGVycyI6WyJlbWFpbCJdfSwidXNlcl9tZXRhZGF0YSI6eyJlbWFpbCI6InJvbXVhbGRAYWlhZHZpc29ycy5wbCIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJpbnN0cnVjdGlvbnNfdmlld2VkIjpmYWxzZSwicGhvbmVfdmVyaWZpZWQiOmZhbHNlLCJzdWIiOiI5M2M0NzAxNi0wY2FmLTQ1NjYtYWFkZS0yMDA4OGIyM2RhMTYifSwicm9sZSI6ImF1dGhlbnRpY2F0ZWQiLCJhYWwiOiJhYWwxIiwiYW1yIjpbeyJtZXRob2QiOiJwYXNzd29yZCIsInRpbWVzdGFtcCI6MTc2MDcwMzY4OX1dLCJzZXNzaW9uX2lkIjoiYjNjZDMzMTUtNGZjYy00NTg1LTg4YjktMjY3MmUxNmRmODJjIiwiaXNfYW5vbnltb3VzIjpmYWxzZX0.OUDcRGH7591nG8JH280JjvCQiHsT73A8mC80lGH_OVM","via":"2.0 Caddy","x-forwarded-for":"87.207.177.66","x-forwarded-host":"n8n.wooapp.eu","x-forwarded-proto":"https","accept-encoding":"gzip"},"params":{},"query":{},"body":{},"webhookUrl":"https://n8n.wooapp.eu/webhook/patients","executionMode":"production"}}]},"versionId":"db23e1c5-691b-4b9e-b167-1b1a3c4e4c23","versionCounter":8,"triggerCount":1,"shared":[{"updatedAt":"2025-10-17T15:12:23.349Z","createdAt":"2025-10-17T15:12:23.349Z","role":"workflow:owner","workflowId":"bP0W2MsqeSbHYIXE","projectId":"sVGwG1Ss6aXKNorC","project":{"updatedAt":"2025-07-30T12:20:06.951Z","createdAt":"2025-07-30T12:18:11.485Z","id":"sVGwG1Ss6aXKNorC","name":"Rafał Dębski <rdebski90@gmail.com>","type":"personal","icon":null,"description":null,"projectRelations":[{"updatedAt":"2025-07-30T12:18:11.486Z","createdAt":"2025-07-30T12:18:11.486Z","userId":"512c6fc4-ef1e-46ec-99da-b435fcbf2339","projectId":"sVGwG1Ss6aXKNorC","user":{"updatedAt":"2025-11-11T23:00:41.000Z","createdAt":"2025-07-30T12:18:10.851Z","id":"512c6fc4-ef1e-46ec-99da-b435fcbf2339","email":"rdebski90@gmail.com","firstName":"Rafał","lastName":"Dębski","personalizationAnswers":{"version":"v4","personalization_survey_submitted_at":"2025-07-30T12:20:09.619Z","personalization_survey_n8n_version":"1.104.1"},"settings":{"userActivated":true,"easyAIWorkflowOnboarded":true,"firstSuccessfulWorkflowId":"gp796pP6j8IFZodb","userActivatedAt":1753881412699,"npsSurvey":{"responded":true,"lastShownAt":1755785806897},"dismissedCallouts":{"ragStarterCallout":true}},"disabled":false,"mfaEnabled":false,"lastActiveAt":"2025-11-11","isPending":false}}]}}],"tags":[{"updatedAt":"2025-10-15T09:41:37.430Z","createdAt":"2025-10-15T09:41:37.430Z","id":"ElqeP6a9h0QgrOdz","name":"documented"},{"updatedAt":"2025-11-11T20:13:17.394Z","createdAt":"2025-11-11T20:13:17.394Z","id":"H9O9hTnua4TEP227","name":"error_handler"},{"updatedAt":"2025-10-15T08:59:55.157Z","createdAt":"2025-10-15T08:59:55.157Z","id":"IakxFnVI8xqZDQZE","name":"tested"},{"updatedAt":"2025-10-15T08:03:11.202Z","createdAt":"2025-10-15T08:03:11.202Z","id":"imoCmf4e9O7UEhbR","name":"reviewed"}]}

operations:
  [{"type":"updateNode","nodeId":"f08ccce7-2820-4a07-a6b6-d502903e39c0","updates":{"parameters":{"url":"={{ const patients = $input.all(); const patientIds = patients.map(p => p.json.id).join(','); 'https://xxciwnthnnywanbplqwg.supabase.co/rest/v1/conversation_threads?patient_id=in.(' + patientIds + ')&select=id,patient_id,approach_id,status' }}","sendHeaders":true,"headerParameters":{"parameters":[{"name":"Authorization","value":"={{ $('GET /patients').item.json.headers.authorization }}"},{"name":"apikey","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inh4Y2l3bnRobm55d2FuYnBscXdnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjAzMzM0NjYsImV4cCI6MjA3NTkwOTQ2Nn0.gVvLw4aHwKG3TFhoQv6MwvoennmFVgmbLTOOpZLBQO8"}]},"options":{"response":{"response":{"responseFormat":"json"}}}}}},{"type":"updateNode","nodeId":"format_response","updates":{"parameters":{"jsCode":"const patients = $('Get Patients (HTTP)').all();\nconst threads = $('Get Thread Status (HTTP - Secure)').first().json;\n\n// Build a map: patientId -> approachId -> thread\nconst threadMap = {};\nif (Array.isArray(threads)) {\n  threads.forEach(thread => {\n    if (!threadMap[thread.patient_id]) {\n      threadMap[thread.patient_id] = {};\n    }\n    // Store only one thread per approach (priority: active threads)\n    const existing = threadMap[thread.patient_id][thread.approach_id];\n    if (!existing || (existing.thread_status === 'archived' && thread.status === 'active')) {\n      threadMap[thread.patient_id][thread.approach_id] = {\n        thread_id: thread.id,\n        thread_status: thread.status\n      };\n    }\n  });\n}\n\nreturn [{\n  success: true,\n  data: patients.map(p => {\n    const patient = p.json;\n    let approaches = [];\n    \n    if (patient.patient_approaches && Array.isArray(patient.patient_approaches)) {\n      approaches = patient.patient_approaches.map(pa => {\n        const approachId = pa.approaches.id;\n        const threadData = threadMap[patient.id]?.[approachId];\n        \n        const approachObj = {\n          id: approachId,\n          name: pa.approaches.name,\n          description: pa.approaches.description\n        };\n        \n        // Add thread data if it exists\n        if (threadData) {\n          approachObj.thread_id = threadData.thread_id;\n          approachObj.thread_status = threadData.thread_status;\n        }\n        \n        return approachObj;\n      });\n    }\n    \n    if (patient.patient_approaches) {\n      delete patient.patient_approaches;\n    }\n    \n    return {\n      ...patient,\n      approaches: approaches\n    };\n  }),\n  message: 'Patients retrieved successfully',\n  metadata: {\n    timestamp: new Date().toISOString(),\n    count: patients.length\n  }\n}];"}}}]


