Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACDRL0

ACDRL0.m

Go to the documentation of this file.
ACDRL0 ;IHS/ADC/EDE/KML - SCREEN LOGIC;
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;
 ;
Q ;EP
 K DIC,DIR
 K ^TMP("ACDRL",$J,"QMAN"),^UTILITY("AMQQ TAX",$J)
 K DIC,X,Y,DD S X=$P(^ACDTITEM(ACDCRIT,0),U,3),DIC="^AMQQ(5,",DIC(0)="EQXM",DIC("S")="I $P(^(0),U,14)" D ^DIC K DIC,DA,DINUM,DICR I Y=-1 W "OOPS - QMAN NOT CURRENT - QUITTING" Q
 S ACDQMAN=+Y
 D ^AMQQGTX0(ACDQMAN,"^TMP(""ACDRL"",$J,""QMAN"",")
 I '$D(^TMP("ACDRL",$J,"QMAN")) W !!,$C(7),"** No ",$P(^ACDTITEM(ACDCRIT,0),U)," selected, all will be included." Q
 I $D(^TMP("ACDRL",$J,"QMAN","*")) K ^TMP("ACDRL",$J,"QMAN")
 S ^ACDRPTD(ACDRPT,11,ACDCRIT,0)=ACDCRIT,^ACDRPTD(ACDRPT,11,"B",ACDCRIT,ACDCRIT)=""
 S X="",Y=0 F  S X=$O(^TMP("ACDRL",$J,"QMAN",X)) Q:X=""  S Y=Y+1,^ACDRPTD(ACDRPT,11,ACDCRIT,11,Y,0)=X,^ACDRPTD(ACDRPT,11,ACDCRIT,11,"B",X,Y)="",^ACDRPTD(ACDRPT,11,ACDCRIT,11,0)="^9002171.8110101A^"_Y_"^"_Y
 K X,Y,Z,ACDQMAN,V
 K ^TMP("ACDRL",$J,"QMAN")
 Q
R ;EP
 K DIR,DIRUT,DUOUT,DTOUT,DA
 S DIR(0)=$P(^ACDTITEM(ACDCRIT,0),U,4)_"O",DIR("A")="ENTER "_$P(^(0),U) D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 Q:$D(DIRUT)
 I Y="" Q
 S ^ACDRPTD(ACDRPT,11,ACDCRIT,0)=ACDCRIT,^ACDRPTD(ACDRPT,11,"B",ACDCRIT,ACDCRIT)=""
 S ACDCNT=ACDCNT+1,^ACDRPTD(ACDRPT,11,ACDCRIT,11,ACDCNT,0)=$P(Y,U),^ACDRPTD(ACDRPT,11,ACDCRIT,11,"B",$P(Y,U),ACDCNT)="",^ACDRPTD(ACDRPT,11,ACDCRIT,11,0)="^9002171.8110101A^"_ACDCNT_"^"_ACDCNT
 G R
 Q
D ;DATE RANGE
BD ;get beginning date
 W ! S DIR(0)="D^::EP",DIR("A")="Enter beginning "_ACDTEXT_" for Search" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) Q
 S ACDGDB=Y
ED ;get ending date
 W ! S DIR(0)="D^"_ACDGDB_"::EP",DIR("A")="Enter ending "_ACDTEXT_" for Search" S Y=ACDGDB D DD^%DT S DIR("B")=Y,Y="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G BD
 S ACDGDE=Y
 S X1=ACDGDB,X2=-1 D C^%DTC S ACDGDS=X
 ;
 S ^ACDRPTD(ACDRPT,11,ACDCRIT,0)=ACDCRIT,^ACDRPTD(ACDRPT,11,"B",ACDCRIT,ACDCRIT)=""
 S ACDCNT=0,^ACDRPTD(ACDRPT,11,ACDCRIT,11,ACDCNT,0)="^9002171.8110101A^1^1" S ACDCNT=ACDCNT+1,^ACDRPTD(ACDRPT,11,ACDCRIT,11,1,0)=ACDGDB_U_ACDGDE,^ACDRPTD(ACDRPT,11,ACDCRIT,11,"B",ACDGDB,ACDCNT)=""
 Q
N ;
 K ^ACDRPTD(ACDRPT,11,ACDCRIT),^ACDRPTD(ACDRPT,11,"B",ACDCRIT)
 S DIR(0)="FO^1:7",DIR("A")="Enter a Range of numbers (e.g. 5-12,1-1)" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !!,"No numeric range entered.  All numerics will be included." Q
 I Y'?1.3N1"-"1.3N W !!,$C(7),$C(7),"Enter a numeric range in the format nnn-nnn.  E.g. 0-5, 0-99, 5-20." G N
 I $D(^ACDTITEM(ACDCRIT,25)) S X=Y X ^(25) I '$D(X) G N ;if input tx exists and fails G N
 I '$D(^ACDTITEM(ACDCRIT,25)),Y'?1.3N1"-"1.3N W !!,$C(7),$C(7),"Enter a numeric range in the format nnn-nnn.  E.g. 0-5, 0-99, 5-20." G N
 S ^ACDRPTD(ACDRPT,11,ACDCRIT,0)=ACDCRIT,^ACDRPTD(ACDRPT,11,"B",ACDCRIT,ACDCRIT)=""
 S ^ACDRPTD(ACDRPT,11,ACDCRIT,0)=ACDCRIT,^ACDRPTD(ACDRPT,11,"B",ACDCRIT,ACDCRIT)=""
 S ^ACDRPTD(ACDRPT,11,ACDCRIT,11,0)="^9002171.82110101A^1^1" S ^ACDRPTD(ACDRPT,11,ACDCRIT,11,1,0)=$P(Y,"-"),^ACDRPTD(ACDRPT,11,ACDCRIT,11,"B",$P(Y,"-"),1)=""
 S $P(^ACDRPTD(ACDRPT,11,ACDCRIT,11,1,0),U,2)=$P(Y,"-",2)
 Q
F ;FREE TEXT RANGE
 K ^ACDRPTD(ACDRPT,11,ACDCRIT),^ACDRPTD(ACDRPT,11,"B",ACDCRIT)
 S DIR(0)="FO^1:20",DIR("A")="Enter a Range of Characters for Search (e.g. A:B) " D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !!,"No range entered.  All ",ACDTEXT,"  will be included." Q
 I Y'?1.ANP1":"1.ANP W !!,$C(7),$C(7),"Enter an free text range in the format AAA:AAA.  E.g. 94-01:94-200, CA:CZ, A:Z." G F
 S ^ACDRPTD(ACDRPT,11,ACDCRIT,0)=ACDCRIT,^ACDRPTD(ACDRPT,11,"B",ACDCRIT,ACDCRIT)=""
 S ACDCNT=0,^ACDRPTD(ACDRPT,11,ACDCRIT,11,ACDCNT,0)="^9002171.8110101A^1^1" S ACDCNT=ACDCNT+1,^ACDRPTD(ACDRPT,11,ACDCRIT,11,1,0)=$P(X,":")_U_$P(X,":",2),^ACDRPTD(ACDRPT,11,ACDCRIT,11,"B",$P(X,":"),ACDCNT)=""
 Q
Y ;
 D Y^ACDRL01
 Q
SPECIAL ;
 D SPECIAL^ACDRL01
 Q