Before you create a message, you need to load the message library. This library contains HL7 2.x definitions.
A library was created for each HL7 version. Library names formatted as BSHL7XX.BSL, XX is HL7 version -without dot '.'- number.
For HL7 2.2 version library name BSHL722.BSL.
For HL7 2.3.1 version library name BSHL7231.BSL.

You can create message with two way.

Classical way: You can access every message fields/grups in editor.
You do not need know about name or Index. Editor helps with code completion.
The disadvantage of this method is the problem of increase file/memory size. May be problem for mobile devices.

Dynamically way: For use this way you need known segment name, group name and field name or their index.(Index is 1 based.). Editor can not help to you. The advantage of this method low memory footprint.