HL7v2.Profiles.Examples (HL7v2 v3.10.1)

Copy Markdown View Source

Example conformance profiles demonstrating common integrator patterns.

These are starting points — real profiles should be customized to your organization's specific constraints. Use HL7v2.Profile directly for full control over rule composition.

Summary

Functions

A strict hospital ADT_A01 profile that enforces common real-world constraints beyond the base v2.5.1 spec

An IHE-style ORU_R01 lab results profile enforcing common constraints

Functions

hospital_adt_a01()

@spec hospital_adt_a01() :: HL7v2.Profile.t()

A strict hospital ADT_A01 profile that enforces common real-world constraints beyond the base v2.5.1 spec:

  • NK1 (next of kin) segment required
  • PID-18 (patient account number) must be populated
  • PV1-3 (assigned patient location) must be populated
  • Patient class (PV1-2) must be one of Inpatient/Outpatient/Emergency
  • At least one DG1 (diagnosis) segment required

Example

profile = HL7v2.Profiles.Examples.hospital_adt_a01()
HL7v2.validate(msg, profile: profile)

ihe_lab_oru_r01()

@spec ihe_lab_oru_r01() :: HL7v2.Profile.t()

An IHE-style ORU_R01 lab results profile enforcing common constraints:

  • OBR (observation request) required
  • At least one OBX (observation result) segment
  • OBR-4 (universal service identifier) must be populated
  • OBX-3 (observation identifier) must be populated
  • OBX-11 (observation result status) must be populated with a valid code

Example

profile = HL7v2.Profiles.Examples.ihe_lab_oru_r01()
HL7v2.validate(msg, profile: profile)