IdentifierDisplay
BasicClinical values
<co-identifier-display>IdentifierDisplay shows SSN, MRN, NPI, DEA and member IDs in a monospace face, masking the sensitive ones, with reveal and copy buttons and a check-digit warning.
import { IdentifierDisplay } from 'health-components';
Examples
Identifiers
No Buttons
Usage
<IdentifierDisplay type="ssn" value="123456789" revealable onReveal={logAccess} />
When to use
- Patient banner, registration, claims, provider directory, prescriptions.
When not to use
- Identifier entry: TextField with mask.
Variants and states
| Variant | What it is |
|---|---|
| ssn | Masked to last 4 by default: •••-••-6789. |
| member | Masked except last 4. |
| mrn / npi | Shown in full. |
| dea | Masked by default; reveal is logged by onReveal. |
| check digit fails | NPI (Luhn) or DEA checksum fails: amber note. |
| revealable / copyable | Eye and copy buttons. |
Accessibility
- Masked values are announced as "SSN ending 6789".
- Copy and reveal buttons have names that change with state.
Do and don't
- Do: Log every reveal of an SSN or DEA through
onReveal. - Don't: Read "check digit OK" as proof the number is real: it only catches typing errors. NPPES or DEA lookup confirms the provider.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
type * | IdentifierType | — | 'ssn' | 'mrn' | 'npi' | 'dea' | 'member' | 'other'; required |
value * | string | — | Full value; required |
masked | boolean | by type (SSN, DEA and member ID masked) | Mask all but the last 4 |
revealable | boolean | false | Eye button that reveals a masked value |
onReveal | () => void | none | Called each time a masked value is revealed: log it for audit |
copyable | boolean | true | Copy button (copies the full value without spaces) |
label | string | the type label (SSN, MRN, NPI, DEA, Member ID) | Label |
showLabel | boolean | true | Shows the label |
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-identifier-display>. 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-identifier-display type="…" value="…" [defaultValue]="defaultValue" (co-reveal)="onReveal($event.detail)"></co-identifier-display>
| Kind | Name | Description |
|---|---|---|
| attribute | type | 'ssn' | 'mrn' | 'npi' | 'dea' | 'member' | 'other'; required |
| attribute | value | Full value; required |
| attribute | masked | Mask all but the last 4; default by type (SSN, DEA and member ID masked) |
| attribute | revealable | Eye button that reveals a masked value; default false |
| attribute | copyable | Copy button (copies the full value without spaces); default true |
| attribute | label | Label; default the type label (SSN, MRN, NPI, DEA, Member ID) |
| attribute | show-label / showLabel | Shows the label; default true |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-reveal | Called each time a masked value is revealed: log it for audit; default none (React: onReveal) |