Custom Field

A custom field is a user-defined data field that can be attached to one or more object types (patients, providers, supports, or medical centers).

The custom field model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the custom field.

  • Name
    object
    Type
    string
    Description

    Always 'custom_field'.

  • Name
    name
    Type
    string
    Description

    Display name for the field.

  • Name
    description
    Type
    string
    Description

    Description of the field (shown to users where applicable).

  • Name
    type
    Type
    string
    Description

    Data type for this field.

    Possible values:
    string
    number
    dropdown
    boolean
    date
  • Name
    required
    Type
    boolean
    Description

    Whether this field is required when the field is presented on its target objects.

  • Name
    options
    Type
    array of strings
    Description

    Only applies if type is 'dropdown'. List of allowed dropdown options.

  • Name
    placeholder
    Type
    string
    Description

    Only applies if type is 'string' or 'number'. Placeholder text shown in the UI.

  • Name
    auto_add_to
    Type
    array of strings
    Description

    List of object types this custom field should automatically be added to. Currently supported: patient, provider, support, and medical_center.

    Possible values:
    patient
    provider
    support
    medical_center
  • Name
    order
    Type
    number
    Description

    Sort order for displaying fields within the same object type.

  • Name
    status_history
    Type
    array of objects
    Description
    Status history of the custom_field.
  • Name
    created_by
    Type
    string
    Description

    Creator of the custom field.

  • Name
    created_at
    Type
    date-time
    Description

    Timestamp (in ISO 8601 format) of when the custom field was created.

  • Name
    last_updated_at
    Type
    date-time
    Description

    Timestamp (in ISO 8601 format) of when the custom field was last updated.

Response

{
  "id": "cfld_2UxtAULYUrX7GVsTKePy",
  "object": "custom_field",

  "name": "Referral Source",
  "description": "How the patient heard about the practice.",
  "type": "dropdown",
  "required": false,
  "options": ["Google", "Friend/Family", "Another provider", "Insurance directory", "Other"],
  "placeholder": "",

  "auto_add_to": ["patient"],
  "order": 10,

  "status_history": [
    {
      "status": "active",
      "changed_by": "user_xeDpGyt67wTor93qKtS7",
      "changed_at": "2024-04-10T13:20:21.724Z"
    }
  ],

  "created_by": "user_xeDpGyt67wTor93qKtS7",
  "created_at": "2024-04-10T13:20:21.724Z",
  "last_updated_at": "2024-04-10T13:20:21.724Z"
}

POST/v2/custom-fields

Create a custom field

Creates a new custom field.

