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

BWGRVL0.m

Go to the documentation of this file.
BWGRVL0 ; IHS/CMI/LAB - SCREEN LOGIC ;03-Sep-2003 20:09;PLS
 ;;2.0;WOMEN'S HEALTH;**6,8,9**;MAY 16, 1996
 ;
 ;IHS/CMI/LAB - modified file numbers
 ;
Q ;EP
 K ^XTMP("BWGRVL",$J,"QMAN"),^UTILITY("AMQQ TAX",$J)
 K DIC,X,Y,DD S X=$P(^BWGRI(BWGRCRIT,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 BWGRQMAN=+Y
 I $P(^BWGRI(BWGRCRIT,0),U)="Cause of Injury" S AMQQSQNM="CAUSE OF INJURY"
 D ^AMQQGTX0(BWGRQMAN,"^XTMP(""BWGRVL"",$J,""QMAN"",")
 I '$D(^XTMP("BWGRVL",$J,"QMAN")) W !!,$C(7),"** No ",$P(^BWGRI(BWGRCRIT,0),U)," selected, all will be included." Q
 I $D(^XTMP("BWGRVL",$J,"QMAN","*")) K ^XTMP("BWGRVL",$J,"QMAN")
 S ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,0)=BWGRCRIT,^BWGRTRPT(BWGRRPT,11,"B",BWGRCRIT,BWGRCRIT)=""
 S X="",Y=0 F  S X=$O(^XTMP("BWGRVL",$J,"QMAN",X)) Q:X=""  S Y=Y+1,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,Y,0)=X,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,"B",X,Y)="",^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,0)="^9002086.8910101A^"_Y_"^"_Y
 K X,Y,Z,BWGRQMAN,V,AMQQSQNM
 K ^XTMP("BWGRVL",$J,"QMAN")
 Q
R ;EP
 S DIR(0)=$P(^BWGRI(BWGRCRIT,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 ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,0)=BWGRCRIT,^BWGRTRPT(BWGRRPT,11,"B",BWGRCRIT,BWGRCRIT)=""
 S BWGRCNT=BWGRCNT+1,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,BWGRCNT,0)=$P(Y,U),^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,"B",$P(Y,U),BWGRCNT)="",^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,0)="^9002086.8910101A^"_BWGRCNT_"^"_BWGRCNT
 G R
 Q
D ;DATE RANGE
BD ;get beginning date
 W ! S DIR(0)="D^::EP",DIR("A")="Enter beginning "_BWGRTEXT_" for Search" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) Q
 S BWGRBDAT=Y
ED ;get ending date
 W ! S DIR(0)="D^"_BWGRBDAT_"::EP",DIR("A")="Enter ending "_BWGRTEXT_" for Search" S Y=BWGRBDAT D DD^%DT S DIR("B")=Y,Y="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G BD
 S BWGREDAT=Y
 S X1=BWGRBDAT,X2=-1 D C^%DTC S BWGRSDAT=X
 ;
 S ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,0)=BWGRCRIT,^BWGRTRPT(BWGRRPT,11,"B",BWGRCRIT,BWGRCRIT)=""
 S BWGRCNT=0,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,BWGRCNT)="^9002086.8910101A^1^1" S BWGRCNT=BWGRCNT+1,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,1,0)=BWGRBDAT_U_BWGREDAT,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,"B",BWGRBDAT,BWGRCNT)=""
 Q
N ;EP
 K ^BWGRTRPT(BWGRRPT,11,BWGRCRIT),^BWGRTRPT(BWGRRPT,11,"B",BWGRCRIT)
 S DIR(0)="FO^1:11",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 $D(^BWGRI(BWGRCRIT,25)) S X=Y X ^(25) I '$D(X),$D(^BWGRI(BWGRCRIT,26)) W !! X ^(26) G N ;if input tx exists and fails G N
 I '$D(^BWGRI(BWGRCRIT,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 ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,0)=BWGRCRIT,^BWGRTRPT(BWGRRPT,11,"B",BWGRCRIT,BWGRCRIT)=""
 S ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,0)="^9002086.8910101A^1^1" S ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,1,0)=$P(Y,"-"),^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,"B",$P(Y,"-"),1)=""
 S $P(^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,1,0),U,2)=$P(Y,"-",2)
 Q
J ;EP - JUST A HIT
 S ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,0)=BWGRCRIT,^BWGRTRPT(BWGRRPT,11,"B",BWGRCRIT,BWGRCRIT)=""
 S ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,1,0)=1,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,"B",1,1)="",^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,0)="^9002086.8910101A^"_1_"^"_1
 Q
Y ;EP - called from apclvl0
 S DIR(0)="S^1:"_BWGRTEXT_";0:NO "_BWGRTEXT_"",DIR("A")="Should "_$S(BWGRPTVS="P":"patient",1:"procedure")_" have",DIR("B")="1" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 Q:$D(DIRUT)
 Q:Y=""
 S ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,0)=BWGRCRIT,^BWGRTRPT(BWGRRPT,11,"B",BWGRCRIT,BWGRCRIT)=""
 S ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,1,0)=Y,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,"B",Y,1)="",^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,0)="^9002086.8910101A^"_1_"^"_1
 Q
F ;FREE TEXT RANGE
 K ^BWGRTRPT(BWGRRPT,11,BWGRCRIT),^BWGRTRPT(BWGRRPT,11,"B",BWGRCRIT)
 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 ",BWGRTEXT,"  will be included." Q
 I $D(^BWGRI(BWGRCRIT,21)) S X=Y X ^(21) I '$D(X),$D(^BWGRI(BWGRCRIT,22)) W !! X ^(22) G F ;if input tx exists and fails G N
 I '$D(^BWGRI(BWGRCRIT,21)),Y'?1.ANP1":"1.ANP W !!,$C(7),$C(7),"Enter a free text range in the format AAA:AAA.  E.g. 94-01:94-200,CA:CZ, A:Z." G F
 S ^BWGRTRPT(BWGRRPT,11,BWGRCRIT,0)=BWGRCRIT,^BWGRTRPT(BWGRRPT,11,"B",BWGRCRIT,BWGRCRIT)=""
 S BWGRCNT=0,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,BWGRCNT,0)="^9002086.8910101A^1^1" S BWGRCNT=BWGRCNT+1,^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,1,0)=$P(X,":")_U_$P(X,":",2),^BWGRTRPT(BWGRRPT,11,BWGRCRIT,11,"B",$P(X,":"),BWGRCNT)=""
 Q