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

BWGRVLP1.m

Go to the documentation of this file.
BWGRVLP1 ; IHS/CMI/LAB - CONT OF BWGRVLP ;15-Feb-2003 21:53;PLS
 ;;2.0;WOMEN'S HEALTH;**6,8**;MAY 16, 1996
 ;
 ;
COVPAGE ;EP
 W:$D(IOF) @IOF
 W !?20,"WOMENS' HEALTH MANAGEMENT REPORTS ",$S(BWGRPTVS="P":"WH PATIENT",1:"WH PROCEDURE")," ",$S(BWGRCTYP="D":"LISTING",1:"COUNT")
 W !?34,"SUMMARY PAGE"
 W !!,"REPORT REQUESTED BY: ",$P(^VA(200,DUZ,0),U),!
SHOW ;
 W !,$S(BWGRPTVS="P":"WH PATIENT",1:"WH PROCEDURE")," Selection Criteria"
 W:BWGRTYPE["V" !?6,"Encounter Date range:  ",BWGRBDD," to ",BWGREDD
 I BWGRTYPE="VP"!(BWGRTYPE="VV")!(BWGRTYPE="PS") W !!?6,"Search Template used: ",$P(^DIBT(BWGRSEAT,0),U),!
 I '$D(^BWGRTRPT(BWGRRPT,11)) G SHOWP
 S BWGRI=0 F  S BWGRI=$O(^BWGRTRPT(BWGRRPT,11,BWGRI)) Q:BWGRI'=+BWGRI  D
 .I $Y>(IOSL-5) D PAUSE^BWGRVL W @IOF
 .W !?6,$P(^BWGRI(BWGRI,0),U),":  "
 .K BWGRQ S BWGRY="",C=0 K BWGRQ F  S BWGRY=$O(^BWGRTRPT(BWGRRPT,11,BWGRI,11,"B",BWGRY)) S C=C+1 W:C'=1&(BWGRY'="") " ; " Q:BWGRY=""!($D(BWGRQ))  S X=BWGRY X:$D(^BWGRI(BWGRI,2)) ^(2) W X
 K BWGRQ
SHOWP ;
 W !!,"REPORT/OUTPUT TYPE",!
 I BWGRCTYP="F" D  D PAUSE^BWGRVL W @IOF Q
 .W ?6,"A File of records called ",BWGRFILE," will be created."
 .W !?6,"Total number of procedures counted is ",BWGRRCNT,"."
 I BWGRCTYP="T" D COUNT Q
 I BWGRCTYP="S" D  I 1
 .I $Y>(IOSL-6) D PAUSE^BWGRVL W @IOF
 .W ?6,"Report will contain sub-totals by ",$P(^BWGRI(BWGRSORT,0),U)," and ",!?6,"total counts."
 .I '$D(^XTMP("BWGRVL",BWGRJOB,BWGRBTH)) W !!,"NO DATA TO REPORT.",! D PAUSE^BWGRVL W:$D(IOF) @IOF
 .Q
 I BWGRCTYP'="D" D PAUSE^BWGRVL W:$D(IOF) @IOF Q
 I $Y>(IOSL-4) D PAUSE^BWGRVL W @IOF
 W ?6,"Detailed Listing containing"
 I '$D(^BWGRTRPT(BWGRRPT,12)) G PAUSE
 S BWGRI=0 F  S BWGRI=$O(^BWGRTRPT(BWGRRPT,12,BWGRI)) Q:BWGRI'=+BWGRI  S BWGRCRIT=$P(^BWGRTRPT(BWGRRPT,12,BWGRI,0),U) D
 .I $Y>(IOSL-4) D PAUSE^BWGRVL W:$D(IOF) @IOF
 .W !?6,$P(^BWGRI(BWGRCRIT,0),U),"  (" S X=$O(^BWGRTRPT(BWGRRPT,12,"B",BWGRCRIT,"")) W $P(^BWGRTRPT(BWGRRPT,12,X,0),U,2),")"
 I $Y>(IOSL-4) D PAUSE^BWGRVL W:$D(IOF) @IOF
 W !?10,"     TOTAL column width: ",BWGRTCW
 Q:'$G(BWGRSORT)
 I $Y>(IOSL-4) D PAUSE^BWGRVL W:$D(IOF) @IOF
 W !!,$S(BWGRPTVS="R":"Procedures",1:"Patients")," will be SORTED by:  ",$P(^BWGRI(BWGRSORT,0),U),!
 I $Y>(IOSL-4) D PAUSE^BWGRVL W:$D(IOF) @IOF
 I $G(BWGRSPAG) W !?6,"Each ",$P(^BWGRI(BWGRSORT,0),U)," will be on a separate page.",!
 I '$D(^XTMP("BWGRVL",BWGRJOB,BWGRBTH)) W !!,"NO DATA TO REPORT.",!
PAUSE D PAUSE^BWGRVL W:$D(IOF) @IOF
 Q
COUNT ;if COUNTING entries only
 I $Y>(IOSL-5) D PAUSE^BWGRVL W:$D(IOF) @IOF
 W ?6,"Totals Displayed"
 I '$D(^XTMP("BWGRVL",BWGRJOB,BWGRBTH)) W !!!,"NO DATA TO REPORT.",!
 W:$D(BWGRRCNT) !!!?6,"Total COUNT of ",$S(BWGRPTVS="P":"Patients",1:"Procedures"),":  ",?34,BWGRRCNT
 W:BWGRPTVS="R" !?6,"Total COUNT of Patients:  ",?34,BWGRPTCT
 Q
WP ;EP - Entry point to print wp fields pass node in BWGRNODE
 ;PASS FILE IN BWGRFILE, ENTRY IN BWGRDA
 K ^UTILITY($J,"W")
 S BWGRRLX=0
 S BWGRG1=^DIC(BWGRFILE,0,"GL"),BWGRG=BWGRG1_BWGRDA_","_BWGRNODE_",BWGRRLX)",BWGRGR=BWGRG1_BWGRDA_","_BWGRNODE_",BWGRRLX"
 S DIWL=1,DIWR=$P(^BWGRTRPT(BWGRRPT,12,BWGRI,0),U,2) F  S BWGRRLX=$O(@BWGRG) Q:BWGRRLX'=+BWGRRLX  D
 .S Y=BWGRGR_",0)" S X=@Y D ^DIWP
 .Q
 S Z=0 F  S Z=$O(^UTILITY($J,"W",DIWL,Z)) Q:Z'=+Z  S BWGRPCNT=BWGRPCNT+1,BWGRPRNM(BWGRPCNT)=^UTILITY($J,"W",DIWL,Z,0)
 K DIWL,DIWR,DIWF,Z
 K ^UTILITY($J,"W"),BWGRNODE,BWGRFILE,BWGRDA,BWGRG1,BWGRGR,BWGRRLX
 Q