Required attributes

    Optional attributes

    • Name
      name
      Type
      string
      Description

      Display name for the field.

    • Name
      description
      Type
      string
      Description

      Description of the field.

    • Name
      type
      Type
      string
      Description

      Data type for this field.

      Possible values:
      string
      number
      dropdown
      boolean
      date
    • Name
      required
      Type
      boolean
      Description

      Whether the field is required.

    • Name
      auto_add_to
      Type
      array of strings
      Description

      Which objects this field should be attached to automatically.

      Possible values:
      patient
      provider
      support
      medical_center
    • Name
      options
      Type
      array of strings
      Description

      Only applies if type is 'dropdown'.

    • Name
      placeholder
      Type
      string
      Description

      Only applies if type is 'string' or 'number'.

    Response

    {
      "id": "cfld_2UxtAULYUrX7GVsTKePy",
      "object": "custom_field",
    
      "name": "Referral Source",
      "description": "How the patient heard about the practice.",
      "type": "dropdown",
      "required": false,
      "options": ["Google", "Friend/Family", "Another provider", "Insurance directory", "Other"],
      "placeholder": "",
    
      "auto_add_to": ["patient"],
      "order": 10,
    
      "status_history": [
        {
          "status": "active",
          "changed_by": "user_xeDpGyt67wTor93qKtS7",
          "changed_at": "2024-04-10T13:20:21.724Z"
        }
      ],
    
      "created_by": "user_xeDpGyt67wTor93qKtS7",
      "created_at": "2024-04-10T13:20:21.724Z",
      "last_updated_at": "2024-04-10T13:20:21.724Z"
    }
    

    GET/v2/custom-fields/:id

    Retrieve a custom field

    Retrieves the specified custom field object.

    Response

    {
      "id": "cfld_2UxtAULYUrX7GVsTKePy",
      "object": "custom_field",
    
      "name": "Referral Source",
      "description": "How the patient heard about the practice.",
      "type": "dropdown",
      "required": false,
      "options": ["Google", "Friend/Family", "Another provider", "Insurance directory", "Other"],
      "placeholder": "",
    
      "auto_add_to": ["patient"],
      "order": 10,
    
      "status_history": [
        {
          "status": "active",
          "changed_by": "user_xeDpGyt67wTor93qKtS7",
          "changed_at": "2024-04-10T13:20:21.724Z"
        }
      ],
    
      "created_by": "user_xeDpGyt67wTor93qKtS7",
      "created_at": "2024-04-10T13:20:21.724Z",
      "last_updated_at": "2024-04-10T13:20:21.724Z"
    }
    

    POST/v2/custom-fields/:id

    Update a custom field

    Updates the specified custom field object by setting the values of the parameters passed. Any other parameters not provided will not be modified.

    Optional attributes

    • Name
      name
      Type
      string
      Description

      Display name for the field.

    • Name
      description
      Type
      string
      Description

      Description of the field.

    • Name
      type
      Type
      string
      Description

      Data type for this field.

      Possible values:
      string
      number
      dropdown
      boolean
      date
    • Name
      required
      Type
      boolean
      Description

      Whether the field is required.

    • Name
      options
      Type
      array of strings
      Description

      Only applies if type is 'dropdown'.

    • Name
      placeholder
      Type
      string
      Description

      Only applies if type is 'string' or 'number'.

    • Name
      auto_add_to
      Type
      array of strings
      Description

      Which objects this field should be attached to automatically.

      Possible values:
      patient
      provider
      support
      medical_center
    • Name
      old_index
      Type
      number
      Description

      Old sort order of custom field. Required if new_index is passed in.

    • Name
      new_index
      Type
      number
      Description

      New desired sort location of custom field. Required if old_index is passed in.

    • Name
      status
      Type
      string
      Description

      Updates the custom field status by appending a new entry in status_history.

      Possible values:
      active
      archived

    Response

    {
      "id": "cfld_2UxtAULYUrX7GVsTKePy",
      "object": "custom_field",
    
      "name": "Referral Source",
      "description": "How the patient heard about the practice.",
      "type": "dropdown",
      "required": false,
      "options": ["Google", "Friend/Family", "Another provider", "Insurance directory", "Other"],
      "placeholder": "",
    
      "auto_add_to": ["patient"],
      "order": 10,
    
      "status_history": [
        {
          "status": "active",
          "changed_by": "user_xeDpGyt67wTor93qKtS7",
          "changed_at": "2024-04-10T13:20:21.724Z"
        },
        {
          "status": "archived",
          "changed_by": "user_xeDpGyt67wTor93qKtS7",
          "changed_at": "2024-05-01T09:10:00.000Z"
        }
      ],
    
      "created_by": "user_xeDpGyt67wTor93qKtS7",
      "created_at": "2024-04-10T13:20:21.724Z",
      "last_updated_at": "2024-05-01T09:10:00.000Z"
    }
    

    GET/v2/custom-fields

    List all custom fields

    Returns a list of all custom fields. Pass attributes as query params to filter the list of custom fields.

    Optional query parameters

    • Name
      status
      Type
      string
      Description

      Filter by current status.

      Possible values:
      active
      archived
    • Name
      statuses
      Type
      array of strings
      Description

      Filter by current statuses

      Possible values:
      active
      archived
    • Name
      auto_add_to
      Type
      string
      Description

      Filter by object types the field is attached to.

      Possible values:
      patient
      provider
      support
      medical_center
    • Name
      type
      Type
      string
      Description

      Filter by field type.

      Possible values:
      string
      number
      dropdown
      boolean
      date

    Request

    GET
    /v2/custom-fields
    curl https://{{base_subdomain}}.avonhealth.com/v2/custom-fields?status=active&auto_add_to[0]=patient&type=dropdown \
      -H "Authorization: Bearer {{token}}" \
      -H "x-jwt: {{jwt}}"
    

    Response

    {
      "object": "list",
      "data": [
        {
          "id": "cfld_2UxtAULYUrX7GVsTKePy",
          "object": "custom_field",
          "name": "Referral Source",
          "description": "How the patient heard about the practice.",
          "type": "dropdown",
          "required": false,
          "options": ["Google", "Friend/Family", "Another provider", "Insurance directory", "Other"],
          "placeholder": "",
          "auto_add_to": ["patient"],
          "order": 10,
          "status_history": [
            {
              "status": "active",
              "changed_by": "user_xeDpGyt67wTor93qKtS7",
              "changed_at": "2024-04-10T13:20:21.724Z"
            }
          ],
          "created_by": "user_xeDpGyt67wTor93qKtS7",
          "created_at": "2024-04-10T13:20:21.724Z",
          "last_updated_at": "2024-04-10T13:20:21.724Z"
        }
      ]
    }