RCMbox Docs

fetch-context

Fetches a BillingCase and extracts its clinical context from contained resources. Claims, ChargeItems, and ClaimResponses are resolved via the FHIR API (external refs).

Script path: @aidbox-billing/billing-case/fetch-context

Input

ParameterTypeDescription
caseIdstringID of the BillingCase to fetch context for

Output

Returns a BillingCaseContext object:

FieldTypeDescription
billingCaseobjectThe BillingCase resource
patientobjectPatient (from contained)
encounterobjectPrimary Encounter (from contained)
proceduresobject[]Procedures (from contained)
practitionersobject[]Practitioners (from contained)
coveragesobject[]Coverages (from contained)
organizationsobject[]Organizations (from contained)
conditionsobject[]Conditions (from contained)
claimsobject[]Claims referenced by the case (resolved via API)
chargeItemsobject[]ChargeItems referenced by the case (resolved via API)
claimResponsesobject[]ClaimResponses referenced by the case (resolved via API)

Usage in workflow YAML

- id: fetch-context
  name: Fetch Case Context
  script: "@aidbox-billing/billing-case/fetch-context"
  params:
    caseId: $activities.snapshot-billing-case.output.billingCaseId
  children: [select-coverage]

Importing in TypeScript

import type { BillingCaseContext } from "@aidbox-billing/built-in-activities/billing-case/fetch-context";

The BillingCaseContext type is exported and used as the input type for downstream built-in activities like build-charge-items and build-draft-claim.

See also

Last updated: