DVBHQD2 ;ALB/CMM - INDIVIDUAL HINQ ; 7/7/05 11:15am
;;4.0;HINQ;**22,33,34,43,49**;03/25/92
;
KTO K TRY,CN,DVBZ0,DVBZ1 Q
;
DOT U IO(0) W "." U IO Q
;
ABS S Y0=255-Y0 Q:($Y+Y0)<(DVBIOSL-4)
;
SROLL Q:DVBIOST'["C-"!($D(DVBJDX)) U IO(0) W !,$C(7),"Press Enter to continue or '^' to quit" R X:DTIME S:'$T X="^" W @DVBIOF S Y0=$Y Q
;
REQENT U IO(0) W !,"Request being processed " U IO Q
;
RECMAL U IO(0) W !,"Response received and mailed" Q
;
LOAD2 ;
U IO(0) W !!
I $D(DVBRTC) W $S(DVBRTC>3:"Received 'Missing Character' more than 9 times.",1:"")
W !,"Try again later."
S IO=DVBIO U IO(0) K DVBP,DVBMISS S DVBABORT=0
G ASK^DVBHQD1
Q
LOAD ;
U IO(0) W !!
I $D(DVBRTC) W $S(DVBRTC>3:"Received 'Missing Character' more than 9 times.",1:"")
U IO(0) W !," Request loaded into the HINQ Suspense file with a status of Pending."
Q
RETRY ;
N ANS
S DVBRTC=DVBRTC+1 I DVBRTC>3 S DVBNRT="N" Q
U IO(0) R !!,"Received 'Missing Character' 3 times,",!,"Would you like to try again (Y/N)? Y//",ANS:DTIME
I ('$T)!(ANS["^")!("N"=$E(ANS))!("n"=$E(ANS)) S DVBNRT="N" Q
I ANS["?" W !!,"Enter Y to try again or N to Quit",!! G RETRY
I (ANS="")!("Yy"[$E(ANS)) S DVBNRT="Y",DVBTRY=1 W !! Q
G RETRY
;
SEND K X U IO F Z=1:1:1000 R *X:0 Q:'$T
W $S('TRY:DVBZ0,1:DVBZ1),$C(13),! S DVBECHO=$P($H,",",2)
;
REC ;;;U IO R X:10 S DVBECHO=$P($H,",",2)-DVBECHO I 'DVBTSK D REQENT^DVBHQD2
;;;I '$L(X) S DVBABORT=DVBABORT+1 U IO(0) W:'DVBTSK "No response" H 1 Q
;
S F4=5
F Z=1:1:10 R X(1)#512:33 Q:$L(X(1))&(X(1)'=$C(10)) D:DVBXM DOT
S F1=$F(X(1),DVBEND) G:F1 OK^DVBHQD1
;
;added with DVB*4*49 to make loops more robust and to add more
;iterations of the loop if needed
N DVBC,DVBCT
S DVBCT=0
F DVBC=2:1:30 D LOOP Q:DVBCT=1
I DVBCT=0 S DVBABORT=DVBABORT+1
Q
LOOP ;
F Z=1:1:4 R X(DVBC)#512:5 Q:$L(X(DVBC))!DVBCT=1 D:DVBXM DOT
S F1=$F(X(DVBC),DVBEND) I F1 S DVBCT=1 G OK^DVBHQD1
S W=DVBC D CH^DVBHQD1 I F1 S DVBCT=1 G OK^DVBHQD1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVBHQD2 1991 printed Dec 13, 2024@01:58:35 Page 2
DVBHQD2 ;ALB/CMM - INDIVIDUAL HINQ ; 7/7/05 11:15am
+1 ;;4.0;HINQ;**22,33,34,43,49**;03/25/92
+2 ;
KTO KILL TRY,CN,DVBZ0,DVBZ1
QUIT
+1 ;
DOT USE IO(0)
WRITE "."
USE IO
QUIT
+1 ;
ABS SET Y0=255-Y0
if ($Y+Y0)<(DVBIOSL-4)
QUIT
+1 ;
SROLL if DVBIOST'["C-"!($DATA(DVBJDX))
QUIT
USE IO(0)
WRITE !,$CHAR(7),"Press Enter to continue or '^' to quit"
READ X:DTIME
if '$TEST
SET X="^"
WRITE @DVBIOF
SET Y0=$Y
QUIT
+1 ;
REQENT USE IO(0)
WRITE !,"Request being processed "
USE IO
QUIT
+1 ;
RECMAL USE IO(0)
WRITE !,"Response received and mailed"
QUIT
+1 ;
LOAD2 ;
+1 USE IO(0)
WRITE !!
+2 IF $DATA(DVBRTC)
WRITE $SELECT(DVBRTC>3:"Received 'Missing Character' more than 9 times.",1:"")
+3 WRITE !,"Try again later."
+4 SET IO=DVBIO
USE IO(0)
KILL DVBP,DVBMISS
SET DVBABORT=0
+5 GOTO ASK^DVBHQD1
+6 QUIT
LOAD ;
+1 USE IO(0)
WRITE !!
+2 IF $DATA(DVBRTC)
WRITE $SELECT(DVBRTC>3:"Received 'Missing Character' more than 9 times.",1:"")
+3 USE IO(0)
WRITE !," Request loaded into the HINQ Suspense file with a status of Pending."
+4 QUIT
RETRY ;
+1 NEW ANS
+2 SET DVBRTC=DVBRTC+1
IF DVBRTC>3
SET DVBNRT="N"
QUIT
+3 USE IO(0)
READ !!,"Received 'Missing Character' 3 times,",!,"Would you like to try again (Y/N)? Y//",ANS:DTIME
+4 IF ('$TEST)!(ANS["^")!("N"=$EXTRACT(ANS))!("n"=$EXTRACT(ANS))
SET DVBNRT="N"
QUIT
+5 IF ANS["?"
WRITE !!,"Enter Y to try again or N to Quit",!!
GOTO RETRY
+6 IF (ANS="")!("Yy"[$EXTRACT(ANS))
SET DVBNRT="Y"
SET DVBTRY=1
WRITE !!
QUIT
+7 GOTO RETRY
+8 ;
SEND KILL X
USE IO
FOR Z=1:1:1000
READ *X:0
if '$TEST
QUIT
+1 WRITE $SELECT('TRY:DVBZ0,1:DVBZ1),$CHAR(13),!
SET DVBECHO=$PIECE($HOROLOG,",",2)
+2 ;
REC ;;;U IO R X:10 S DVBECHO=$P($H,",",2)-DVBECHO I 'DVBTSK D REQENT^DVBHQD2
+1 ;;;I '$L(X) S DVBABORT=DVBABORT+1 U IO(0) W:'DVBTSK "No response" H 1 Q
+2 ;
+3 SET F4=5
+4 FOR Z=1:1:10
READ X(1)#512:33
if $LENGTH(X(1))&(X(1)'=$CHAR(10))
QUIT
if DVBXM
DO DOT
+5 SET F1=$FIND(X(1),DVBEND)
if F1
GOTO OK^DVBHQD1
+6 ;
+7 ;added with DVB*4*49 to make loops more robust and to add more
+8 ;iterations of the loop if needed
+9 NEW DVBC,DVBCT
+10 SET DVBCT=0
+11 FOR DVBC=2:1:30
DO LOOP
if DVBCT=1
QUIT
+12 IF DVBCT=0
SET DVBABORT=DVBABORT+1
+13 QUIT
LOOP ;
+1 FOR Z=1:1:4
READ X(DVBC)#512:5
if $LENGTH(X(DVBC))!DVBCT=1
QUIT
if DVBXM
DO DOT
+2 SET F1=$FIND(X(DVBC),DVBEND)
IF F1
SET DVBCT=1
GOTO OK^DVBHQD1
+3 SET W=DVBC
DO CH^DVBHQD1
IF F1
SET DVBCT=1
GOTO OK^DVBHQD1
+4 QUIT