Question: Are v2 codes case sensitive?

Dec 6, 2011

Question:

I have been unable to find any normative statements about the case sensitivity of values in HL7 tables, or even case sensitivity in HL7 messages and documents more broadly. Is ‘adt’ a valid message type? Is ‘msh’ a valid segment name?  Is ‘ft’ a valid datatype? Is ‘m’ a valid administrative sex code [table 0001]? Is ‘base64’ a valid encoding type [table 0299]? Could you please clarify or point to relevant documentation that might help. - thanks!!

Answer:

The codes are all case sensitive, except for one specific exemptions that is noted in the standard itself. The v2 standard doesn’t explicitly say this anywhere - it’s just taken for granted. The exception is the case of ED components 3 and 4 which e noted as case insensitive : “Note that the MIME media type values are case-insensitive, in accordance with RFC 2045”.

In practice, I have occasionally seen codes in segments other than MSH where the codes are lower case - but this is not right. HL7 wouldn’t define two codes that have different meaning, and only differ in case, so it’s not wrong to do case insensitive comparison as a receiver, but the correct case should always be sent.