{
    "info": {
        "_postman_id": "1c9f92db387936d1a056ca5d53b33212",
        "name": "Clinic API - Laravel",
        "description": "Generated Postman collection for the Laravel Clinic API.",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{token}}",
                "type": "string"
            }
        ]
    },
    "variable": [
        {
            "key": "baseUrl",
            "value": "http://127.0.0.1:8000/api/v1",
            "type": "string"
        },
        {
            "key": "token",
            "value": "",
            "type": "string"
        },
        {
            "key": "tenantSlug",
            "value": "",
            "type": "string"
        },
        {
            "key": "tenantId",
            "value": "",
            "type": "string"
        },
        {
            "key": "userId",
            "value": "",
            "type": "string"
        },
        {
            "key": "doctorEmail",
            "value": "doctor@example.com",
            "type": "string"
        },
        {
            "key": "doctorPassword",
            "value": "secret123",
            "type": "string"
        },
        {
            "key": "receptionistEmail",
            "value": "reception@example.com",
            "type": "string"
        },
        {
            "key": "receptionistPassword",
            "value": "secret123",
            "type": "string"
        },
        {
            "key": "patientId",
            "value": "",
            "type": "string"
        },
        {
            "key": "staffId",
            "value": "",
            "type": "string"
        },
        {
            "key": "appointmentId",
            "value": "",
            "type": "string"
        },
        {
            "key": "visitId",
            "value": "",
            "type": "string"
        },
        {
            "key": "walkInVisitId",
            "value": "",
            "type": "string"
        },
        {
            "key": "diagnosisId",
            "value": "",
            "type": "string"
        },
        {
            "key": "visitMedicationId",
            "value": "",
            "type": "string"
        },
        {
            "key": "prescriptionId",
            "value": "",
            "type": "string"
        },
        {
            "key": "invoiceId",
            "value": "",
            "type": "string"
        },
        {
            "key": "fromDate",
            "value": "",
            "type": "string"
        },
        {
            "key": "toDate",
            "value": "",
            "type": "string"
        },
        {
            "key": "scheduledAt",
            "value": "",
            "type": "string"
        },
        {
            "key": "rescheduledAt",
            "value": "",
            "type": "string"
        }
    ],
    "item": [
        {
            "name": "Auth",
            "item": [
                {
                    "name": "POST /auth/register",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/auth/register",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"clinicName\": \"Clinic API\",\n    \"ownerName\": \"Dr Ahmed\",\n    \"email\": \"{{doctorEmail}}\",\n    \"password\": \"{{doctorPassword}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "prerequest",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.collectionVariables.set(\"doctorEmail\", \"doctor\" + Date.now() + \"@example.com\");"
                                ]
                            }
                        },
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  pm.collectionVariables.set('token', json.token);",
                                    "  pm.collectionVariables.set('tenantSlug', json.tenantSlug);",
                                    "  pm.collectionVariables.set('tenantId', json.tenantId);",
                                    "  pm.collectionVariables.set('userId', json.userId);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "POST /auth/login",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/auth/login",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"{{doctorEmail}}\",\n    \"password\": \"{{doctorPassword}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  pm.collectionVariables.set('token', json.token);",
                                    "  pm.collectionVariables.set('tenantSlug', json.tenantSlug);",
                                    "  pm.collectionVariables.set('tenantId', json.tenantId);",
                                    "  pm.collectionVariables.set('userId', json.userId);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "GET /me",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/me"
                    }
                },
                {
                    "name": "POST /auth/request-password-reset",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/auth/request-password-reset",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"{{doctorEmail}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    }
                }
            ]
        },
        {
            "name": "Tenant and Team",
            "item": [
                {
                    "name": "POST /tenant/provision",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/tenant/provision",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"schedule\": {\n        \"days\": [\n            {\n                \"day\": \"sunday\",\n                \"isOpen\": true,\n                \"openMinute\": 540,\n                \"closeMinute\": 1020\n            },\n            {\n                \"day\": \"monday\",\n                \"isOpen\": true,\n                \"openMinute\": 540,\n                \"closeMinute\": 1020\n            },\n            {\n                \"day\": \"tuesday\",\n                \"isOpen\": true,\n                \"openMinute\": 540,\n                \"closeMinute\": 1020\n            },\n            {\n                \"day\": \"wednesday\",\n                \"isOpen\": true,\n                \"openMinute\": 540,\n                \"closeMinute\": 1020\n            },\n            {\n                \"day\": \"thursday\",\n                \"isOpen\": true,\n                \"openMinute\": 540,\n                \"closeMinute\": 1020\n            },\n            {\n                \"day\": \"friday\",\n                \"isOpen\": false,\n                \"openMinute\": 540,\n                \"closeMinute\": 1020\n            },\n            {\n                \"day\": \"saturday\",\n                \"isOpen\": true,\n                \"openMinute\": 540,\n                \"closeMinute\": 1020\n            }\n        ]\n    },\n    \"visitTypes\": [\n        {\n            \"id\": \"first\",\n            \"name\": \"First visit\",\n            \"feePiastres\": 30000,\n            \"durationMinutes\": 30\n        }\n    ],\n    \"seedSampleData\": false\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "GET /tenant/staff",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/tenant/staff"
                    }
                },
                {
                    "name": "POST /tenant/staff",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/tenant/staff",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": \"Sara Reception\",\n    \"email\": \"{{receptionistEmail}}\",\n    \"password\": \"{{receptionistPassword}}\",\n    \"role\": \"receptionist\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "prerequest",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.collectionVariables.set(\"receptionistEmail\", \"reception\" + Date.now() + \"@example.com\");"
                                ]
                            }
                        },
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('staffId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "PUT /tenant/staff/{{staffId}}",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/tenant/staff/{{staffId}}",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": \"Sara Reception Updated\",\n    \"email\": \"{{receptionistEmail}}\",\n    \"password\": \"\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "GET /tenant/visit-types",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/tenant/visit-types"
                    }
                },
                {
                    "name": "PUT /tenant/visit-types",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/tenant/visit-types",
                        "body": {
                            "mode": "raw",
                            "raw": "[\n    {\n        \"id\": \"first\",\n        \"name\": \"First visit\",\n        \"kind\": \"firstVisit\",\n        \"feePiastres\": 30000,\n        \"durationMinutes\": 30\n    },\n    {\n        \"id\": \"follow\",\n        \"name\": \"Follow up\",\n        \"kind\": \"followUp\",\n        \"feePiastres\": 15000,\n        \"durationMinutes\": 20\n    }\n]",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "GET /tenant/working-hours",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/tenant/working-hours"
                    }
                },
                {
                    "name": "PUT /tenant/working-hours",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/tenant/working-hours",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"days\": [\n        {\n            \"day\": \"sunday\",\n            \"isOpen\": true,\n            \"openMinute\": 540,\n            \"closeMinute\": 1020\n        },\n        {\n            \"day\": \"monday\",\n            \"isOpen\": true,\n            \"openMinute\": 540,\n            \"closeMinute\": 1020\n        },\n        {\n            \"day\": \"tuesday\",\n            \"isOpen\": true,\n            \"openMinute\": 540,\n            \"closeMinute\": 1020\n        },\n        {\n            \"day\": \"wednesday\",\n            \"isOpen\": true,\n            \"openMinute\": 540,\n            \"closeMinute\": 1020\n        },\n        {\n            \"day\": \"thursday\",\n            \"isOpen\": true,\n            \"openMinute\": 540,\n            \"closeMinute\": 1020\n        },\n        {\n            \"day\": \"friday\",\n            \"isOpen\": false,\n            \"openMinute\": 540,\n            \"closeMinute\": 1020\n        },\n        {\n            \"day\": \"saturday\",\n            \"isOpen\": true,\n            \"openMinute\": 540,\n            \"closeMinute\": 1020\n        }\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "Dashboard",
            "item": [
                {
                    "name": "GET /dashboard",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/dashboard"
                    }
                }
            ]
        },
        {
            "name": "Patients",
            "item": [
                {
                    "name": "GET /patients",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients"
                    }
                },
                {
                    "name": "POST /patients",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"fullName\": \"Mohamed Ali\",\n    \"dateOfBirth\": \"1985-03-12T00:00:00Z\",\n    \"gender\": \"male\",\n    \"phone\": \"01001234567\",\n    \"bloodType\": \"a_pos\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('patientId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "GET /patients/{{{patientId}}}",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{{patientId}}}"
                    }
                },
                {
                    "name": "PUT /patients/{{{patientId}}}",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{{patientId}}}",
                        "body": {
                            "mode": "raw",
                            "raw": "{}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "PATCH /patients/{{{patientId}}}",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{{patientId}}}",
                        "body": {
                            "mode": "raw",
                            "raw": "{}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "GET /patients/{{patientId}}/prescriptions",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/prescriptions"
                    }
                },
                {
                    "name": "GET /patients/{{patientId}}/visits",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/visits"
                    }
                }
            ]
        },
        {
            "name": "Medical Records",
            "item": [
                {
                    "name": "GET /patients/{{patientId}}/medical-record",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record"
                    }
                },
                {
                    "name": "PUT /patients/{{patientId}}/medical-record/allergies",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/allergies",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"substance\": \"Penicillin\",\n    \"severity\": \"severe\",\n    \"reaction\": \"Rash\",\n    \"notes\": null,\n    \"notedAt\": \"2024-02-01T00:00:00Z\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('allergyId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "PUT /patients/{{patientId}}/medical-record/chronic-conditions",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/chronic-conditions",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": \"Diabetes\",\n    \"sinceYear\": 2018,\n    \"notes\": null\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('chronicConditionId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "PUT /patients/{{patientId}}/medical-record/family",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/family",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"condition\": \"Hypertension\",\n    \"relation\": \"father\",\n    \"notes\": null\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('familyId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "PUT /patients/{{patientId}}/medical-record/medications",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/medications",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"drugName\": \"Metformin\",\n    \"dose\": \"500mg\",\n    \"frequency\": \"twice daily\",\n    \"startedAt\": \"2020-01-01T00:00:00Z\",\n    \"notes\": null\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('currentMedicationId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "PUT /patients/{{patientId}}/medical-record/surgical",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/surgical",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"procedure\": \"Appendectomy\",\n    \"date\": \"2015-06-10T00:00:00Z\",\n    \"hospital\": \"General Hospital\",\n    \"surgeon\": \"Dr X\",\n    \"notes\": null\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('surgicalId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "PUT /patients/{{patientId}}/medical-record/vaccinations",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/vaccinations",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": \"COVID-19\",\n    \"dateGiven\": \"2021-08-01T00:00:00Z\",\n    \"notes\": null\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('vaccinationId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                }
            ]
        },
        {
            "name": "Appointments",
            "item": [
                {
                    "name": "GET /appointments",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/appointments"
                    }
                },
                {
                    "name": "POST /appointments",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/appointments",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"patientId\": \"{{patientId}}\",\n    \"patientName\": \"Mohamed Ali Updated\",\n    \"scheduledAt\": \"{{scheduledAt}}\",\n    \"durationMinutes\": 30,\n    \"visitType\": \"firstVisit\",\n    \"notes\": \"Initial booking\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "prerequest",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const start = new Date(Date.now() + 24 * 60 * 60 * 1000);",
                                    "start.setMinutes(15, 0, 0);",
                                    "pm.collectionVariables.set('scheduledAt', start.toISOString());",
                                    "pm.collectionVariables.set('fromDate', new Date(start.getTime() - 60 * 60 * 1000).toISOString());",
                                    "pm.collectionVariables.set('toDate', new Date(start.getTime() + 24 * 60 * 60 * 1000).toISOString());",
                                    "const rescheduled = new Date(start.getTime() + 60 * 60 * 1000);",
                                    "pm.collectionVariables.set('rescheduledAt', rescheduled.toISOString());"
                                ]
                            }
                        },
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('appointmentId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "GET /appointments/visit-type-options",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/appointments/visit-type-options"
                    }
                },
                {
                    "name": "GET /appointments/{{appointmentId}}",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/appointments/{{appointmentId}}"
                    }
                },
                {
                    "name": "PATCH /appointments/{{appointmentId}}/reschedule",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/appointments/{{appointmentId}}/reschedule",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"scheduledAt\": \"{{rescheduledAt}}\",\n    \"durationMinutes\": 30\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "PATCH /appointments/{{appointmentId}}/status",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/appointments/{{appointmentId}}/status",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"status\": \"arrived\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "Visits",
            "item": [
                {
                    "name": "GET /visits/active",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/active"
                    }
                },
                {
                    "name": "POST /visits/start-from-appointment",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/start-from-appointment",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"appointmentId\": \"{{appointmentId}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('visitId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "POST /visits/start-walk-in",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/start-walk-in",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"patientId\": \"{{patientId}}\",\n    \"patientName\": \"Mohamed Ali Updated\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('walkInVisitId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "GET /visits/{{visitId}}",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}"
                    }
                },
                {
                    "name": "PATCH /visits/{{visitId}}/chief-complaint",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/chief-complaint",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"complaint\": \"Headache\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "PATCH /visits/{{visitId}}/clinical-notes",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/clinical-notes",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"notes\": \"Clinical notes here\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "POST /visits/{{visitId}}/complete",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/complete",
                        "body": {
                            "mode": "raw",
                            "raw": "{}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "PUT /visits/{{visitId}}/diagnoses",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/diagnoses",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"diagnosis\": {\n        \"name\": \"Migraine\",\n        \"icdCode\": \"G43\",\n        \"notes\": null,\n        \"isPrimary\": true\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json.diagnoses && json.diagnoses.length) pm.collectionVariables.set('diagnosisId', json.diagnoses[0].id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "PATCH /visits/{{visitId}}/follow-up",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/follow-up",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"date\": \"2026-06-22T00:00:00Z\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "PUT /visits/{{visitId}}/prescriptions",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/prescriptions",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"item\": {\n        \"medicationName\": \"Drug A\",\n        \"dosage\": \"10mg\",\n        \"frequency\": \"daily\",\n        \"durationDays\": 5,\n        \"route\": \"oral\",\n        \"instructions\": \"after food\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json.prescriptions && json.prescriptions.length) pm.collectionVariables.set('visitMedicationId', json.prescriptions[0].id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "POST /visits/{{visitId}}/sign",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/sign",
                        "body": {
                            "mode": "raw",
                            "raw": "{}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "PATCH /visits/{{visitId}}/treatment-plan",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/treatment-plan",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"plan\": \"Rest and follow up\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "PATCH /visits/{{visitId}}/vitals",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/vitals",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"vitals\": {\n        \"weightKg\": 82.5,\n        \"heightCm\": 175,\n        \"temperatureC\": 37,\n        \"systolicBp\": 120,\n        \"diastolicBp\": 80,\n        \"pulseRate\": 72,\n        \"respiratoryRate\": 16,\n        \"oxygenSaturation\": 98,\n        \"recordedAt\": \"2026-05-22T10:22:00Z\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "Prescriptions",
            "item": [
                {
                    "name": "POST /prescriptions",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/prescriptions",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"patientId\": \"{{patientId}}\",\n    \"patientName\": \"Mohamed Ali Updated\",\n    \"items\": [\n        {\n            \"medicationName\": \"Drug A\",\n            \"activeIngredient\": \"Drug A\",\n            \"dosage\": \"10mg\",\n            \"frequency\": \"daily\",\n            \"durationDays\": 5,\n            \"route\": \"oral\",\n            \"instructions\": \"after food\",\n            \"quantity\": 5\n        }\n    ],\n    \"visitId\": \"{{visitId}}\",\n    \"diagnosis\": \"Migraine\",\n    \"notes\": \"Prescription notes\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('prescriptionId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "GET /prescriptions",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/prescriptions"
                    }
                },
                {
                    "name": "POST /prescriptions/check-allergy-conflicts",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/prescriptions/check-allergy-conflicts",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"items\": [\n        {\n            \"medicationName\": \"Penicillin 500\",\n            \"activeIngredient\": \"Penicillin\",\n            \"dosage\": \"500mg\",\n            \"frequency\": \"twice daily\",\n            \"durationDays\": 7\n        }\n    ],\n    \"patientAllergies\": [\n        {\n            \"substance\": \"Penicillin\",\n            \"severity\": \"severe\"\n        }\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "GET /prescriptions/{{prescriptionId}}",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/prescriptions/{{prescriptionId}}"
                    }
                }
            ]
        },
        {
            "name": "Invoices",
            "item": [
                {
                    "name": "GET /invoices",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/invoices"
                    }
                },
                {
                    "name": "POST /invoices",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/invoices",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"patientName\": \"Mohamed Ali Updated\",\n    \"amountPiastres\": 30000,\n    \"status\": \"paid\",\n    \"description\": \"First visit\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "if (pm.response.code >= 200 && pm.response.code < 300) {",
                                    "  const json = pm.response.json();",
                                    "  if (json && json.id) pm.collectionVariables.set('invoiceId', json.id);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "PUT /invoices/{{invoiceId}}",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/invoices/{{invoiceId}}",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"patientName\": \"Mohamed Ali Updated\",\n    \"amountPiastres\": 30000,\n    \"status\": \"pending\",\n    \"description\": \"First visit\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "Cleanup and Optional Deletes",
            "item": [
                {
                    "name": "POST /auth/logout",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/auth/logout",
                        "body": {
                            "mode": "raw",
                            "raw": "{}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "DELETE /tenant/staff/{{staffId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/tenant/staff/{{staffId}}"
                    }
                },
                {
                    "name": "DELETE /patients/{{{patientId}}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{{patientId}}}"
                    }
                },
                {
                    "name": "DELETE /patients/{{patientId}}/medical-record/allergies/{{allergyId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/allergies/{{allergyId}}"
                    }
                },
                {
                    "name": "DELETE /patients/{{patientId}}/medical-record/chronic-conditions/{{chronicConditionId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/chronic-conditions/{{chronicConditionId}}"
                    }
                },
                {
                    "name": "DELETE /patients/{{patientId}}/medical-record/family/{{familyId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/family/{{familyId}}"
                    }
                },
                {
                    "name": "DELETE /patients/{{patientId}}/medical-record/medications/{{currentMedicationId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/medications/{{currentMedicationId}}"
                    }
                },
                {
                    "name": "DELETE /patients/{{patientId}}/medical-record/surgical/{{surgicalId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/surgical/{{surgicalId}}"
                    }
                },
                {
                    "name": "DELETE /patients/{{patientId}}/medical-record/vaccinations/{{vaccinationId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/patients/{{patientId}}/medical-record/vaccinations/{{vaccinationId}}"
                    }
                },
                {
                    "name": "PATCH /appointments/{{appointmentId}}/cancel",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/appointments/{{appointmentId}}/cancel",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"reason\": \"Patient requested cancellation\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "DELETE /visits/{{visitId}}/diagnoses/{{diagnosisId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/diagnoses/{{diagnosisId}}"
                    }
                },
                {
                    "name": "DELETE /visits/{{visitId}}/prescriptions/{{visitMedicationId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/visits/{{visitId}}/prescriptions/{{visitMedicationId}}"
                    }
                },
                {
                    "name": "PATCH /prescriptions/{{prescriptionId}}/cancel",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/prescriptions/{{prescriptionId}}/cancel",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"reason\": \"Patient requested cancellation\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "DELETE /invoices/{{invoiceId}}",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json",
                                "type": "text"
                            },
                            {
                                "key": "X-Tenant",
                                "value": "{{tenantSlug}}",
                                "type": "text"
                            }
                        ],
                        "url": "{{baseUrl}}/invoices/{{invoiceId}}"
                    }
                }
            ]
        }
    ]
}