#!/bin/sh 
if [ -z "$CAREVUEHOST" ]
then
  if [ -r /usr/hl7/etc/carevuehost ]
  then  
    export CAREVUEHOST=`cat /usr/hl7/etc/carevuehost`
  else
    echo must define environment CAREVUEHOST or /usr/hl7/etc/carevuehost >&2
    exit 2
  fi
fi
rsh -K -l support $CAREVUEHOST "
. /usr/M1215A/carevue/etc/carevue_env ;
. /usr/M1215A/carevue/etc/go_charting ;
idb -s -q 2>/dev/null <<__END__
set ColumnMode;
set WaitMode;
select objectId into BEDOID from BedConfig where name=\"$1\";
select prid into PATID from PtVisit where inBed=(BedConfig,\\\$BEDOID);
set Patient \\\$PATID;
select acctNum, medRecNum, name, Vorname, DOB, sex from CfgPatients;
__END__
"
