JPAC Joint United Kingdom (UK) Blood Transfusion and Tissue Transplantation Services Professional Advisory Committee

25.3: General protocol

The general protocol defines the general character of the overall message, and elements which are common to both the envelope and the message content. The message uses standard ASCII characters throughout, and lines are terminated with the carriage return (ASCII 13) character. Fields are all fixed width and left-justified. Leading zeros for numeric fields are used only where explicitly indicated.

Please note that this standard does not necessarily conform to any particular operating system standard for specifying a text file. For example, Unix-based operating systems (including Apple Mac OS X) use line feed (ASCII 10) to terminate text lines and Microsoft Windows uses a combination of carriage return and line feed (ASCII 13 and ASCII 10). Apple Mac operating systems prior to OS X used a single carriage return to terminate text lines. Due to these inconsistencies files containing electronic data interchange messages must always be processed character by character and not rely on specific text processing functions.

The following are standard components of every line transmitted:

  • The line number: A sequential number defining the line in the file, which is located in character positions 1 to 5 of every line. The header line will always have a line number of 00001.
  • The checksum: The checksum immediately precedes the carriage return terminator of each line. The checksum is calculated by taking the sum of the ASCII value of all characters in the line, and then determining the modulus 97 remainder which becomes the checksum.
Last updated 20/02/2014