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

APCLVL0.m

Go to the documentation of this file.
APCLVL0 ; IHS/CMI/LAB - SCREEN LOGIC ;
 ;;2.0;IHS PCC SUITE;**2,17**;MAY 14, 2009;Build 18
 ;
 ;
Q ;EP
 K AMQQTAXN
 K ^XTMP("APCLVL",$J,"QMAN"),^UTILITY("AMQQ TAX",$J),^UTILITY("AMQQ DRUG CLASS",$J)
 K DIC,X,Y,DD S X=$P(^APCLVSTS(APCLCRIT,0),U,3),DIC="^AMQQ(5,",DIC(0)="EQXM",D="B",DIC("S")="I $P(^(0),U,14)" D MIX^DIC1 K DIC,DA,DINUM,DICR I Y=-1 W "OOPS - QMAN NOT CURRENT - QUITTING" Q
 S APCLQMAN=+Y
 I $P(^APCLVSTS(APCLCRIT,0),U)["Cause of Injury" S AMQQSQNM="CAUSE OF INJURY (PRIMARY)"  ;FIX FOR CAUSE OF INJURY
 ;I $P(^APCLVSTS(APCLCRIT,0),U)="Cause of Injury" S AMQQSQNM="CAUSE OF INJURY"
 D PEP^AMQQGTX0(APCLQMAN,"^XTMP(""APCLVL"",$J,""QMAN"",")
 I '$D(^XTMP("APCLVL",$J,"QMAN")) W !!,$C(7),"** No ",$P(^APCLVSTS(APCLCRIT,0),U)," selected, all will be included." Q
 I $D(^XTMP("APCLVL",$J,"QMAN","*")) K ^XTMP("APCLVL",$J,"QMAN") W !!,"*** All items selected, if you want all then do not select this item." Q
 K APCLBQC1 I $G(APCLBQC),$P($G(^APCLVSTS(APCLCRIT,90182)),U,5)=1,$G(AMQQTAXN)]"" S APCLBQC1="" D TAXV Q:APCLBQC1=""
 S ^APCLVRPT(APCLRPT,11,APCLCRIT,0)=APCLCRIT,^APCLVRPT(APCLRPT,11,"B",APCLCRIT,APCLCRIT)=""
 I $G(APCLBQC1)="T" S ^APCLVRPT(APCLRPT,11,APCLCRIT,11,1,0)="["_AMQQTAXN,^APCLVRPT(APCLRPT,11,APCLCRIT,11,"B","["_$P(AMQQTAXN,U),1)="",^APCLVRPT(APCLRPT,11,APCLCRIT,11,0)="^9001003.8110101A^1^1" G Q1
 S X="",Y=0 F  S X=$O(^XTMP("APCLVL",$J,"QMAN",X)) Q:X=""  S Y=Y+1,^APCLVRPT(APCLRPT,11,APCLCRIT,11,Y,0)=X,^APCLVRPT(APCLRPT,11,APCLCRIT,11,"B",X,Y)="",^APCLVRPT(APCLRPT,11,APCLCRIT,11,0)="^9001003.8110101A^"_Y_"^"_Y
Q1 K X,Y,Z,APCLQMAN,V,AMQQSQNM,AMQQTAXN
 K ^XTMP("APCLVL",$J,"QMAN")
 Q
R ;EP
 S DIR(0)=$P(^APCLVSTS(APCLCRIT,0),U,4)_"O",DIR("A")="ENTER "_$P(^(0),U) D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 Q:$D(DIRUT)
 Q:Y=-1
 I Y="" Q
 S ^APCLVRPT(APCLRPT,11,APCLCRIT,0)=APCLCRIT,^APCLVRPT(APCLRPT,11,"B",APCLCRIT,APCLCRIT)=""
 S APCLCNT=APCLCNT+1,^APCLVRPT(APCLRPT,11,APCLCRIT,11,APCLCNT,0)=$P(Y,U),^APCLVRPT(APCLRPT,11,APCLCRIT,11,"B",$P(Y,U),APCLCNT)="",^APCLVRPT(APCLRPT,11,APCLCRIT,11,0)="^9001003.8110101A^"_APCLCNT_"^"_APCLCNT
 G R
 Q
D ;DATE RANGE
BD ;get beginning date
 W ! S DIR(0)="D^::EP",DIR("A")="Enter beginning "_APCLTEXT_" for Search" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) Q
 S APCLBDAT=Y
ED ;get ending date
 W ! S DIR(0)="D^"_APCLBDAT_"::EP",DIR("A")="Enter ending "_APCLTEXT_" for Search" S Y=APCLBDAT D DD^%DT S DIR("B")=Y,Y="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G BD
 S APCLEDAT=Y
 S X1=APCLBDAT,X2=-1 D C^%DTC S APCLSDAT=X
 ;
 S ^APCLVRPT(APCLRPT,11,APCLCRIT,0)=APCLCRIT,^APCLVRPT(APCLRPT,11,"B",APCLCRIT,APCLCRIT)=""
 S APCLCNT=0,^APCLVRPT(APCLRPT,11,APCLCRIT,11,APCLCNT,0)="^9001003.8110101A^1^1" S APCLCNT=APCLCNT+1,^APCLVRPT(APCLRPT,11,APCLCRIT,11,1,0)=APCLBDAT_U_APCLEDAT,^APCLVRPT(APCLRPT,11,APCLCRIT,11,"B",APCLBDAT,APCLCNT)=""
 Q
N ;
 D N^APCLVL01
 Q
F ;FREE TEXT RANGE
 K ^APCLVRPT(APCLRPT,11,APCLCRIT),^APCLVRPT(APCLRPT,11,"B",APCLCRIT)
 S DIR(0)="FO^1:40",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 ",APCLTEXT,"  will be included." Q
 I $D(^APCLVSTS(APCLCRIT,21)) S X=Y X ^(21) I '$D(X),$D(^APCLVSTS(APCLCRIT,22)) W !! X ^(22) G F ;if input tx exists and fails G N
 I '$D(^APCLVSTS(APCLCRIT,21)),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 ^APCLVRPT(APCLRPT,11,APCLCRIT,0)=APCLCRIT,^APCLVRPT(APCLRPT,11,"B",APCLCRIT,APCLCRIT)=""
 S APCLCNT=0,^APCLVRPT(APCLRPT,11,APCLCRIT,11,APCLCNT,0)="^9001003.8110101A^1^1" S APCLCNT=APCLCNT+1,^APCLVRPT(APCLRPT,11,APCLCRIT,11,1,0)=$P(X,":")_U_$P(X,":",2),^APCLVRPT(APCLRPT,11,APCLCRIT,11,"B",$P(X,":"),APCLCNT)=""
 Q
J ;
 D J^APCLVL01
 Q
C ;EP
 D C^APCLVL01
 Q
Y ;
 D Y^APCLVL01
 Q
TAXV ;for query cloning
 W !!,"You entered a taxonomy name for this item.  ["_$P(AMQQTAXN,U)_"]"
 W !,"You have the option of sending the name of the taxonomy to each site and have"
 W !,"the taxonomy resolved at the site OR to send the individual coded values"
 W !,"for this taxonomy.",!
 S DIR(0)="S^T:Taxonomy Name (this taxonomy must reside at each site);V:Values in this Taxonomy",DIR("A")="Which do you wish to send for this item",DIR("B")="T" KILL DA D ^DIR KILL DIR
 I $D(DIRUT) W !,"exiting......start over.." Q
 S APCLBQC1=Y
 Q
S ;
 D S^APCLVL01
 Q