MSH2 Syntax Conventions

1. Sending
2. Reception

In sending, the name of the document MUST be named (by enterprise) like a specified syntax:

MSHPrefix_RecipientPartyId_BusinessState_UniqueLocalIdentifier[_ConversationId].xml

where:
- the underscore character "_" is only used as string separator and never inside the strings;
- the MSHPrefix is always the string "MSH2";
- the RecipientPartyId is the recipient party identifier
(e.g. "IT-12345678909" is a valid PartyId);
- the BusinessState is the business state number of the business process agreed
(if no business process is agreed or used, the number "0" is the default value, it means "no business process used" and, therefore, "use default delivery channel");
- the UniqueLocalIdentifier is a unique identifier, locally to sender party (usually it is a progressive local number);
- the optional ConversationId is an identifier of current conversation, if it isn't present, MSH2 will generate the identifier for a new conversation (syntax: SenderPartyId-UniqueLocalIdentifier)

An example, in sending, of document file name is:

MSH2_IT-12345678909_0_154.xml

where:
- [MSH-Prefix] = "MSH2";
- [Recipient-PartyId] = "IT-12345678909";
- [BusinessState] = "0"
(it means "no business process used" and, therefore, "use default delivery channel");
- [UniqueLocalIdentifier] = 154
(for example, it means the party sent 153 messages before this one).

In reception the document get a name (created by MSH2) like a specified syntax:

MSHPrefix_SenderPartyId_UniqueLocalNumber.xml

where:
- the underscore character "_" is only used as string separator and never inside the strings;
- the MSHPrefix is always the string "MSH2";
- the SenderPartyId is the sender party identifier
(e.g. "IT-12345678909" is a valid PartyId);
- the UniqueLocalNumber is a progressive and unique identifier, locally to receiver party, and it is incremented automatically each time a message is sent (MSH2 uses the Identifier ID of record related to this received message in InBox table).