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

Managing the LOINC Code Database

Synopsis

loincmgr -[crux] files ...
loincmgr -[dq] field == value [field op value] ...
loincmgr -D [field == value [field op value] ...]
loincmgr -R

Description

The loincmgr program is the "manager" of the LOINC code database. It is used to convert between tabular and compiled, hashed form of the database. Moreover it offers shell level access to the querying feature of the underlying ODBM object database management facility.

The first form is used in order to create (`-c') the compiled, hashed and indexed database, add (`-u'), replace (`-r'), or delete (`-x') objects from the database. The tuples are submitted as files in the tabular format (see section The `LOINC.tab' and `LOINC+.tab' Databases).

The second form is used to query or delete objects from the database. The query is specified by a clause asking for the key or an indexed field to be equal to some string value; followed by other clauses further testing the operator op on other fields and values. The operator op can be `==' (equal) or `!=' (not equal). The clauses are linked by logical and. The field can be specified either by a number or by the LOINC standard name for the field: `LOINC_NUM', `MEASURE', `PROPERTY', `TIMING', `SPECIMEN', `PRECISION', `METHOD', `RELAT_NMS', `CLASS', `SOURCE', `EUCLIDE_CD', `ASTM_CD', `IUPAC_CD', `DT_LAST_CH', `COMMENTS', `ANSWERLIST', `STATUS', `SCOPE', `SNOMED_CD', `VA_CD', `METPATH_CODE', `HCFA_CODE', `NORM_RANGE', `UNITS', and `MAP_TO'.

The third form is used to regain the tabular source form of the database from the compiled form. It is possible, but not required, to use a query clause as described above in order to limit the amount of data that is printed to the standard output.

The last form is used to reorganize the database, i.e. to delete all indices that have doubled or became void because of data being replaced or removed from the database.

Options

-c files ...
create database
-r files ...
update database (update)
-u files ...
update database (insert)
-x files ...
exclude from database
-q field == value [field op value] ...
query database
-d field == value [field op value] ...
delete tuples from database
-D [field == value [field op value] ...]
dump tuples in database to tabular format
-R
reorganize database

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/etc/LOINC.tab'
the original LOINC code table
`/usr/hl7/etc/LOINC+.tab'
the table of extensions
`/usr/hl7/lib/codes/LOINC.db'
the compiled, hashed and indexed database
`./loinc.log'
the run log file

Bugs

Writing errors to the logfile is not useful since this is a program that is normally invoked manually by an operator.

The table parser is a bit itchy about end of lines.

The `-r' option is not yet implemented

The `-R' option is not implemented yet. It can be emulated by

loincmgr -D > /tmp/loinc.tmp
loincmgr -c /tmp/loinc.tmp

Diagnostics

See the file `./loinc.log' to make sure that no error has occurred.

See Also

odbm(3), gdbm(3), section The `LOINC.tab' and `LOINC+.tab' Databases, section The LabEventInfo Table.


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