CopayCollector
ComplexRevenue
<co-copay-collector>CopayCollector (PatientBalance) shows today's copay, prior balance and total, and collects by card, tap, cash or text link.
import { CopayCollector } from 'health-components';
Examples
Copay Only
Text To Pay
Usage
<CopayCollector patient="Henna West" copay={25} prior={40} cardLast4="Visa 4242" />
When to use
- Check-in and checkout.
When not to use
- Posting insurer payments: ERAPostingRow.
Variants and states
| Variant | What it is |
|---|---|
| methods | Card on file, tap, cash, text link. |
| plan | Payment plan note. |
| skip | Skip needs a reason. |
Accessibility
- Amounts as text.
Do and don't
- Do: Show what the balance is for.
- Don't: Charge without showing the amount on the button.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
patient * | string | — | Patient (and plan) line under the title. Required |
copay * | number | — | Copay due today in dollars. Required |
prior | number | 0 | Prior balance in dollars |
priorNote | string | none | What the prior balance is for, e.g. "09/12 visit, after insurance" |
plan | string | none | Payment plan note; shows an info Alert |
cardLast4 | string | none | Card on file, e.g. "Visa 4242" |
due | number | copay | Initial amount in the Amount field |
amount | string | undefined (uncontrolled, starts at `due`) | Controlled amount (field text) |
onAmountChange | (amount: string) => void | — | Called when the amount text changes |
method | PaymentMethod | undefined (uncontrolled) | Controlled payment method |
defaultMethod | PaymentMethod | 'card' | Initial payment method when uncontrolled |
onMethodChange | (method: PaymentMethod) => void | — | Called when the method changes |
onCollect | (collection: CopayCollection) => void | none | Called when Collect is pressed |
onSkip | () => void | none | Called when Skip is pressed (the screen then asks for a reason) |
Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.
Angular, Vue and HTML
Register the elements once (Angular guide), then use <co-copay-collector>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.
Angular template
<co-copay-collector patient="…" copay="…" [defaultValue]="defaultValue" (co-amount-change)="onAmountChange($event.detail)"></co-copay-collector>
| Kind | Name | Description |
|---|---|---|
| attribute | patient | Patient (and plan) line under the title. Required |
| attribute | copay | Copay due today in dollars. Required |
| attribute | prior | Prior balance in dollars; default 0 |
| attribute | prior-note / priorNote | What the prior balance is for, e.g. "09/12 visit, after insurance"; default none |
| attribute | plan | Payment plan note; shows an info Alert; default none |
| attribute | card-last4 / cardLast4 | Card on file, e.g. "Visa 4242"; default none |
| attribute | due | Initial amount in the Amount field; default copay |
| attribute | amount | Controlled amount (field text); default undefined (uncontrolled, starts at `due`) |
| attribute | method | Controlled payment method; default undefined (uncontrolled) |
| attribute | default-method / defaultMethod | Initial payment method when uncontrolled; default 'card' |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-amount-change | Called when the amount text changes (React: onAmountChange) |
| event | co-method-change | Called when the method changes (React: onMethodChange) |
| event | co-collect | Called when Collect is pressed; default none (React: onCollect) |
| event | co-skip | Called when Skip is pressed (the screen then asks for a reason); default none (React: onSkip) |