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

# Predict HCPCS for one implantable device (cached LLM path)

> Run (or cache-hit) LLM HCPCS prediction for a single device.

Prefer this after a fast ``/search`` with ``predict=false`` so catalog
latency never waits on OpenRouter.



## OpenAPI

````yaml /docs/openapi.client.json post /v1/codes/implants/predict
openapi: 3.1.0
info:
  description: >-
    Client API for RCIntel. Admin ingest, catalog sync, and internal audit
    routes are omitted. See Guides → Which API to use.
  summary: Multi-tenant knowledge API for healthcare revenue cycle management.
  title: Healthcare Knowledge Layer
  version: 0.1.0
servers: []
security: []
tags:
  - description: >-
      Geographic payer policy lookup (national NCD vs MAC LCD vs state). Query
      payer, code, state, plan_type. Each row includes geo_scope and
      document_version.
    name: policies
  - description: >-
      Payer network directory — search payers, check prior auth requirements,
      view filing rules, denial patterns, and appeal levels.
    name: payers
  - description: >-
      Resolve healthcare billing knowledge across the L1-L6 layer stack.
      Includes payment calculation, billing guidance, and per-layer queries.
    name: knowledge
  - description: >-
      CMS Fee Schedule lookups — OPPS (Addendum B / APC), DMEPOS (state-level
      pricing), and Clinical Lab Fee Schedule (CLFS).
    name: fee-schedules
  - description: >-
      NCCI (National Correct Coding Initiative) — dedicated MUE limits, PTP
      bundling edits, add-on code edits, and code pair validation.
    name: ncci
  - description: >-
      Service code intelligence — CPT/HCPCS lookup, RVU data, NCCI edits,
      payment calculation, implant/GUDID search, and service group
      classification.
    name: codes
  - description: >-
      Submit asynchronous AI agent jobs for code research, medical necessity,
      and denial resolution. Poll for results and retrieve reasoning traces.
    name: agents
  - description: >-
      Register and manage healthcare facilities by CCN (Medicare Provider
      Number). Each facility is the root entity for knowledge resolution.
    name: facilities
  - description: >-
      NPI Registry — live search against CMS NPPES API for provider and
      organization National Provider Identifiers.
    name: npi
  - description: >-
      OpenFDA drug product lookup by NDC. Includes product-level fields with
      normalized ingredient and package detail.
    name: drugs
  - description: Health checks, service metadata, and Prometheus metrics.
    name: system
