Skip to content

api patients

github-actions[bot] edited this page Oct 23, 2023 · 3 revisions

Schema

flowchart TB
 PTNS{{/api/patients}} -- Read All --> MRAPTNS{GET} ---> PTNS_READALL{{/}}
 PTNS -- Read One --> MROPTNS{GET} ---> PTNS_READONE{{/:id}}
 PTNS -- Appointment --> MAPTNS{GET} ---> PTNS_APP{{/appointment}}
 PTNS -- Create --> MCPTNS{PST} --> MWCPTNS[[Create]] --> PTNS_CREATE{{/add}}
 PTNS -- Update --> MUPTNS{PUT} --> MWUPTNS[[Update]] --> PTN_UPDATE{{/:id}}
 PTNS -- Delete --> MDPTNS{DEL} ---> PTNS_DEL{{/:id}}

click PTNS_READALL "#read-all"
click PTNS_READONE "#read-one"
click PTNS_APP "#appointment"
click PTNS_CREATE "#create"
click PTN_UPDATE "#update"
click PTNS_DEL "#delete"
Loading

Middleware

Information

The middlewares are used to check if the request body is valid. Return a 406 NOT_ACCEPTABLE error if the request body is invalid. Else, the request is passed to the next middleware.

Create

Check if the request body is valid.

{
    "name": "string",
    "lastName": "string",
    "birthDate": "YYYY-MM-DD",
    "sex": "string",
    "email": "string",
    "phone": "string",
    "address": "string",
    "city": "string",
    "job": "string",
    "doctor": "string",
    "passif": "string",
}

Update

Check if the request body is valid.

{
    "name": "string",
    "lastName": "string",
    "birthDate": "YYYY-MM-DD",
    "sex": "string",
    "email": "string",
    "phone": "string",
    "address": "string",
    "city": "string",
    "job": "string",
    "doctor": "string",
    "passif": "string",
}

Endpoints

Read All

Return all patients

[
    {
    "id": "[0-9a-fA-F]{8}",
    "name": "string",
    "lastName": "string",
    "birthDate": "YYYY-MM-DD",
    "sex": "string",
    "email": "string",
    "phone": "string",
    "address": "string",
    "city": "string",
    "job": "string",
    "doctor": "string",
    "passif": "string",
    },
    ...
]

Read One

Return one patient.

{
    "id": "[0-9a-fA-F]{8}",
    "name": "string",
    "lastName": "string",
    "birthDate": "YYYY-MM-DD",
    "sex": "string",
    "email": "string",
    "phone": "string",
    "address": "string",
    "city": "string",
    "job": "string",
    "doctor": "string",
    "passif": "string",
}

Clone this wiki locally