AMHLETM ; IHS/CMI/LAB - get time for outpatient visit ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
;
GETTIME ;
S Y=$P(^AMHREC(AMHR,0),U) D DD^%DT S AMHTIME=$P(Y,"@",2)
S AMHPROMP=$S(AMHACTN="1":"Arrival Time.............: ",1:"TIME OF VISIT: ") W !,AMHPROMP,$S(AMHTIME]"":AMHTIME_"// ",1:"12:00// ") R X:$S($D(DTIME):DTIME,1:300) S:'$T X="^" S:X="" X=$S(AMHTIME]"":AMHTIME,1:"12:00")
S AMHTIME=""
I X=""!(X="^") W $C(7)_$C(7)," Time Required! Enter 1200 or 'D' for a default of 12 if you do not know the time." G GETTIME
I X["?" W !,"Enter time of visit, or 'D' for default." G GETTIME
I X="D" S X="12:00" W " ",X
EDTIME S AMHTIME=X,X=AMHDATE_"@"_AMHTIME
S %DT="ET" D ^%DT I Y<0 W !!,"Invalid time entry, enter time of visit or 1200 for the default." G GETTIME
I '$D(X) W $C(7)_$C(7) G GETTIME
I X="-1" W ! G GETTIME
S AMHDTIME=Y
K Y,AMHTIME,X,%DT,AMHPROMP
Q
AMHLETM ; IHS/CMI/LAB - get time for outpatient visit ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
+3 ;
GETTIME ;
+1 SET Y=$PIECE(^AMHREC(AMHR,0),U)
DO DD^%DT
SET AMHTIME=$PIECE(Y,"@",2)
+2 SET AMHPROMP=$SELECT(AMHACTN="1":"Arrival Time.............: ",1:"TIME OF VISIT: ")
WRITE !,AMHPROMP,$SELECT(AMHTIME]"":AMHTIME_"// ",1:"12:00// ")
READ X:$SELECT($DATA(DTIME):DTIME,1:300)
IF '$TEST
SET X="^"
IF X=""
SET X=$SELECT(AMHTIME]"":AMHTIME,1:"12:00")
+3 SET AMHTIME=""
+4 IF X=""!(X="^")
WRITE $CHAR(7)_$CHAR(7)," Time Required! Enter 1200 or 'D' for a default of 12 if you do not know the time."
GOTO GETTIME
+5 IF X["?"
WRITE !,"Enter time of visit, or 'D' for default."
GOTO GETTIME
+6 IF X="D"
SET X="12:00"
WRITE " ",X
EDTIME SET AMHTIME=X
SET X=AMHDATE_"@"_AMHTIME
+1 SET %DT="ET"
DO ^%DT
IF Y<0
WRITE !!,"Invalid time entry, enter time of visit or 1200 for the default."
GOTO GETTIME
+2 IF '$DATA(X)
WRITE $CHAR(7)_$CHAR(7)
GOTO GETTIME
+3 IF X="-1"
WRITE !
GOTO GETTIME
+4 SET AMHDTIME=Y
+5 KILL Y,AMHTIME,X,%DT,AMHPROMP
+6 QUIT