#!/usr/bin/ksh
#imagedir="/export/home1/sdc_image_pool/images"
imagedir=$MOJOE_POOL
if (test ${#imagedir} -lt 1)
    then
    imagedir="/export/home1/sdc_image_pool/images"
fi
#mojoe_dir="/export/home/sdc/mojoe"
mojoe_dir=$MOJOE_DIR
if (test ${#mojoe_dir} -lt 1)
    then
    mojoe_dir=$HOME/mojoe
fi
$mojoe_dir/dicom/altpat1 $imagedir | sort -nr > $mojoe_dir/dicom_patientdatelist 2>/dev/null
cut -c36- < $mojoe_dir/dicom_patientdatelist > $mojoe_dir/dicom_patientlist
cat $mojoe_dir/dicom_patientdatelist | awk '{printf "%5ld %s %s %-43.43s \n", $4, $2, $3, $5}' > $mojoe_dir/patientlist
#rm -rf $mojoe_dir/dicom_patientdatelist
