> ## Documentation Index
> Fetch the complete documentation index at: https://docs.byblend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a patient's risk factors

> Retrieve all risk factors, or risk factors of a specific type, for a patient.



## OpenAPI

````yaml /openapi-public.yml get /api/v1/patients/{patient_id}/risk_factors
openapi: 3.0.3
info:
  title: Blend API
  version: 1.0.0
  description: API for Blend
servers:
  - url: https://api.byblend.com
    description: Blend production server
security:
  - bearerAuth: []
tags:
  - name: Orders
    description: Order management endpoints
  - name: Patients
    description: Patient management endpoints
  - name: Reports
    description: Reporting endpoints
  - name: Products and Materials
    description: Product catalog and inventory endpoints
  - name: Electronic Prescriptions
    description: Electronic prescription management endpoints
  - name: Prescriptions
    description: Prescription management endpoints
  - name: Authentication
    description: Authentication endpoints
  - name: Notifications
    description: User management endpoints
  - name: Prescribers
paths:
  /api/v1/patients/{patient_id}/risk_factors:
    get:
      tags:
        - Patients
      summary: Get a patient's risk factors
      description: >-
        Retrieve all risk factors, or risk factors of a specific type, for a
        patient.
      parameters:
        - name: type
          in: query
          required: false
          description: >-
            Type of risk factor to retrieve, either 'allergy', 'condition', or
            'medication'
          schema:
            type: string
            example: allergy
        - name: patient_id
          in: path
          required: true
          description: >-
            Unique identifier for the patient, either UUID or external ID (e.g.
            my-patients-128318AA2) if you have provided one during patient
            creation or update.
          schema:
            type: string
            format: uuid
            example: 98cae3a3-996c-4bf5-9143-0ab6d98bc1d0
      responses:
        '200':
          description: >-
            Successful response with all risk factors, or specific type of risk
            factors.
          content:
            application/json:
              schema:
                oneOf:
                  - title: All Risk Factors
                    type: object
                    properties:
                      allergies:
                        type: array
                        items:
                          $ref: '#/components/schemas/RiskFactorAllergy'
                      conditions:
                        type: array
                        items:
                          $ref: '#/components/schemas/RiskFactorCondition'
                      medications:
                        type: array
                        items:
                          $ref: '#/components/schemas/RiskFactorMedication'
                  - title: Allergies
                    type: array
                    items:
                      $ref: '#/components/schemas/RiskFactorAllergy'
                  - title: Conditions
                    type: array
                    items:
                      $ref: '#/components/schemas/RiskFactorCondition'
                  - title: Medications
                    type: array
                    items:
                      $ref: '#/components/schemas/RiskFactorMedication'
components:
  schemas:
    RiskFactorAllergy:
      allOf:
        - $ref: '#/components/schemas/ID'
        - type: object
          properties:
            name:
              type: string
              example: Penicillin
              description: Name of the allergy
            type:
              type: string
              example: allergy
            matched:
              type: boolean
              example: true
              description: >-
                Whether the allergy has been matched to a known allergen in the
                Blend database
            original_name:
              type: string
              example: Peniccillin
              description: Original freeform text of the allergy, if matched
    RiskFactorCondition:
      allOf:
        - $ref: '#/components/schemas/ID'
        - type: object
          properties:
            name:
              type: string
              example: Diabetes mellitus
              description: Name of the condition
            type:
              type: string
              example: condition
            matched:
              type: boolean
              example: true
              description: >-
                Whether the condition has been matched to a known condition in
                the Blend database
            original_name:
              type: string
              example: diabetes
              description: Original freeform text of the condition, if matched
    RiskFactorMedication:
      allOf:
        - $ref: '#/components/schemas/RiskFactorParent'
        - type: object
          properties:
            medication_detail:
              type: object
              allOf:
                - $ref: '#/components/schemas/RiskFactorMedicationDetail'
    ID:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
    RiskFactorParent:
      description: Represents a mapping of risk factor to a patient.
      allOf:
        - $ref: '#/components/schemas/ID'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          properties:
            risk_factor_id:
              type: string
              example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
              description: >-
                Reference ID for the Blend database entry for this unique risk
                factor
        - $ref: '#/components/schemas/RiskFactorBase'
    RiskFactorMedicationDetail:
      type: object
      properties:
        brand_name:
          type: string
          example: Benadryl
          description: Brand name, if applicable, of the medication
        clinical_product_rxcui:
          type: string
          example: '978941'
          description: RXNorm CUI of the clinical product, if applicable
        ingredient_name:
          type: string
          example: diphenhydramine
          description: If applicable, ingredient name
        ingredient_rxcui:
          type: string
          example: '4083'
          description: RXNorm CUI of the ingredient, if applicable
        name:
          type: string
          example: estradiol valerate 3 MG Oral Tablet
          description: >-
            Representative name of the medication, typically ignored in DUR in
            favor of the clinical drug form
        normalization_key:
          type: string
          example: SCDG:1165185|generic
          description: Normalization key used to identify appropriate matches
        product_rxcui:
          type: string
          example: '978941'
          description: RxNorm CUI of the product, if applicable
        scdf_name:
          type: string
          example: estradiol Oral Tablet
          description: >-
            SCDF (Semantic Clinical Drug Form) name of the medication, if
            applicable
        scdf_rxcui:
          type: string
          example: '372078'
          description: >-
            SCDF (Semantic Clinical Drug Form) RXCUI of the medication, if
            applicable
        scdg_name:
          type: string
          example: estradiol Oral Product
          description: >-
            SCDG (Semantic Clinical Drug Group) name of the medication, if
            applicable
        scdg_rxcui:
          type: string
          example: '1165185'
          description: >-
            SCDG (Semantic Clinical Drug Group) RXCUI of the medication, if
            applicable
    Timestamps:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: Date and time of creation
          example: '2025-03-15T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Date and time of last update
          example: '2025-03-15T12:00:00Z'
    RiskFactorBase:
      type: object
      properties:
        confidence:
          type: number
          example: 0.95
          description: If matched, confidence score for the risk factor match
        is_active:
          type: boolean
          example: true
          description: >-
            Whether the risk factor is active. Risk factors can be manually
            deactivated if not applicable.
        match_source:
          type: string
          example: autocomplete
          description: Source of the match, one of `autocomplete`, `text`, or `manual`.
        match_type:
          type: string
          example: product
          description: For medications, type of match.
        matched:
          type: boolean
          example: true
          description: >-
            If the risk factor has been matched to a representative entry.
            Autocomplete matches are always true, as are 1.0 confidence matches,
            and manual confirmations.
        matched_via_synonym:
          type: boolean
          example: false
          description: >-
            If the risk factor was matched via a synonym lookup to a
            representative entry.
        patient_id:
          type: string
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
          description: ID of the patient associated with the risk factor
        risk_factor_text_id:
          type: string
          example: 0227d1e5-ba9a-42b5-8fe2-38882aa65708
          description: >-
            If applicable, reference ID for the freeform text entry that
            produced this risk factor
        text_chunk:
          type: string
          example: liothyronine
          description: If applicable, the matching text chunk from the freeform text
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````