Skip to main content

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​

Storybook

No Buttons​

Storybook

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​

VariantWhat it is
ssnMasked to last 4 by default: •••-••-6789.
memberMasked except last 4.
mrn / npiShown in full.
deaMasked by default; reveal is logged by onReveal.
check digit failsNPI (Luhn) or DEA checksum fails: amber note.
revealable / copyableEye 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​

PropTypeDefaultDescription
type *IdentifierType—'ssn' | 'mrn' | 'npi' | 'dea' | 'member' | 'other'; required
value *string—Full value; required
maskedbooleanby type (SSN, DEA and member ID masked)Mask all but the last 4
revealablebooleanfalseEye button that reveals a masked value
onReveal() => voidnoneCalled each time a masked value is revealed: log it for audit
copyablebooleantrueCopy button (copies the full value without spaces)
labelstringthe type label (SSN, MRN, NPI, DEA, Member ID)Label
showLabelbooleantrueShows 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>
KindNameDescription
attributetype'ssn' | 'mrn' | 'npi' | 'dea' | 'member' | 'other'; required
attributevalueFull value; required
attributemaskedMask all but the last 4; default by type (SSN, DEA and member ID masked)
attributerevealableEye button that reveals a masked value; default false
attributecopyableCopy button (copies the full value without spaces); default true
attributelabelLabel; default the type label (SSN, MRN, NPI, DEA, Member ID)
attributeshow-label / showLabelShows the label; default true
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-revealCalled each time a masked value is revealed: log it for audit; default none (React: onReveal)