idb_direct -e event -r recno -l bed [-s recno2] [-m bed2] [-n nbed] [-c] [-H height] [-W weight] [-S BSA] idb_direct -e 1|8 -r recno -l bed [-c] [-H height] [-W weight] [-S BSA] idb_direct -e 2 -r recno -l old_bed -n new_bed idb_direct -e 3 -r recno -l bed idb_direct -e 17 -r recno1 -l bed1 -s recno2 -m bed2
CareVue does only accept medical record numbers (recno) for patient reference. CareVue's own HL7 interface fails to report many application error conditions, such as admitting a patient into an occupied bed. This script takes the medical record number(s) and bed identifier(s) of a patient (or a pair of patients) and tests
For the HL7 events A01 (admission), A03 (discharge), and A08 (update pat. info.), only the first bed/patient is tested. For A02 (transfer) the second recno is set equal to the first while the first bed is the source bed and the second bed is the destination bed. Thus one can test, whether the patient was already transfered to the new bed (i.e. if the second bed is occupied by the given known patient).
If observations (weight, height, and BSA) are supplied
and the commit flag (`-c') is also given, these values are written
into the patient record. If the relevant entities (AdmitWt
, etc.)
do not yet exist, they are inserted and linked to the patient record
before.
Any write access to the database requires the patient record to be known
to the patient manager in order to avoid severe database
havoc. Therefore the ptMgrSup
program is repeatedly polled until
the patient is found. This can be most efficiently handled by waiting
for the admitted patient to appear in the census (ptMgrSup -c
)
only during the commit phase (-c
) of the admission (-e 1
)
transaction. Thus any successive transaction can be quite sure that it
won't get into conflict with a pending admission.
The idb part requires the script new_wt_ht_bsa
to be accessible
within the standard path in the CHARTING domain. This bourne shell
script calls dbload
in order to insert new entities in the ADT
observation classes.
The return value is to be interpreted as a bit-set, where the least significant triple denotes the first (or only) given bed/recno and the more significant triple denotes the second bed/recno. The most significant bit is the error flag. The following table defines the meaning of each bit in a triple:
Bitset Value Meaning ------- ------- ------------------------------------------------ 001 1 bed is occupied (by whoever) 010 2 patient is known (assigned to whatever location) 111 7 bed is occupied, patient is known, and given patient is assigned to the given bed
The idb_direct
script issues CareVue system messages if a patient
that is to be admitted will be put on the waiting list because the
assigned patient location is occupied (see section The HL7 to CareVue Gateway Program).
The actions being taken by this script highly depend on local considerations. They can be programmed differently. Shell scripts provide an easy way of prototyping changes regarding it's use in other circumstances. It is only required not to change the interface of this script, i.e. the argument list format, and the results presentation to the calling program.
-e event
-c
-l bed
name
of BedConfig
.
-m bed2
name
of BedConfig
.
-n new_bed
name
of BedConfig
.
-r recno
medRecNum
).
-s recno2
medRecNum
) of the second patient in a
swap transaction (event == 2).
-H height
ht
).
-W weight
admitWt
).
-S BSA
BSA
).
The idb_direct
program is normally only called from a
cvgateway
process.
Test for admission of patient 12345 into bed 601-1:
/usr/hl7/etc/idb_direct -e 1 -r 12345 -l 601-1
Test for transfer of patient 12345 from bed 601-1 into 604-7:
/usr/hl7/etc/idb_direct -e 2 -r 12345 -l 601-1 -n 604-7
Test for update of patient 12345 in 601-1. Update the admission observations if the patient does exist in the census:
/usr/hl7/etc/idb_direct -e 8 -r 12345 -l 601-1 -c -H 182 -W 75 -S 2.7
Test for swapping patients 12345 into 601-1 and 54321 into 604-7:
/usr/hl7/etc/idb_direct -e 17 -r 12345 -l 601-1 -s 54321 -m 604-7
ADMIN
CAREVUE
idb
, dbload
and
ptMgrSup
commands. The user and host who runs idb_direct
must have an `.rhosts' entry in this account. This variable need
not exist, it is better to let the system look for its value in the file
`/usr/hl7/etc/carevue'.
idb
, dbload
and
ptMgrSup
commands. The user and host who runs idb_direct
must have an `.rhosts' entry in this account.
dbload
on it in order to create
new admission weight, height, and BSA entries.
sh(1), rcp(1), rsh(1), idb(1), dbload(1), ptMgrSup(1), section The HL7 to CareVue Gateway Program.