Go to the first, previous, next, last section, table of contents.

An ASTM to HL7 Gateway for the ABL 500

Synopsis

abl500 [-d]

Description

The abl500 program converts an ASTM message received from a Radiometer ABL 500 or 600 series acid base laboratory via the standard input to an HL7 ORU message written as a message file to a spool directory.

The following mapping is used for the ASTM message:


     ASTM RESULT MESSAGE        |   HL7 OBSERV RESULT/UNSOLICITED    
================================|==================================
                                |                                      
  H.............................+.......MSH                            
  {.............................+.......{                              
    P...........................+.........[                            
         .                      |           PID                        
         .                      |           [ { NTE } ]                
         .                      |           [ PV1 ]                    
         .......................+.........]                            
    {...........................+.........{                            
    .                           |           [ ORC ]                    
    . O.........................+...........OBR                        
    .                           |           [ { NTE } ]                
    . {.........................+...........[                          
    . .                         |             {                        
    . .R........................+...............OBX                    
    . .                         |               [ { NTE } ]            
    . .                         |             }                        
    . }.........................+...........]                          
    }...........................+.........}                            
  }.............................+.......}                              
  L                             |       [ DSC ]                        

Where the data items are mapped as follows:


ASTM MESSAGE                            | HL7 ORU MESSAGE
DATA ITEM                      TYP N    | DATA ITEM                    TYP N 
============================================================================
H.SENDER(5)                     ZA 0--1 > MSH.SENDING APPLICATION       ST 1  
                                        > MSH.SENDING FACILITY          ST 1
        ZA.BRAND                        |
        ZA.ID                           |
                                        |
H.DATE/TIME OF MESSAGE(14)      TS 0--1 ? MSH.DATE/TIME OF MESSAGE      TS 1
                                        |
P.SEQUENCE NUMBER(1)            SI 0--1 = MSH.SET ID - PATIENT ID       SI 1
P.LAB ASSIGNED PATIENT ID(3)    ID 0--1 = PID.ALTERNATE PATIENT ID
P.PATIENT NAME(5)               PN 0--1 | PID.PATIENT NAME  patinfo()...
P.SEX(8)                0001    ID 0--1 | PID.SEX
P.PATIENT AGE(14)               CQ 0--1 | --
P.PATIENT HEIGHT(16)            CQ 0--1 | --
P.PATIENT WEIGHT(17)            CQ 0--1 | --
P.LOCATION(26)                  ID 0--1 | PV1.ASSIGNED PATIENT LOCATION
                                        |
O.SEQUENCE NUMBER(1)            SI 0--1 = OBR.SET ID OBSERVATION REQUEST 
O.INSTRUMENT SPECIMEN ID(3)     ZI 0--1 = OBR.FILLER ORDER NUMBER       CM
        ZI.TYPE         1005!   ID      |       CM.COM2
        ZI.NUMBER               SI      |       CM.COM1
                                        |
O.SPECIMEN COLLECTION DATE/TIME TS 0--1 = OBR.OBSERVATION DATE/TIME
O.SPECIMEN DESCRIPTOR(15)       ZS 0--1 > OBR.SPECIMEN SOURCE
        ZS.TYPE         1001!   ID      |
        ZS.SOURCE       1002!   ID      |
                                        |
R.SEQUENCE NUMBER(1)            SI 0--1 = OBX.SET ID - OBSERVATIONAL SIMPLE
R.UNIVERSAL TEST ID(2)          ZT 0--1 | OBX.OBSERVATION IDENTIFIER toloinc()
        ZT.PARAMETER NAME 1003! ID      |
        ZT.PARAMETER TYPE 1004! ID      |
                                        |
R.MEASUREMENT VALUE(3)          ST 0--1 > OBX.OBSERVATION VALUE ...(tounit())
R.UNITS(4)              0003!   ID 0--1 > OBX.UNITS             tounit()
R.ABNORMAL FLAG(6)      0078    ID 0--1 = OBX.ABNORMAL FLAGS
R.RESULT STATUS(8)      0085    ID 0--1 = OBX.OBSERV RESULT STATUS
R.OPERATOR ID(10)               ID 0--1 > OBX.RESPONSIBLE OBSERVER operinfo()
R.DATE/TIME TEST STARTED(11)    TS 0--1 = OBX.DATE/TIME OF THE OBSERVATION
R.INSTRUMENT ID(13)     1006!   ID 0--1 = OBX.PRODUCER'S ID
                                        |
L.SEQUENCE NUMBER(1)            SI 0--1 | --
L.TERMINATION CODE(2)   1007!   ID 0--1 | -- (check)

The ABL 500 and 600 allows the operator to enter a patient id consisting of digits and colons as well as an operator id consisting of a string of digits. It is assumed, that the patient identifier is the room and bed number where the patient is currently located. This is a reasonably unique number that is not too long in order to prevent errors from being introduced. In order to resolve this identifiers the shell scripts `/usr/hl7/etc/PatByBed' and `/usr/hl7/etc/OperByNum' are called in a reading pipe. These scripts can be configured to make a database access in order to resolve the numbers to real patient or operator data. See section Resolving a Patient ID and section Resolving an Operator ID for how to configure these scripts.

The observation identifiers are coded using the LOINC code (see section The LOINC Code) which had to be substantially extended in order to map ABL results. However, still some results from the ABL 625 are not resolved due to missing entries in the LOINC database table.

Resolved observation identifiers are:

