ORQ10 ; slc/dcm - Test this utility
;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
TEST ;Test utility
N DIC,Y,GP,ORLIST,ORVP,ORL,X1,X2,X,FLAG,O2
S (X1,X2,O2)=""
;W !,"Order # (optional): " R X:DTIME S O2=X I $L(X),'$D(^OR(100,X,0)) S O2="" W " Invalid order #" G TEST
I O2,$D(^OR(100,O2,0)) S ORVP=$P(^(0),"^",2)
I 'O2 K ^TMP("OR",$J) D ^ORUDPA
I $O(Y(0)) S ORVP=+Y($O(Y(0)))_";DPT("
Q:'$G(ORVP)
LP S DIC=100.98,DIC(0)="AEQM" D ^DIC S GP=$S(+Y>0:+Y,1:"") G:'GP TEST
CON W !!,"1 => All",?24,"6 => New",?45," 11 => Unsigned"
W !,"2 => Active/Current",?24,"7 => Pending",?46,"12 => Flagged"
W !,"3 => Discontinued",?24,"8 => Activity",?46,"13 => Verb/Phone"
W !,"4 => Completed/Expired",?24,"9 => Expanded",?46,"14 => Verb/Phone Unsign"
W !,"5 => Expiring",?23,"10 => Notifications"
W !!,"Select CONTEXT: 1// " R X:DTIME Q:'$T!(X["^") S:X="" X=1
I X'?1N.N!(X>14)!(X<1) W !,"Enter a number from 1 to 14 that matches the context list" G CON
S FLAG=X D
. S %DT="AETS",%DT("A")="Select Start Date: " D ^%DT S X1=$S(Y>0:Y,1:"") I Y<0,X["^" Q
. S %DT="AETS",%DT("A")="Select End Date: " D ^%DT S X2=$S(Y>0:Y,1:"") I Y<0,X["^" Q
W !,"What do you want stored: 1. Just the order #",!,?26,"2. Order # & text",!?26,"3. Order # & Reason for action",!?26,"4. Detailed Display fields"
R !?8,"Enter choice: 1// ",X:DTIME S:X="" X=1 Q:X["^"
S X3=$S(X=1:0,X=2:2,X=3:3,X=4:1,1:0)
W !!,"For: "_$P(^DPT(+ORVP,0),"^"),?35," "_$P(Y,"^",2),?55,"Context #"_FLAG
D EN^ORQ1(ORVP,GP,FLAG,"",X1,X2,X3)
W !?5,"<"_$S($G(^TMP("ORR",$J,ORLIST,"TOT")):^("TOT"),1:0)_" Orders found>"
I $G(^TMP("ORR",$J,ORLIST,"TOT")) W !,"Do you want to see the list of Orders" S %=1 D YN^DICN D
. I %=1 W ! S IFN=0 F S IFN=$O(^TMP("ORR",$J,ORLIST,IFN)) Q:IFN<1 W !,^(IFN)
K ^TMP("ORR",$J,ORLIST)
D READ^ORUTL G LP
Q
;
STATUS(NUM) ; -- Returns name of status by number
I NUM=1 Q "All"
I NUM=2 Q "Current"
I NUM=3 Q "Discontinued"
I NUM=4 Q "Completed/Expired"
I NUM=5 Q "Expiring"
I NUM=6 Q "New"
I NUM=7 Q "Pending"
I NUM=8 Q "Activity"
I NUM=9 Q "Expanded"
I NUM=10 Q "Notifications"
I NUM=11 Q "Unsigned"
I NUM=12 Q "Flagged"
I NUM=13 Q "Verbal/Phoned"
I NUM=14 Q "Verbal/Phoned Unsigned"
Q ""
ORQ10 ; slc/dcm - Test this utility
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
TEST ;Test utility
+1 NEW DIC,Y,GP,ORLIST,ORVP,ORL,X1,X2,X,FLAG,O2
+2 SET (X1,X2,O2)=""
+3 ;W !,"Order # (optional): " R X:DTIME S O2=X I $L(X),'$D(^OR(100,X,0)) S O2="" W " Invalid order #" G TEST
+4 IF O2
IF $DATA(^OR(100,O2,0))
SET ORVP=$PIECE(^(0),"^",2)
+5 IF 'O2
KILL ^TMP("OR",$JOB)
DO ^ORUDPA
+6 IF $ORDER(Y(0))
SET ORVP=+Y($ORDER(Y(0)))_";DPT("
+7 IF '$GET(ORVP)
QUIT
LP SET DIC=100.98
SET DIC(0)="AEQM"
DO ^DIC
SET GP=$SELECT(+Y>0:+Y,1:"")
IF 'GP
GOTO TEST
CON WRITE !!,"1 => All",?24,"6 => New",?45," 11 => Unsigned"
+1 WRITE !,"2 => Active/Current",?24,"7 => Pending",?46,"12 => Flagged"
+2 WRITE !,"3 => Discontinued",?24,"8 => Activity",?46,"13 => Verb/Phone"
+3 WRITE !,"4 => Completed/Expired",?24,"9 => Expanded",?46,"14 => Verb/Phone Unsign"
+4 WRITE !,"5 => Expiring",?23,"10 => Notifications"
+5 WRITE !!,"Select CONTEXT: 1// "
READ X:DTIME
IF '$TEST!(X["^")
QUIT
IF X=""
SET X=1
+6 IF X'?1N.N!(X>14)!(X<1)
WRITE !,"Enter a number from 1 to 14 that matches the context list"
GOTO CON
+7 SET FLAG=X
Begin DoDot:1
+8 SET %DT="AETS"
SET %DT("A")="Select Start Date: "
DO ^%DT
SET X1=$SELECT(Y>0:Y,1:"")
IF Y<0
IF X["^"
QUIT
+9 SET %DT="AETS"
SET %DT("A")="Select End Date: "
DO ^%DT
SET X2=$SELECT(Y>0:Y,1:"")
IF Y<0
IF X["^"
QUIT
End DoDot:1
+10 WRITE !,"What do you want stored: 1. Just the order #",!,?26,"2. Order # & text",!?26,"3. Order # & Reason for action",!?26,"4. Detailed Display fields"
+11 READ !?8,"Enter choice: 1// ",X:DTIME
IF X=""
SET X=1
IF X["^"
QUIT
+12 SET X3=$SELECT(X=1:0,X=2:2,X=3:3,X=4:1,1:0)
+13 WRITE !!,"For: "_$PIECE(^DPT(+ORVP,0),"^"),?35," "_$PIECE(Y,"^",2),?55,"Context #"_FLAG
+14 DO EN^ORQ1(ORVP,GP,FLAG,"",X1,X2,X3)
+15 WRITE !?5,"<"_$SELECT($GET(^TMP("ORR",$JOB,ORLIST,"TOT")):^("TOT"),1:0)_" Orders found>"
+16 IF $GET(^TMP("ORR",$JOB,ORLIST,"TOT"))
WRITE !,"Do you want to see the list of Orders"
SET %=1
DO YN^DICN
Begin DoDot:1
+17 IF %=1
WRITE !
SET IFN=0
FOR
SET IFN=$ORDER(^TMP("ORR",$JOB,ORLIST,IFN))
IF IFN<1
QUIT
WRITE !,^(IFN)
End DoDot:1
+18 KILL ^TMP("ORR",$JOB,ORLIST)
+19 DO READ^ORUTL
GOTO LP
+20 QUIT
+21 ;
STATUS(NUM) ; -- Returns name of status by number
+1 IF NUM=1
QUIT "All"
+2 IF NUM=2
QUIT "Current"
+3 IF NUM=3
QUIT "Discontinued"
+4 IF NUM=4
QUIT "Completed/Expired"
+5 IF NUM=5
QUIT "Expiring"
+6 IF NUM=6
QUIT "New"
+7 IF NUM=7
QUIT "Pending"
+8 IF NUM=8
QUIT "Activity"
+9 IF NUM=9
QUIT "Expanded"
+10 IF NUM=10
QUIT "Notifications"
+11 IF NUM=11
QUIT "Unsigned"
+12 IF NUM=12
QUIT "Flagged"
+13 IF NUM=13
QUIT "Verbal/Phoned"
+14 IF NUM=14
QUIT "Verbal/Phoned Unsigned"
+15 QUIT ""