Skip to content

Are segment field idx numbers supposed to match HL7 field seq numbers? #123

@Obversity

Description

@Obversity

Hi guys,

Question: does the segment field idx match up to the HL7 spec's field seq numbers? E.g. should MSH-9 (Message Type) be accessible via msg[:MSH][9]?

Background: Trying to build a tool to dynamically extract data from HL7 segments by users specifying the Segment name and the field number.

Problem: I immediately ran into problems doing that, discovering that in the MSH segment, the field with IDX = 9 isn't the Message Type field.

image

All documentation on HL7 MSH segment indicates that the Message Type should be MSH-9.

I figured maybe it was just zero-based indexing and I could offset by one, but that doesn't seem to be the case for other segments, e.g. for this OBR segment, 4 is the correct sequence for the Universal Service Identifier, and that's what's in the file I'm looking at.

image

Some clarification would be great so I can confidently use the library, thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions