The following screenshot shows the setup of the inbound and outbound python scripts for the MSH segment:
MSH Segment Definition
The inbound scripts are used to store parameters used to populate the ACK message. The most important parameter is the message control ID.
It is a matter of personal preference whether you want to use constants to populate fields like the sending and receiving application and HL7 version. In this example, the version is output on the fly based on the incoming version (an auto upgrade mechanism). One point of note, the constant 'P' indicates the feed is operating in Production mode.