.\" ========================================================
.\" license: GPL v2 or later
.\" ========================================================

.TH gm-import_incoming 1 "2016 April 19th" "gm-import_incoming"

.SH NAME
.B gm-import_incoming
- a script to import a file into the INCOMING area of a GNUmed database.


.SH SYNOPSIS
.B gm-import_incoming
.RB [-h|?]
.RB [--help]
.RB [--local-import]
.RB --file2import=FILE
.RB --data-type=TYPE
.RB --user=USER
.RB [--host=HOST]
.RB [--port=PORT]


.SH DESCRIPTION
.B gm-import_incoming
is a script for importing a file into the GNUmed database
area where incoming files are stored which have not been
linked to any patient. A type is associated with the data for
easier recognition.

This script can be used to import for later processing fax
images, lab data, referral letters, and similar data which
electronically arrives on your system.


.SH OPTIONS
.PP
.TP
.B \--help, -h, -?
Show a help screen.
.TP
.B \--local-import
At startup adjust the PYTHONPATH such that the GNUmed client
is run from a local copy of the source tree (say, an unpacked
tarball) rather than from a proper system-wide installation.
.TP
.B \--file2import=FILE
This is the file to be imported into GNUmed.

Successfully imported files are renamed to FILE.imported
within the directory in which FILE resides.
.TP
.B \--data-type=TYPE
A short moniker, say, a word or two, used to describe the
data in FILE to the user when viewed inside GNUmed.

The actual content of TYPE is only limited by the execution
environment (locale, encoding, ...) of gm-import_incoming.
GNUmed does not need to understand what TYPE means to the
user.
.TP
.B \--user=USER
The PostgreSQL user to be used for connecting to the
database.

Note that this must currently be a GNUmed staff account. It
will also work with the cluster superuser (usually
"postgres") or the GNUmed database owner (typically "gm-dbo")
but using these in production is
.B strongly
discouraged for data security reasons.
.TP
.B \--host=HOST
The hostname of the machine PostgreSQL is running on, if
required.

If this option is not used (or set to an empty string) it
will default to connecting over UNIX domain sockets.
.TP
.B \--port=PORT
The port PostgreSQL is listening on. Default PostgreSQL
installations listen on port 5432.
.PP
There are no options for database name or password.

The script uses the default database name of the GNUmed
version the script is released with thereby assuring data
does not get imported into an older database following an
upgrade.

If a password is needed (that is, if TRUST, IDENT, or PEER
authentication is not in use) it must be supplied by either
setting the $PGPASSFILE environment variable or using a
standard ~/.pgpass file.


.SH ENVIRONMENT
.TP
.B PGPASSFILE
.PP
	http://www.postgresql.org/docs/devel/static/libpq-pgpass.html

.SH FILES
.B ~/.pgpass
.PP
	http://www.postgresql.org/docs/devel/static/libpq-pgpass.html


.SH SEE ALSO
.PP
.TP
.B http://wiki.gnumed.de
Detailed Wiki-style documentation
.TP
.B /usr/share/doc/gnumed/
Local documentation
.TP
.B man -k gm-*
List man pages on gm-* commands.