Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do brackets and braces mean in HL7 segments?

I'm working on a project that involves HL7 messages. I've been reading the documentation to understand what the different kind of segments mean.

I've come across three different kinds of syntax when looking at the documents, they are below:

enter image description here

What is the difference between a segment without any sort of braces or brackets, a segment with both braces and brackets, and a segment with just brackets?

I assumed a segment with brackets may be some sort of array or list, but I haven't been able to find anything confirming this.

like image 554
AndreasKralj Avatar asked Jan 01 '23 09:01

AndreasKralj


2 Answers

Brackets indicate the segment is optional. [UAC] means the UAC segment may or may not be in the message.

Braces (or curly brackets) indicate the segment can repeat. [{ SFT }] means the SFT segment may or may not be in the message, and could repeat multiple times if it is.

A segment without any brackets or braces should be in the message once.

See this page for example.

like image 147
Dale M Avatar answered Apr 02 '23 23:04

Dale M


Segment with brackets ([]):
- Brackets indicate segment is optional.
- These segments may or may not present in the message.

Segment with braces ({}):
- Braces indicate segment is repeatable.
- These segments may repeat more than once in same message.
- The sequence of repeat segments may also matter.

Based on above, meaning of other combinations can be easily understood.

Segment without brackets and braces:
- These are mandatory segments (not optional; as not enclosed in brackets).
- These are allowed only once in the message (no repeat; as not enclosed in braces).
- That means one and only one instance of the segment must present in the message.

Segment with brackets as well as braces:
- These are optional segments (as enclosed in brackets).
- If present, these may occur once or multiple time in the message (as enclosed in braces).

You may find the details here and here.


So, in your screen shot in question:

  • MSH segment must present only once.
  • [{SFT}] segment may not present at all; may present once; may present multiple times.
  • [UAC] segment may present only once or may not present at all.
like image 26
Amit Joshi Avatar answered Apr 02 '23 21:04

Amit Joshi