| 1 | ORQ10 ; slc/dcm - Test this utility | 
|---|
| 2 | ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997 | 
|---|
| 3 | TEST ;Test utility | 
|---|
| 4 | N DIC,Y,GP,ORLIST,ORVP,ORL,X1,X2,X,FLAG,O2 | 
|---|
| 5 | S (X1,X2,O2)="" | 
|---|
| 6 | ;W !,"Order # (optional): " R X:DTIME S O2=X I $L(X),'$D(^OR(100,X,0)) S O2="" W "   Invalid order #" G TEST | 
|---|
| 7 | I O2,$D(^OR(100,O2,0)) S ORVP=$P(^(0),"^",2) | 
|---|
| 8 | I 'O2 K ^TMP("OR",$J) D ^ORUDPA | 
|---|
| 9 | I $O(Y(0)) S ORVP=+Y($O(Y(0)))_";DPT(" | 
|---|
| 10 | Q:'$G(ORVP) | 
|---|
| 11 | LP S DIC=100.98,DIC(0)="AEQM" D ^DIC S GP=$S(+Y>0:+Y,1:"") G:'GP TEST | 
|---|
| 12 | CON W !!,"1 => All",?24,"6 => New",?45," 11 => Unsigned" | 
|---|
| 13 | W !,"2 => Active/Current",?24,"7 => Pending",?46,"12 => Flagged" | 
|---|
| 14 | W !,"3 => Discontinued",?24,"8 => Activity",?46,"13 => Verb/Phone" | 
|---|
| 15 | W !,"4 => Completed/Expired",?24,"9 => Expanded",?46,"14 => Verb/Phone Unsign" | 
|---|
| 16 | W !,"5 => Expiring",?23,"10 => Notifications" | 
|---|
| 17 | W !!,"Select CONTEXT: 1// " R X:DTIME Q:'$T!(X["^")  S:X="" X=1 | 
|---|
| 18 | I X'?1N.N!(X>14)!(X<1) W !,"Enter a number from 1 to 14 that matches the context list" G CON | 
|---|
| 19 | S FLAG=X D | 
|---|
| 20 | . S %DT="AETS",%DT("A")="Select Start Date: " D ^%DT S X1=$S(Y>0:Y,1:"") I Y<0,X["^" Q | 
|---|
| 21 | . S %DT="AETS",%DT("A")="Select End Date: " D ^%DT S X2=$S(Y>0:Y,1:"") I Y<0,X["^" Q | 
|---|
| 22 | 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" | 
|---|
| 23 | R !?8,"Enter choice: 1// ",X:DTIME S:X="" X=1 Q:X["^" | 
|---|
| 24 | S X3=$S(X=1:0,X=2:2,X=3:3,X=4:1,1:0) | 
|---|
| 25 | W !!,"For: "_$P(^DPT(+ORVP,0),"^"),?35," "_$P(Y,"^",2),?55,"Context #"_FLAG | 
|---|
| 26 | D EN^ORQ1(ORVP,GP,FLAG,"",X1,X2,X3) | 
|---|
| 27 | W !?5,"<"_$S($G(^TMP("ORR",$J,ORLIST,"TOT")):^("TOT"),1:0)_" Orders found>" | 
|---|
| 28 | I $G(^TMP("ORR",$J,ORLIST,"TOT")) W !,"Do you want to see the list of Orders" S %=1 D YN^DICN D | 
|---|
| 29 | . I %=1 W ! S IFN=0 F  S IFN=$O(^TMP("ORR",$J,ORLIST,IFN)) Q:IFN<1  W !,^(IFN) | 
|---|
| 30 | K ^TMP("ORR",$J,ORLIST) | 
|---|
| 31 | D READ^ORUTL G LP | 
|---|
| 32 | Q | 
|---|
| 33 | ; | 
|---|
| 34 | STATUS(NUM) ; -- Returns name of status by number | 
|---|
| 35 | I NUM=1 Q "All" | 
|---|
| 36 | I NUM=2 Q "Current" | 
|---|
| 37 | I NUM=3 Q "Discontinued" | 
|---|
| 38 | I NUM=4 Q "Completed/Expired" | 
|---|
| 39 | I NUM=5 Q "Expiring" | 
|---|
| 40 | I NUM=6 Q "New" | 
|---|
| 41 | I NUM=7 Q "Pending" | 
|---|
| 42 | I NUM=8 Q "Activity" | 
|---|
| 43 | I NUM=9 Q "Expanded" | 
|---|
| 44 | I NUM=10 Q "Notifications" | 
|---|
| 45 | I NUM=11 Q "Unsigned" | 
|---|
| 46 | I NUM=12 Q "Flagged" | 
|---|
| 47 | I NUM=13 Q "Verbal/Phoned" | 
|---|
| 48 | I NUM=14 Q "Verbal/Phoned Unsigned" | 
|---|
| 49 | Q "" | 
|---|