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

BDMTV.m

Go to the documentation of this file.
BDMTV ; IHS/CMI/LAB - DISPLAY IND LISTS ;
 ;;2.0;DIABETES MANAGEMENT SYSTEM;**11,12**;JUN 14, 2007;Build 51
 ;; ;
EP ;EP - CALLED FROM OPTION
 ;GET AUDIT YEAR
 ;select year
 S BDMYR=""
 W:$D(IOF) @IOF
 W !!,"Select the Audit Year",!!
 S DIC="^BDMTAXS(",DIC(0)="AEMQ" D ^DIC K DIC I Y=-1 W !!,"Goodbye" G EOJ
 S BDMYR=+Y,BDMYRE=$P(^BDMTAXS(+Y,0),U,1)
 D EN
 Q
EOJ ;EP
 I '$D(BDMGUI) D EN^XBVK("BDM")
 Q
 ;; ;
EN ;EP -- main entry point for 
 D EN^VALM("BDM TAXONOMY VIEW")
 D CLEAR^VALM1
 D FULL^VALM1
 W:$D(IOF) @IOF
 D EOJ
 Q
 ;
PAUSE ;EP
 Q:$E(IOST)'="C"!(IO'=IO(0))
 W ! S DIR(0)="EO",DIR("A")="Press enter to continue...." D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 Q
HDR ; -- header code
 S VALMHDR(1)="TAXONOMIES TO SUPPORT "_BDMYRE_" DIABETES/PRE-DIABETES AUDIT REPORTING"
 S VALMHDR(2)="* View Taxonomies"
 Q
 ;
INIT ;EP -- init variables and list array
 K BDMTAX S BDMHIGH="",C=0
 S BDMYR=$O(^BDMTAXS("B",BDMYRE,0))
 S BDMX=0,J=0 F  S BDMX=$O(^BDMTAXS(BDMYR,11,"B",BDMX)) Q:BDMX=""  D
 .S BDMY=$O(^BDMTAXS(BDMYR,11,"B",BDMX,0))
 .;Q:'$P(^BDMTAXS(BDMYR,11,BDMY,0),U,5)
 .S Y=$P(^DIC($P(^BDMTAXS(BDMYR,11,BDMY,0),U,2),0),U)
 .S J=J+1
 .S BDMTAX(J,0)=J_")  "_BDMX,$E(BDMTAX(J,0),38)=$E(Y,1,30)
 .I $P(^BDMTAXS(BDMYR,11,BDMY,0),U,2)'=60 S I=$O(^ATXAX("B",BDMX,0))
 .I $P(^BDMTAXS(BDMYR,11,BDMY,0),U,2)=60 S I=$O(^ATXLAB("B",BDMX,0))
 .S BDMTAX("IDX",J,J)=I_U_$S($P(^BDMTAXS(BDMYR,11,BDMY,0),U,2)=60:"L",1:"T")
 .S C=C+1
 .Q
 S (VALMCNT,BDMHIGH)=C
 Q
 ;
HELP ; -- help code
 S X="?" D DISP^XQORM1 W !!
 Q
 ;
EXIT ; -- exit code
 Q
 ;
EXPND ; -- expand code
 Q
 ;
BACK ;go back to listman
 D TERM^VALM0
 S VALMBCK="R"
 D INIT
 D HDR
 K DIR
 K X,Y,Z,I
 Q
 ;
DISP ;EP - add an item to the selected list - called from a protocol
 W !
 S DIR(0)="NO^1:"_BDMHIGH,DIR("A")="Which Taxonomy"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No taxonomy selected." G DISPX
 I $D(DIRUT) W !,"No taxonomy selected." G DISPX
 S BDMTAXI=$P(BDMTAX("IDX",Y,Y),U,1),BDMTAXT=$P(BDMTAX("IDX",Y,Y),U,2)
 ;BROWSE OR PRINT
 D FULL^VALM1
 W ! S DIR(0)="S^P:PRINT Taxonomy Output;B:BROWSE Taxonomy Output on Screen",DIR("A")="Do you wish to",DIR("B")="B" K DA D ^DIR K DIR
 I $D(DIRUT) D XIT Q
 S BDMOPT=Y
 I Y="B" D BROWSE,XIT Q
 S XBRP="PRINT^BDMTV",XBRC="",XBRX="XIT^BDMTV",XBNS="BDM"
 D ^XBDBQUE
 D DISPX
 Q
BROWSE ;
 S XBRP="VIEWR^XBLM(""PRINT^BDMTV"")"
 S XBRC="",XBRX="XIT^BDMTV",XBIOP=0 D ^XBDBQUE
 Q
