ASTM Protocol M201 LIS
ASTM Protocol M201 LIS
2. Transmitting progress:
1) Establishing
Transmitter: <ENQ> (0x05) enquiry
Receiver: <ACK> (0x06) acknowledgement
<NAK> (0x15) negative acknowledgement
<ENQ> (0x05) enquiry
Notes:
<ACK> means the receiver is ready to receive data.
<NAK> means the receiver cannot receive data immediately.
<ENQ> means the receiver wants to send data too. The device allows the PC to enquire the test results. The PC
transmits the query conditions to the device. If the device has finished a test at same time there would be a contention.
The solution for the contention is:
a. If the PC sends <ENQ> but gets an <ENQ> reply from the device, it would delay the enquiry and prepare to
receive the test result first, then wait and reply the next <ENQ> signal from device.
b. If the device sends <ENQ> but gets an <ENQ> reply from the PC. Before trying again, the device waits for
more than one second. (Device would try 6 times at most.)
2) Transmitting
Frame :Messages are transmitted as frames. (The below characters means ASCⅡ characters)
a. Each frame can have 247 characters at most, including the header. If longer than 240 characters, the
message is divided into two or more frames. (The header needs 7.)
b. Different messages cannot be jointed into one frame. Each message must be transmitted in a new-started
frame.
c. There are two types of frames, mid-frame and end-frame. One message which has less than 240 characters
is transmitted as a single end-frame. A longer message is transmitted as mid-frames, only the last part as
end-frame.
d. Frame structures:
Mid-frame: <STX>FN Text <ETB> C1 C2 <CR> <LF>
End-frame: <STX>FN Text <ETX> C1 C2 <CR> <LF>
Wherein:
<STX>: (0x02) start of text
FN: 0~7 frame number
Text: text the message to be transmitted (see appendix part)
<ETB>: (0x17) end of transmission block
<ETX>: (0x03) end-of-text
C1 0~9, A~F high half-byte of checksum (transferred to ASCII)
C2 0~9, A~F low half-byte of checksum (transferred to ASCII)
Checksum: the last byte of [FN + Text + <ETB>/<ETX>]
<CR>: (0x0D) carriages return (use as record terminator)
<LF>: (0x0A) line feed
3) Responding
After each frame of message, the receiver gives a responding to the transmitter.
<ACK> (0x06) acknowledgement
<NAK> (0x15) negative acknowledgement
<EOT> (0x04) end of transmission
Notes:
<ACK> means the last frame has been received correctly and the receiver is ready to receive the next frame. The
transmitter should increase the FN and transmit a new frame, or send a request to end the transmission.
<NAK> means the last frame has NOT been received correctly and the receiver is ready to receive it again.
<EOT> means the last frame has been received correctly but the transmission is ended by the receiver. The
transmitter should send a new request to establish a transmission.
4) Ending
<EOT> (0x04) end of transmission
<ACK> (0x06) acknowledgement
After all messages being successfully transmitted, the transmitter sends <EOT> to the receiver. The receiver
responds <ACK>.Then the transmission would be ended.
3. Example:
As an example, we try to get the result record with sample number 032989326.
Step 1 Establishing
The PC: <ENQ>
Device: < ACK> (/ <NAK> / <ENQ>)
Step 6 Establishing
Device: <ENQ>
The PC: < ACK> (/ <NAK> / <ENQ>)
Generally:
Message type in using: H header, Q query, P patient, O order, R result, L last,
Time format: YYYYMMDD or YYYYMMDDHHMMSS