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.
  1. APCLVL0 ; IHS/CMI/LAB - SCREEN LOGIC ;
  1. ;;2.0;IHS PCC SUITE;**2,17**;MAY 14, 2009;Build 18
  1. ;
  1. ;
  1. Q ;EP
  1. K AMQQTAXN
  1. K ^XTMP("APCLVL",$J,"QMAN"),^UTILITY("AMQQ TAX",$J),^UTILITY("AMQQ DRUG CLASS",$J)
  1. 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
  1. S APCLQMAN=+Y
  1. I $P(^APCLVSTS(APCLCRIT,0),U)["Cause of Injury" S AMQQSQNM="CAUSE OF INJURY (PRIMARY)" ;FIX FOR CAUSE OF INJURY
  1. ;I $P(^APCLVSTS(APCLCRIT,0),U)="Cause of Injury" S AMQQSQNM="CAUSE OF INJURY"
  1. D PEP^AMQQGTX0(APCLQMAN,"^XTMP(""APCLVL"",$J,""QMAN"",")
  1. I '$D(^XTMP("APCLVL",$J,"QMAN")) W !!,$C(7),"** No ",$P(^APCLVSTS(APCLCRIT,0),U)," selected, all will be included." Q
  1. 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
  1. K APCLBQC1 I $G(APCLBQC),$P($G(^APCLVSTS(APCLCRIT,90182)),U,5)=1,$G(AMQQTAXN)]"" S APCLBQC1="" D TAXV Q:APCLBQC1=""
  1. S ^APCLVRPT(APCLRPT,11,APCLCRIT,0)=APCLCRIT,^APCLVRPT(APCLRPT,11,"B",APCLCRIT,APCLCRIT)=""
  1. 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
  1. 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
  1. Q1 K X,Y,Z,APCLQMAN,V,AMQQSQNM,AMQQTAXN
  1. K ^XTMP("APCLVL",$J,"QMAN")
  1. Q
  1. R ;EP
  1. 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
  1. Q:$D(DIRUT)
  1. Q:Y=-1
  1. I Y="" Q
  1. S ^APCLVRPT(APCLRPT,11,APCLCRIT,0)=APCLCRIT,^APCLVRPT(APCLRPT,11,"B",APCLCRIT,APCLCRIT)=""
  1. 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
  1. G R
  1. Q
  1. D ;DATE RANGE
  1. BD ;get beginning date
  1. W ! S DIR(0)="D^::EP",DIR("A")="Enter beginning "_APCLTEXT_" for Search" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) Q
  1. S APCLBDAT=Y
  1. ED ;get ending date
  1. 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
  1. I $D(DIRUT) G BD
  1. S APCLEDAT=Y
  1. S X1=APCLBDAT,X2=-1 D C^%DTC S APCLSDAT=X
  1. ;
  1. S ^APCLVRPT(APCLRPT,11,APCLCRIT,0)=APCLCRIT,^APCLVRPT(APCLRPT,11,"B",APCLCRIT,APCLCRIT)=""
  1. 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)=""
  1. Q
  1. N ;
  1. D N^APCLVL01
  1. Q
  1. F ;FREE TEXT RANGE
  1. K ^APCLVRPT(APCLRPT,11,APCLCRIT),^APCLVRPT(APCLRPT,11,"B",APCLCRIT)
  1. 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
  1. I Y="" W !!,"No range entered. All ",APCLTEXT," will be included." Q
  1. 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
  1. 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
  1. S ^APCLVRPT(APCLRPT,11,APCLCRIT,0)=APCLCRIT,^APCLVRPT(APCLRPT,11,"B",APCLCRIT,APCLCRIT)=""
  1. 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)=""
  1. Q
  1. J ;
  1. D J^APCLVL01
  1. Q
  1. C ;EP
  1. D C^APCLVL01
  1. Q
  1. Y ;
  1. D Y^APCLVL01
  1. Q
  1. TAXV ;for query cloning
  1. W !!,"You entered a taxonomy name for this item. ["_$P(AMQQTAXN,U)_"]"
  1. W !,"You have the option of sending the name of the taxonomy to each site and have"
  1. W !,"the taxonomy resolved at the site OR to send the individual coded values"
  1. W !,"for this taxonomy.",!
  1. 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
  1. I $D(DIRUT) W !,"exiting......start over.." Q
  1. S APCLBQC1=Y
  1. Q
  1. S ;
  1. D S^APCLVL01
  1. Q