General
`T'
BODY TEMPERATURE, TEMP
`B'
BAROMETRIC PRESSURE, PRES Blood Gases
`pCO2'
CARBON DIOXIDE, PPRES
`pCO2(T)'
CARBON DIOXIDE^^ADJUSTED TO BODY TEMPERATURE, PPRES
`tCO2(B)'
CARBON DIOXIDE.TOTAL, SCNC
`tCO2(P)'
CARBON DIOXIDE.TOTAL, PLAS
`pO2'
OXYGEN, PPRES
`pO2(T)'
OXYGEN^^ADJUSTED TO BODY TEMPERATURE, PPRES
`p50(act)'
OXYGEN^^SATURATION ADJUSTED TO 0.5, PPRES
`p50(act),T'
OXYGEN^^SATURATION ADJUSTED TO 0.5 AND BODY TEMPERATURE, PPRES
`p50(st)'
OXYGEN^^SATURATION ADJUSTED TO 0.5 STANDARD, PPRES
`sO2'
OXYGEN SATURATION, SFR
`tO2'
OXYGEN.TOTAL, SCNC Acid Base Status
`pH'
PH, SCNC
`pH(st)'
PH^^STANDARD, SCNC
`pH(T)'
PH^^ADJUSTED TO PATIENT TEMPERATURE, SCNC
`HCO3-'
BICARBONATE, SCNC
`SBC'
BICARBONATE^^STANDARD, SCNC
`ABE'
BASE EXCESS, SCNC
`SBE'
BASE EXCESS^^STANDARD, SCNC Electrolytes
`Na+'
SODIUM, SCNC
`K+'
POTASSIUM, SCNC
`Ca++'
CALCIUM.FREE, SCNC
`Ca(7.4)'
CALCIUM.FREE^^PH ADJUSTED TO 7.4, SCNC
`Cl-'
CHLORIDE, SCNC
`Anion gap (K+)'
ANION GAP^^INCLUDING POTASSIUM, SCNC
`Anion gap'
ANION GAP, SCNC Metabolism
`Glu'
GLUCOSE, ACNC
`Lact'
LACTATE, SCNC Hematology
`Hct'
HEMATOCRIT, NFR
`tHb'
HEMOGLOBIN, MCNC
`O2CAP'
OXYGEN BINDING CAPACITY, SCNC
`O2Hb'
OXYHEMOGLOBIN.TOTAL, NFR
`RHb'
DEOXYHEMOGLOBIN, SFR
`MetHb'
METHEMOGLOBIN, MFR
`COHb'
CARBON MONOXIDE.HEMOGLOBIN, NFR
`HbF'
HEMOGLOBIN F, SFR
`SHb'
SULFHEMOGLOBIN, SFR Miscellanea
`CO2'
CARBON DIOXIDE, NFR
`FIO2'
OXYGEN INHALED, NFR
`O2'
OXYGEN, NFR

Unresolved observation identifiers are: `pO2(A)', `pO2(A),T', `AaDpO2', `AaDpO2,T', `a/ApO2', `a/ApO2,T', `RI', `RI,T', `DO2', `VO2', `RQ', `Qt', `Qx', `cx', `px', `Shunt', `Shunt,T', `pO2(uv)', and `CQ'.

The LOINC code for specimen is used instead of the HL7 code in order to be consistent with LOINC which is being developed in close relationship to HL7. The HL7 table 70 is anyway hopelessly incomplete. Thus, instead of `ABLD' we keep saying `BLDA' for arterial blood. However, even the LOINC code is not detailed enough in order to distinguish venous blood `BLDV' from mixed venous blood. The latter is therefore encoded by `BLDVM'.

If a test was erroneous, the ABL 500 uses a question mark `?' before the numeric observation value. Currently such observations are simply discarded. Likewise, `<' and `>' characters that designate results beyond absolute limits cause the observation to be discarded. In subsequent versions, however, these will cause abnormal flags to be set and an NTE segment to be added, giving a textual note on the error.

Options

-d
Set log level to log everything down to debug level.

Examples

For proper operation, abl500 should be called from the radiometer program.

radiometer 625 /usr/hl7/bin/abl500 - /dev/ttyd0

But single abl messages can be converted to HL7 directly:

abl500 < /usr/hl7/var/log/ABL/060_IOP/ABL0123

Environment

PG_CODELIB
The location of the external code databases for LOINC, LabEventInfo and units. This is rarely used, since everyone uses the names compiled into the programs.

Files

`/usr/hl7/var/spool/ABL/060_IOP/msg#########.dat'
The abl500 program the HL7 ORU message as a message file to a spool directory whose name is composed of the application and facility names. The filename is composed of the string `msg' and the time in seconds since the UNIX epoch with the process id (pid) of the abl500 process attached to it and the suffix `.dat'.
`/usr/hl7/var/spool/ABL/060_IOP/msg#########.lck'
While the message file is written out, the corresponding lock file appears in the spool directory, indicating that the message file might be incomplete.
`/tmp/abl500.log'
The run log file, if syslog(3) is not used instead.

Bugs

The colon in the patient id is transformed into a `-' character while the id itself is always interpreted as `room:bed'. This is definitely too narrow, since one might want to use different numbers. We should not interpret anything here and directly forward the number to PatByBed.

Uncoded observation identifiers: `pO2(A)', `pO2(A),T', `AaDpO2', `AaDpO2,T', `a/ApO2', `a/ApO2,T', `RI', `RI,T', `DO2', `VO2', `RQ', `Qt', `Qx', `cx', `px', `Shunt', `Shunt,T', `pO2(uv)', and `CQ'.

The application name (`ABL') and the facility name (`060_IOP') are chosen at compile time. This is certainly wrong because the abl500 program might well be used for different facilities.

See Also

syslog(3), time(3), section Resolving a Patient ID, section Resolving an Operator ID, section Accepting Messages From a Serial Line. section Converting Printer Output to HL7,


Go to the first, previous, next, last section, table of contents.