AMQQAV2 ; IHS/CMI/THL - MORE OVERFLOW FROM AMQQAV ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;-----
COMPT ; ENTRY POINT FROM AMQQAV
I AMQQNOCO>1 D COMPT2 Q
I $D(AMQQXX) G COMPT1
R !,?(5*$D(AMQQZNM)),"Titre: ",X:DTIME E S AMQQQUIT="" Q
I X?1."?" W !!,"Enter a titre to be used as the comparison value (e.g. NEGATIVE, 1:64 etc.)",!! G COMPT
I X=U S AMQQQUIT="" Q
I X="" Q
COMPT1 I X=0,AMQQSQBS="<" Q:$D(AMQQXX) W " ??",*7 G COMPT
I X?1"1:"1.5N S X=$P(X,":",2)
I X=1,AMQQSQBS="<",$D(AMQQSQNT) K AMQQSQNT S AMQQSQBS="=",X="POSITIVE"
I X=1,AMQQSQBS=">",$D(AMQQSQNT) K AMQQSQNT S AMQQSQBS="<",X="POSITIVE"
I X=+X,X>0 G CN
I $G(AMQQSQBS)'="<",$E("NEGATIVE",1,$L(X))=X W:'$D(AMQQXX) $E("NEGATIVE",$L(X)+1,8) S X=0 G CN
I $G(AMQQSQBS)="<"!($G(AMQQSQNM)="IS NOT"),$E("POSITIVE",1,$L(X))=X W:'$D(AMQQXX) $E("POSITIVE",$L(X)+1,8) K AMQQSQNT S X=0,AMQQSQBS="=",AMQQSQF1="EQUAL",AMQQSQF2="AMQQF",AMQQSQN=211,AMQQSQNM="IS" G CN
I $G(AMQQSQBS)="=",$E("POSITIVE",1,$L(X))=X W:'$D(AMQQXX) $E("POSITIVE",$L(X)+1,8) S X=0,AMQQSQF1="GRT",AMQQSQF2="AMQQF",AMQQSQBS=">",AMQQSQNM="GREATER THAN",AMQQSQN=209 G CN
I X'?1.5N Q:$D(AMQQXX) W " ??",*7 G COMPT
I '$D(AMQQXX) W " (1:",X,")"
CN S AMQQCOMP=X
Q
;
COMPT2 I $D(AMQQXX) N Z S Z=X,X=$P(X,";") G COMPT21
R !,?(5*$D(AMQQZNM)),"Enter the lower titre: ",X:DTIME E S AMQQQUIT="" Q
COMPT21 I X="" S AMQQCOMP="" Q
I X=U S AMQQQUIT="" Q
I X?1."?" W !,"Enter a titre (e.g. 'NEGATIVE', '1:64', etc.)",!!! G COMPT2
I X?1"1:"1.5N S X=$P(X,":",2) G N
I $E("NEGATIVE",1,$L(X))=X W $E("NEGATIVE",$L(X)+1,8) S X=0 G N
I X'?1.5N W " ??",*7 G COMPT2
W " (1:",X,")"
N S AMQQCOMP=X_";"
I $D(AMQQXX) S AMQQXX=$P(Z,";",2) G N21
N2 R !,?(5*$D(AMQQZNM)),"Enter the upper titre: ",X:DTIME E S AMQQQUIT="" Q
N21 I X="" S AMQQCOMP="" Q
I X?1."?" W !,"Enter a titre (e.g. 'NEGATIVE', '1:64', etc.)",!!! G COMPT2
I X=U S AMQQQUIT="" Q
I X?1"1:"1.5N S X=$P(X,":",2) I X'<+AMQQCOMP G CN2
I X'?1.5N!(X<+AMQQCOMP) W " ??",*7 G COMPT2
W " (1:",X,")"
CN2 S AMQQCOMP=AMQQCOMP_X
Q
;
COMPV ; ENTRY POINT FROM AMQQAV
I AMQQNOCO=2 D COMPV2 Q
COMPV1 E W !,"Visual acuity: 20/" R X:DTIME E S X=U
I $E(X)=U S AMQQQUIT="" Q
I X="" S AMQQCOMP="" Q
I X="BLIND" S AMQQCOMP=999 Q
I X?1."?" W !!,"Enter a Snellen Chart acuity like '20/40' or the word 'BLIND'",!! G COMPV
I X?1.3N,X,'(X#5) S AMQQCOMP=X Q
W " ??",*7 G COMPV1
;
COMPV2 W !!,"Enter the BEST visual acuity allowed in the range =>"
D COMPV1
G:AMQQCOMP="" COMPVEXT
S AMQQCOM1=AMQQCOMP
W !!,"Enter the WORST visual acuity allowed in the range =>"
D COMPV1
G:AMQQCOMP="" COMPVEXT
S AMQQCOM2=AMQQCOMP
I AMQQCOM1>AMQQCOM2 W " ??",*7,!,"The 'worst' value cannot be smaller than the 'best'!" G COMPV2
S AMQQCOMP=AMQQCOM1_";"_AMQQCOM2
COMPVEXT K AMQQCOM1,AMQQCOM2
Q
;
AMQQAV2 ; IHS/CMI/THL - MORE OVERFLOW FROM AMQQAV ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;-----
COMPT ; ENTRY POINT FROM AMQQAV
+1 IF AMQQNOCO>1
DO COMPT2
QUIT
+2 IF $DATA(AMQQXX)
GOTO COMPT1
+3 READ !,?(5*$DATA(AMQQZNM)),"Titre: ",X:DTIME
IF '$TEST
SET AMQQQUIT=""
QUIT
+4 IF X?1."?"
WRITE !!,"Enter a titre to be used as the comparison value (e.g. NEGATIVE, 1:64 etc.)",!!
GOTO COMPT
+5 IF X=U
SET AMQQQUIT=""
QUIT
+6 IF X=""
QUIT
COMPT1 IF X=0
IF AMQQSQBS="<"
IF $DATA(AMQQXX)
QUIT
WRITE " ??",*7
GOTO COMPT
+1 IF X?1"1:"1.5N
SET X=$PIECE(X,":",2)
+2 IF X=1
IF AMQQSQBS="<"
IF $DATA(AMQQSQNT)
KILL AMQQSQNT
SET AMQQSQBS="="
SET X="POSITIVE"
+3 IF X=1
IF AMQQSQBS=">"
IF $DATA(AMQQSQNT)
KILL AMQQSQNT
SET AMQQSQBS="<"
SET X="POSITIVE"
+4 IF X=+X
IF X>0
GOTO CN
+5 IF $GET(AMQQSQBS)'="<"
IF $EXTRACT("NEGATIVE",1,$LENGTH(X))=X
IF '$DATA(AMQQXX)
WRITE $EXTRACT("NEGATIVE",$LENGTH(X)+1,8)
SET X=0
GOTO CN
+6 IF $GET(AMQQSQBS)="<"!($GET(AMQQSQNM)="IS NOT")
IF $EXTRACT("POSITIVE",1,$LENGTH(X))=X
IF '$DATA(AMQQXX)
WRITE $EXTRACT("POSITIVE",$LENGTH(X)+1,8)
KILL AMQQSQNT
SET X=0
SET AMQQSQBS="="
SET AMQQSQF1="EQUAL"
SET AMQQSQF2="AMQQF"
SET AMQQSQN=211
SET AMQQSQNM="IS"
GOTO CN
+7 IF $GET(AMQQSQBS)="="
IF $EXTRACT("POSITIVE",1,$LENGTH(X))=X
IF '$DATA(AMQQXX)
WRITE $EXTRACT("POSITIVE",$LENGTH(X)+1,8)
SET X=0
SET AMQQSQF1="GRT"
SET AMQQSQF2="AMQQF"
SET AMQQSQBS=">"
SET AMQQSQNM="GREATER THAN"
SET AMQQSQN=209
GOTO CN
+8 IF X'?1.5N
IF $DATA(AMQQXX)
QUIT
WRITE " ??",*7
GOTO COMPT
+9 IF '$DATA(AMQQXX)
WRITE " (1:",X,")"
CN SET AMQQCOMP=X
+1 QUIT
+2 ;
COMPT2 IF $DATA(AMQQXX)
NEW Z
SET Z=X
SET X=$PIECE(X,";")
GOTO COMPT21
+1 READ !,?(5*$DATA(AMQQZNM)),"Enter the lower titre: ",X:DTIME
IF '$TEST
SET AMQQQUIT=""
QUIT
COMPT21 IF X=""
SET AMQQCOMP=""
QUIT
+1 IF X=U
SET AMQQQUIT=""
QUIT
+2 IF X?1."?"
WRITE !,"Enter a titre (e.g. 'NEGATIVE', '1:64', etc.)",!!!
GOTO COMPT2
+3 IF X?1"1:"1.5N
SET X=$PIECE(X,":",2)
GOTO N
+4 IF $EXTRACT("NEGATIVE",1,$LENGTH(X))=X
WRITE $EXTRACT("NEGATIVE",$LENGTH(X)+1,8)
SET X=0
GOTO N
+5 IF X'?1.5N
WRITE " ??",*7
GOTO COMPT2
+6 WRITE " (1:",X,")"
N SET AMQQCOMP=X_";"
+1 IF $DATA(AMQQXX)
SET AMQQXX=$PIECE(Z,";",2)
GOTO N21
N2 READ !,?(5*$DATA(AMQQZNM)),"Enter the upper titre: ",X:DTIME
IF '$TEST
SET AMQQQUIT=""
QUIT
N21 IF X=""
SET AMQQCOMP=""
QUIT
+1 IF X?1."?"
WRITE !,"Enter a titre (e.g. 'NEGATIVE', '1:64', etc.)",!!!
GOTO COMPT2
+2 IF X=U
SET AMQQQUIT=""
QUIT
+3 IF X?1"1:"1.5N
SET X=$PIECE(X,":",2)
IF X'<+AMQQCOMP
GOTO CN2
+4 IF X'?1.5N!(X<+AMQQCOMP)
WRITE " ??",*7
GOTO COMPT2
+5 WRITE " (1:",X,")"
CN2 SET AMQQCOMP=AMQQCOMP_X
+1 QUIT
+2 ;
COMPV ; ENTRY POINT FROM AMQQAV
+1 IF AMQQNOCO=2
DO COMPV2
QUIT
COMPV1 IF '$TEST
WRITE !,"Visual acuity: 20/"
READ X:DTIME
IF '$TEST
SET X=U
+1 IF $EXTRACT(X)=U
SET AMQQQUIT=""
QUIT
+2 IF X=""
SET AMQQCOMP=""
QUIT
+3 IF X="BLIND"
SET AMQQCOMP=999
QUIT
+4 IF X?1."?"
WRITE !!,"Enter a Snellen Chart acuity like '20/40' or the word 'BLIND'",!!
GOTO COMPV
+5 IF X?1.3N
IF X
IF '(X#5)
SET AMQQCOMP=X
QUIT
+6 WRITE " ??",*7
GOTO COMPV1
+7 ;
COMPV2 WRITE !!,"Enter the BEST visual acuity allowed in the range =>"
+1 DO COMPV1
+2 IF AMQQCOMP=""
GOTO COMPVEXT
+3 SET AMQQCOM1=AMQQCOMP
+4 WRITE !!,"Enter the WORST visual acuity allowed in the range =>"
+5 DO COMPV1
+6 IF AMQQCOMP=""
GOTO COMPVEXT
+7 SET AMQQCOM2=AMQQCOMP
+8 IF AMQQCOM1>AMQQCOM2
WRITE " ??",*7,!,"The 'worst' value cannot be smaller than the 'best'!"
GOTO COMPV2
+9 SET AMQQCOMP=AMQQCOM1_";"_AMQQCOM2
COMPVEXT KILL AMQQCOM1,AMQQCOM2
+1 QUIT
+2 ;