Skip to main content
Version: v0.0.6

Function: identifier()

identifier(rng, typeCode?): SyntheticIdentifier

A synthetic identifier (MRN / account / member id) scoped to the synthetic assigning authority. There is no reserved MRN range, so non-collision is guaranteed by the namespace, not the value: the identifier lives under a SYNTH authority no real facility uses.

Parameters

rng

Rng

The seeded generator.

typeCode?

"MR" | "AN" | "MB"

The HL7 identifier type: MR (default), AN, or MB.

Returns

SyntheticIdentifier

A SyntheticIdentifier.

Example

import { createRng, identifier } from "@cosyte/synth";
identifier(createRng(1), "MR"); // { value, typeCode: "MR", assigningAuthority: "COSYTE-SYNTH", ... }