paths:
  /v1/codes/implants/predict:
    post:
      tags:
        - codes
      summary: Predict HCPCS for one implantable device (cached LLM path)
      description: |-
        Run (or cache-hit) LLM HCPCS prediction for a single device.

        Prefer this after a fast ``/search`` with ``predict=false`` so catalog
        latency never waits on OpenRouter.
      operationId: predict_implant_v1_codes_implants_predict_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImplantPredictRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImplantSearchResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  schemas:
    ImplantPredictRequest:
      description: Single-device HCPCS prediction (cached LLM path).
      properties:
        device:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            Optional full GUDID device payload from a prior /search response.
            When omitted, the first catalog match for mnfr_cat_nbr is used.
          title: Device
        mnfr_cat_nbr:
          description: Manufacturer catalog number
          title: Mnfr Cat Nbr
          type: string
        vendor:
          default: ''
          description: Vendor / company name (optional filter)
          title: Vendor
          type: string
      required:
        - mnfr_cat_nbr
      title: ImplantPredictRequest
      type: object
    ImplantSearchResponse:
      properties:
        audit_flags:
          anyOf:
            - $ref: '#/components/schemas/ImplantAuditFlags'
            - type: 'null'
        device:
          $ref: '#/components/schemas/ImplantDeviceInfo'
        match_type:
          anyOf:
            - enum:
                - exact
                - prefix
                - fuzzy
              type: string
            - type: 'null'
          description: >-
            How this row matched the catalog query: exact normalized equality,
            prefix/stem (LIKE stem%), or trigram fuzzy. Absent on older builds.
          title: Match Type
        prediction:
          anyOf:
            - $ref: '#/components/schemas/HCPCSPrediction'
            - type: 'null'
        sentinel:
          anyOf:
            - $ref: '#/components/schemas/SentinelBlock'
            - type: 'null'
          description: >-
            SENTINEL trust verdict for the HCPCS prediction. Use
            sentinel.escalation_required to decide whether the predicted code
            can be auto-applied or whether a coder must review it.
        snomed:
          items:
            $ref: '#/components/schemas/SNOMEDMapping'
          title: Snomed
          type: array
        total_matched:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Candidates matching at this match_type before LIMIT (capped at
            1001). Same value on every row in the response. Use with match_type
            so the UI can label 'N matched by prefix' instead of implying an
            exact hit.
          title: Total Matched
      required:
        - device
      title: ImplantSearchResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ImplantAuditFlags:
      properties:
        is_biologic_hctp:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Biologic Hctp
        is_implant:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Implant
        manual_review_needed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Manual Review Needed
        missing_data_warnings:
          items:
            type: string
          title: Missing Data Warnings
          type: array
        requires_c_code:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Requires C Code
      title: ImplantAuditFlags
      type: object
    ImplantDeviceInfo:
      properties:
        brand_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand Name
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        device_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Description
        device_id_issuing_agency:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Id Issuing Agency
        expiration_date:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Expiration Date
        gmdn_pt_definition:
          anyOf:
            - type: string
            - type: 'null'
          title: Gmdn Pt Definition
        gmdn_pt_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Gmdn Pt Name
        implantable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Implantable
        mnfr_cat_nbr:
          title: Mnfr Cat Nbr
          type: string
        mri_safety_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Mri Safety Status
        product_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Code
        product_code_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Code Name
        regulation_nbr:
          anyOf:
            - type: string
            - type: 'null'
          title: Regulation Nbr
        single_use:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Single Use
        size:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Size
        vendor:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor
      required:
        - mnfr_cat_nbr
      title: ImplantDeviceInfo
      type: object
    HCPCSPrediction:
      properties:
        confidence_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence Score
        hcpcs_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Hcpcs Code
        hcpcs_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Hcpcs Description
        rationale:
          anyOf:
            - type: string
            - type: 'null'
          title: Rationale
        revenue_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Revenue Code
      title: HCPCSPrediction
      type: object
    SentinelBlock:
      additionalProperties: true
      description: |-
        SENTINEL output attached to a healthcare-impacting response.

        ``verdict`` is the deterministic ``SentinelObservatory`` output (always
        populated when the agent ran). ``audit`` is the optional LLM-powered
        ``SentinelAuditor`` result (populated when SENTINEL was running in
        SHADOW or ACTIVE mode for this agent).
      properties:
        audit:
          anyOf:
            - $ref: '#/components/schemas/SentinelAuditBlock'
            - type: 'null'
          description: >-
            LLM-powered audit result (present when SENTINEL ran in shadow/active
            mode).
        authority_level:
          anyOf:
            - type: string
            - type: 'null'
          description: full_auto | act_and_notify | human_required | quarantine
          title: Authority Level
        escalation_required:
          default: false
          description: >-
            True if the verdict requires human review before acting on the
            output.
          title: Escalation Required
          type: boolean
        patterns_detected:
          description: Failure patterns the SENTINEL fingerprinter found in the trace.
          items:
            additionalProperties: true
            type: object
          title: Patterns Detected
          type: array
        trust_score:
          anyOf:
            - type: number
            - type: 'null'
          description: Overall SENTINEL trust score (0.0–1.0).
          title: Trust Score
      title: SentinelBlock
      type: object
    SNOMEDMapping:
      properties:
        snomed_ct_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Snomed Ct Name
        snomed_identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Snomed Identifier
      title: SNOMEDMapping
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    SentinelAuditBlock:
      additionalProperties: true
      description: Subset of ``SentinelAuditResult`` that downstream callers care about.
      properties:
        composite_score:
          anyOf:
            - type: number
            - type: 'null'
          description: Weighted average of all audit dimensions (0.0–1.0).
          title: Composite Score
        findings:
          description: Per-dimension findings with severity + remediation.
          items:
            additionalProperties: true
            type: object
          title: Findings
          type: array
        flags:
          description: Failed dimensions that pushed the result towards yellow/red.
          items:
            type: string
          title: Flags
          type: array
        security_findings:
          description: Security-only findings (PHI, treatment safety, failover).
          items:
            additionalProperties: true
            type: object
          title: Security Findings
          type: array
        security_score:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            Average of PHI exposure, security compliance, failover safety,
            treatment safety.
          title: Security Score
        tier:
          anyOf:
            - type: string
            - type: 'null'
          description: 'LLM-audit tier: ''green'', ''yellow'', or ''red''.'
          title: Tier
      title: SentinelAuditBlock
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-API-Key
      type: apiKey

````