Patients

Patients are scoped to your organization and branch (or org-wide when patient centralization is enabled).

The patients model

Properties

  • Name
    id
    Type
    string
    Description

    Patient UUID.

  • Name
    patientName
    Type
    string
    Description

    Display name.

  • Name
    patientNumber
    Type
    string
    Description

    Branch patient number.

  • Name
    category
    Type
    string
    Description

    RED_FLAG, YELLOW_FLAG, or GREEN_FLAG.

  • Name
    branchId
    Type
    string
    Description

    Owning branch.


GET/api/patients

List patients

Paginated list with search and filters. See Pagination guide.

Query parameters

Query parameters: page, pageSize, search, branchId.

Request

GET
/api/patients
curl -X GET http://localhost:3000/api/patients \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "patientName": "Ahmad bin Ali",
      "patientEmail": "ahmad@example.com",
      "patientPhone": "+60123456789",
      "patientNumber": "P-00042",
      "category": "GREEN_FLAG",
      "branchId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "branchName": "Main Branch",
      "corporate": null
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 20,
    "total": 1,
    "totalPages": 1
  }
}

POST/api/patients

Create patient

Requires patientName. Optional branchId when centralization allows.

Request

POST
/api/patients
curl -X POST http://localhost:3000/api/patients \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d "{\"patientName\":\"Ahmad bin Ali\"}"

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "patientName": "Ahmad bin Ali",
  "patientNumber": "P-00043",
  "branchId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "category": "GREEN_FLAG",
  "createdAt": "2026-10-05T06:30:00.000Z"
}

GET/api/patients/:id

Retrieve patient

Full chart includes drug history, medical history, corporate link.

Request

GET
/api/patients/:id
curl -X GET http://localhost:3000/api/patients/:id \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "patientName": "Ahmad bin Ali",
  "patientNumber": "P-00042",
  "category": "GREEN_FLAG",
  "PatientDrugHistory": [],
  "PatientMedicalHistory": [],
  "Corporate": null
}

PATCH/api/patients/:id

Update patient

Partial update for demographics, category, assigned doctor, allergies.

Request

PATCH
/api/patients/:id
curl -X PATCH http://localhost:3000/api/patients/:id \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "patientName": "Ahmad bin Ali",
  "category": "YELLOW_FLAG"
}

POST/api/patients/check-in

Check-in

MyKad / front-desk check-in flow.

Request

POST
/api/patients/check-in
curl -X POST http://localhost:3000/api/patients/check-in \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "patient": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "patientName": "Ahmad bin Ali"
  },
  "queue": {
    "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "queueNumber": 12,
    "status": "WAITING"
  }
}

POST/api/patients/create-and-queue

Create and queue

Register patient and add to queue in one step.

Request

POST
/api/patients/create-and-queue
curl -X POST http://localhost:3000/api/patients/create-and-queue \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "patient": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "patientName": "Ahmad bin Ali",
    "patientNumber": "P-00044"
  },
  "queue": {
    "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "queueNumber": 13,
    "status": "WAITING"
  }
}

GET/api/patients/:id/clinical-notes

Clinical notes

List clinical notes for a patient.

Request

GET
/api/patients/:id/clinical-notes
curl -X GET http://localhost:3000/api/patients/:id/clinical-notes \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "data": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "note": "Follow-up in two weeks.",
      "createdAt": "2026-10-05T06:30:00.000Z",
      "author": {
        "fullName": "Dr. Lee"
      }
    }
  ]
}

GET/api/patients/:id/prescriptions

Prescriptions

Prescription history.

Request

GET
/api/patients/:id/prescriptions
curl -X GET http://localhost:3000/api/patients/:id/prescriptions \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "data": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "medications": [
        {
          "name": "Paracetamol 500mg",
          "dosage": "1 tab TDS"
        }
      ],
      "prescribedAt": "2026-10-05T06:30:00.000Z"
    }
  ]
}

POST/api/patients/:id/mc

Medical certificates

Issue an MC for the patient.

Request

POST
/api/patients/:id/mc
curl -X POST http://localhost:3000/api/patients/:id/mc \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "patientId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "startDate": "2026-10-05",
  "endDate": "2026-10-06",
  "days": 2,
  "status": "ACTIVE"
}

Was this page helpful?