Patients

Patients represent individuals who receive prescriptions through the Quincy platform. This page documents the API endpoints for managing patient records, including creating, retrieving, updating, and searching for patients.

POST/v1/patients

Create a patient

This endpoint allows you to create a new patient record in the Quincy system.

Required attributes

  • Name
    firstname
    Type
    string
    Description

    The patient's first name.

  • Name
    lastname
    Type
    string
    Description

    The patient's last name.

  • Name
    dob
    Type
    date
    Description

    The patient's date of birth.

  • Name
    sex
    Type
    string
    Description

    The patient's sex. Either Male or Female or Other.

  • Name
    email
    Type
    string
    Description

    The patient's email address.

  • Name
    phone
    Type
    string
    Description

    The patient's phone number.

  • Name
    address_line1
    Type
    string
    Description

    First line of the patient's address.

  • Name
    city
    Type
    string
    Description

    The patient's city of residence.

  • Name
    postcode
    Type
    string
    Description

    The patient's postal code.

  • Name
    country
    Type
    string
    Description

    The patient's country of residence.

Optional attributes

  • Name
    source_id
    Type
    string
    Description

    The source ID for the patient record if it was created via an external system.

  • Name
    address_line2
    Type
    string
    Description

    Second line of the patient's address.

  • Name
    nhs_number
    Type
    string
    Description

    The patient's NHS number.

  • Name
    allergies
    Type
    string
    Description

    List of the patient's known allergies.

Request

POST
/v1/patients
curl https://app.quincy.health/api/v1/patients \
  -H "Authorization: Bearer {token}" \
  -d firstname="John" \
  -d lastname="Doe" \
  -d dob="1980-01-01" \
  -d sex="Male" \
  -d email="[email protected]" \
  -d phone="+441234567890" \
  -d address_line1="123 Main St" \
  -d city="London" \
  -d postcode="SW1A 1AA" \
  -d country="United Kingdom" \
  -d source_id="4b7d8f76d43546edbc921fdca69a45e4"

Response

{
  "id": "PAT12345",
  "firstname": "John",
  "lastname": "Doe",
  "dob": "1980-01-01",
  "sex": "Male",
  "email": "[email protected]",
  "phone": "+441234567890",
  "address_line1": "123 Main St",
  "city": "London",
  "postcode": "SW1A 1AA",
  "country": "United Kingdom",
  "source_id": "4b7d8f76d43546edbc921fdca69a45e4",
  "created_at": "2023-06-20T10:00:00Z",
  "updated_at": "2023-06-20T10:00:00Z"
}

GET/v1/patients

Search patients

This endpoint allows you to search for patients based on various criteria. You can search by name, date of birth, NHS number, or other identifiers. Results are paginated with 15 items per page by default.

Optional parameters

  • Name
    query
    Type
    string
    Description

    Search query (e.g., Name, NHS number, Source ID).

  • Name
    page
    Type
    integer
    Description

    The page number you want to retrieve (default: 1).

  • Name
    limit
    Type
    integer
    Description

    Number of items to return per page (default: 15).

Request

GET
/v1/patients
curl -G https://app.quincy.health/api/v1/patients \
  -H "Authorization: Bearer {token}" \
  -d query="John" \
  -d page=1 \
  -d limit=15

Response

{
  "data": [
    {
      "id": "PAT12345",
      "firstname": "John",
      "lastname": "Smith",
      "dob": "1980-01-01",
      "sex": "Male",
      "email": "[email protected]",
      "phone": "01923 811 291",
      "address_line1": "123 Main St",
      "address_line2": null,
      "city": "London",
      "postcode": "SW1A 1AA",
      "country": "United Kingdom",
      "source_id": "4b7d8f76d43546edbc921fdca69a45e4",
      "created_at": "2024-01-28T23:24:51.000000Z",
      "updated_at": "2024-01-28T23:24:51.000000Z"
    }
  ],
  "links": {
    "first": "http://app.quincy.health/api/v1/patients?query=John&page=1",
    "last": "http://app.quincy.health/api/v1/patients?query=John&page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "per_page": 15,
    "to": 1,
    "total": 1,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "http://app.quincy.health/api/v1/patients?query=John&page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ]
  }
}

GET/v1/patients/:id

Retrieve a patient

This endpoint allows you to retrieve a patient's details by providing their unique identifier.

Request

GET
/v1/patients/PAT12345
curl https://app.quincy.health/api/v1/patients/PAT12345 \
  -H "Authorization: Bearer {token}"

Response

{
  "id": "PAT12345",
  "firstname": "John",
  "lastname": "Doe",
  "dob": "1980-01-01",
  "sex": "Male",
  "email": "[email protected]",
  "phone": "+441234567890",
  "address_line1": "123 Main St",
  "city": "London",
  "postcode": "SW1A 1AA",
  "country": "United Kingdom",
  "nhs_number": "1234567890",
  "allergies": "Penicillin",
  "source_id": "4b7d8f76d43546edbc921fdca69a45e4",
  "created_at": "2023-06-20T10:00:00Z",
  "updated_at": "2023-06-20T10:00:00Z"
}

The patient model

The patient model contains essential information about individuals receiving prescriptions through the Quincy platform. This includes personal details, contact information, and medical history.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the patient.

  • Name
    firstname
    Type
    string
    Description

    The patient's first name.

  • Name
    lastname
    Type
    string
    Description

    The patient's last name.

  • Name
    dob
    Type
    date
    Description

    The patient's date of birth.

  • Name
    sex
    Type
    string
    Description

    The patient's sex.

  • Name
    email
    Type
    string
    Description

    The patient's email address.

  • Name
    phone
    Type
    string
    Description

    The patient's phone number.

  • Name
    address_line1
    Type
    string
    Description

    First line of the patient's address.

  • Name
    address_line2
    Type
    string
    Description

    Second line of the patient's address (optional).

  • Name
    city
    Type
    string
    Description

    The patient's city of residence.

  • Name
    postcode
    Type
    string
    Description

    The patient's postal code.

  • Name
    country
    Type
    string
    Description

    The patient's country of residence.

  • Name
    nhs_number
    Type
    string
    Description

    The patient's NHS number (if applicable).

  • Name
    allergies
    Type
    string
    Description

    List of the patient's known allergies.

  • Name
    source_id
    Type
    string
    Description

    The source ID for the patient record if it was created via an external system.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the patient record was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the patient record was last updated.