PHDR ;
 I 'BDMPG G HEAD1
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BDMQ="" Q
HEAD1 ;
 I BDMPG W:$D(IOF) @IOF
 S BDMPG=BDMPG+1
 I $G(BDMGUI),BDMPG'=1 W !,"ZZZZZZZ"
 W !,$P(^VA(200,DUZ,0),U,2),?72,"Page ",BDMPG,!
 W ?(80-$L($P(^DIC(4,$S($G(BDMDUZ2):BDMDUZ2,1:DUZ(2)),0),U))/2),$P(^DIC(4,$S($G(BDMDUZ2):BDMDUZ2,1:DUZ(2)),0),U),!
 W $$CTR("Listing of the "_BDMTAXN_" taxonomy",80),!,BDM80D,!
 Q
PRINT ;
 S BDMPG=0
 K BDMQ
 I BDMTAXT="L" S BDMTAXN=$P(^ATXLAB(BDMTAXI,0),U,1)
 I BDMTAXT="T" S BDMTAXN=$P(^ATXAX(BDMTAXI,0),U,1)
 S BDM80D="-------------------------------------------------------------------------------"
 D PHDR
 I BDMTAXT'="L" S BDMFILE=$P(^ATXAX(BDMTAXI,0),U,15)
 I BDMTAXT="L" S BDMFILE=60
P1 K ^TMP($J,"BDMTAXDSP")
 I BDMTAXT="L" D  G P11
 .S X="" F  S X=$O(^ATXLAB(BDMTAXI,21,"B",X)) Q:X=""  D
 ..S ^TMP($J,"BDMTAXDSP",X)=""
 S F=$NA(^TMP($J,"BDMTAXDSP"))
 I BDMFILE'=50.67,BDMFILE'=9999999.64,BDMFILE'=95.3,BDMFILE'=60,BDMFILE'=9999999.14 D BLDTAX^ATXAPI(BDMTAXN,F,$O(^ATXAX("B",BDMTAXN,0))) I 1
 E  S BDMX="" F  S BDMX=$O(^ATXAX(BDMTAXI,21,"B",BDMX)) Q:BDMX=""  S ^TMP($J,"BDMTAXDSP",BDMX)=""
 S BDMFILE=$P(^ATXAX(BDMTAXI,0),U,15)
P11 S BDMX="" F  S BDMX=$O(^TMP($J,"BDMTAXDSP",BDMX)) Q:BDMX=""  D
 .S (BDM1,BDM2,BDMF,BDM3,BDMC2,BDMC3)=""
 .S BDMC2=35,BDMC3=65
 .I BDMFILE=80 S D=$$ICDDX^ICDEX(BDMX,DT,,"I") S BDM1=$P(D,U,2),BDM2=$E($P(D,U,4),1,50),BDM3=$P(D,U,20),BDM3=$P(^ICDS(BDM3,0),U,1),BDMC2=15,BDMC3=65
 .I BDMFILE=80.1 S D=$$ICDOP^ICDEX(BDMX,DT,,"I") S BDM1=$P(D,U,2),BDM2=$E($P(D,U,5),1,50),BDM3=$P(D,U,15),BDM3=$P(^ICDS(BDM3,0),U,1),BDMC2=15,BDMC3=65
 .I BDMFILE=81 S D=$$CPT^ICPTCOD(BDMX) S BDM1=$P(D,U,2),BDM2=$P(D,U,3),BDMC2=15
 .I BDMFILE=50.67 S BDM1=BDMX,BDM2=$O(^PSNDF(50.67,"NDC",$$STRIP^XLFSTR(BDM1,"-"),0)) I BDM2 S BDM2=$$GET1^DIQ(50.67,BDM2,4)
 .I BDMFILE=9999999.64 S BDM1=$$GET1^DIQ(BDMFILE,BDMX,.01)
 .I BDMFILE=9999999.09 S BDM1=$$GET1^DIQ(BDMFILE,BDMX,.01),BDM2=$$GET1^DIQ(BDMFILE,BDMX,1),BDMC2=50
 .I BDMFILE=9999999.14 S BDM1=BDMX S %=$O(^AUTTIMM("C",BDMX,0)) I % S BDM2=$$GET1^DIQ(BDMFILE,%,.01),BDMC2=15
 .I BDMFILE=95.3 S BDM1=BDMX S %=$O(^LAB(95.3,"B",$P(BDMX,"-"),0)) I % S BDM2=$$GET1^DIQ(95.3,%,80),BDMC2=15
 .I BDM1="" D
 ..S BDMF=".01"
 ..S BDM1=$$GET1^DIQ(BDMFILE,BDMX,.01)
 .I $Y>(IOSL-3) D PHDR Q:$D(BDMQ)
 .W BDM1,?BDMC2,$E(BDM2,1,40),?BDMC3,BDM3,!
 D XIT
 Q
DISPX ;
 D BACK
 Q
XIT ;
 K ^TMP($J,"BDMTAXDSP")
 Q
CTR(X,Y) ;EP - Center X in a field Y wide.
 Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
 ;----------