CDC

CDC conditions API

The conditions API from CDC — 2 operation(s) for conditions.

OpenAPI Specification

cdc-conditions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: DIBBs eCR Refiner app-notifications conditions API
  description: 'Please visit the repo for more info: https://github.com/CDCgov/dibbs-ecr-refiner'
  version: 1.0.0
tags:
- name: conditions
paths:
  /api/v1/conditions/:
    get:
      tags:
      - conditions
      summary: Get Conditions
      description: "Fetches all available conditions from the database.\n\nArgs:\n    db (AsyncDatabaseConnection): Database connection.\n\nReturns:\n    list[Condition]: List of all conditions."
      operationId: getConditions
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/GetConditionsResponse'
                type: array
                title: Response Getconditions
  /api/v1/conditions/{condition_id}:
    get:
      tags:
      - conditions
      summary: Get Condition
      description: "Returns information about a given condition.\n\nArgs:\n    condition_id (UUID): ID of the condition\n    db (AsyncDatabaseConnection): Database connection.\n\nRaises:\n    HTTPException: 404 if no condition is found\n\nReturns:\n    GetCondition: Info about the condition"
      operationId: getCondition
      parameters:
      - name: condition_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Condition Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetConditionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GetConditionCode:
      properties:
        code:
          type: string
          title: Code
        system:
          type: string
          title: System
        description:
          type: string
          title: Description
      type: object
      required:
      - code
      - system
      - description
      title: GetConditionCode
      description: Model for a condition code.
    CodeCategoryCompletenessStatus:
      properties:
        category:
          type: string
          title: Category
        name:
          type: string
          title: Name
        completeness:
          $ref: '#/components/schemas/CodeCategoryStatus'
      type: object
      required:
      - category
      - name
      - completeness
      title: CodeCategoryCompletenessStatus
      description: Code category completeness status model.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    CodeSetStatus:
      type: string
      enum:
      - not expanded
      - partially complete
      - fully complete
    CodeCategoryStatus:
      type: string
      enum:
      - not included
      - partially complete
      - fully complete
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CodeSystemsReponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        key:
          type: string
          title: Key
        display_name:
          type: string
          title: Display Name
        oid:
          type: string
          title: Oid
      type: object
      required:
      - id
      - key
      - display_name
      - oid
      title: CodeSystemsReponse
      description: Display information needed for code system information on the frontend.
    GetConditionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        display_name:
          type: string
          title: Display Name
        completeness_status:
          $ref: '#/components/schemas/CompletenessStatus'
        codes:
          items:
            $ref: '#/components/schemas/GetConditionCode'
          type: array
          title: Codes
        systems:
          items:
            $ref: '#/components/schemas/CodeSystemsReponse'
          type: array
          title: Systems
      type: object
      required:
      - id
      - display_name
      - completeness_status
      - codes
      - systems
      title: GetConditionResponse
      description: Condition response model.
    CompletenessStatus:
      properties:
        code_set_status:
          $ref: '#/components/schemas/CodeSetStatus'
        code_category_statuses:
          items:
            $ref: '#/components/schemas/CodeCategoryCompletenessStatus'
          type: array
          title: Code Category Statuses
      type: object
      required:
      - code_set_status
      - code_category_statuses
      title: CompletenessStatus
      description: Condition completeness status model.
    GetConditionsResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        display_name:
          type: string
          title: Display Name
      type: object
      required:
      - id
      - display_name
      title: GetConditionsResponse
      description: Conditions response model.