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

ACMRLP1.m

Go to the documentation of this file.
ACMRLP1 ; IHS/TUCSON/TMJ - CONT OF ACMRLP ; [ 06/01/1999  1:41 PM ]
 ;;2.0;ACM CASE MANAGEMENT SYSTEM;**1**;JAN 10, 1996
 ;IHS/CMI/LAB - tmp to xtmp
 ;
 ;
COVPAGE ;EP
 W:$D(IOF) @IOF
 W !?20,"CASE MANAGEMENT PATIENT REGISTER ",$S(ACMCTYP="D":"LISTING",1:"COUNT")
 W !!,"REPORT REQUESTED BY: ",$P(^VA(200,DUZ,0),U)
 W !!,"REGISTER:  ",$P(^ACM(41.1,ACMRG,0),U)
 W !!,"The following  report contains a CONFIDENTIAL Patient report based on the",!,"following criteria:",!
SHOW ;
 W !,"PATIENT Selection Criteria"
 I '$D(^ACM(58.8,ACMRPT,11)) G SHOWP
 S ACMI=0 F  S ACMI=$O(^ACM(58.8,ACMRPT,11,ACMI)) Q:ACMI'=+ACMI  D
 .I $Y>(IOSL-5) D PAUSE^ACMRL01 W @IOF
 .W !?6,$P(^ACM(58.1,ACMI,0),U),":  "
 .K ACMQ S ACMY=0,C=0 K ACMQ F  S ACMY=$O(^ACM(58.8,ACMRPT,11,ACMI,11,"B",ACMY)) S C=C+1 W:C'=1&(ACMY'="") " ; " Q:ACMY=""!($D(ACMQ))  S X=ACMY X:$D(^ACM(58.1,ACMI,2)) ^(2) W X
 K ACMQ
SHOWP ;
 I ACMCTYP="T" D COUNT Q
 I ACMCTYP="S" D  I 1
 .I $Y>(IOSL-6) D PAUSE^ACMRL01 W @IOF
 .W !!,"Report will contain sub-totals by ",$P(^ACM(58.1,ACMSORT,0),U),"."
 .I '$D(^XTMP("ACMRL",ACMJOB,ACMBTH)) W !!,"NO DATA TO REPORT.",! D PAUSE^ACMRL01 W:$D(IOF) @IOF
 .Q
 I ACMCTYP'="D" D PAUSE^ACMRL01 W:$D(IOF) @IOF Q
 I $Y>(IOSL-4) D PAUSE^ACMRL01 W @IOF
 W !!,"PRINT Field Selection"
 I '$D(^ACM(58.8,ACMRPT,12)) G PAUSE
 S ACMI=0 F  S ACMI=$O(^ACM(58.8,ACMRPT,12,ACMI)) Q:ACMI'=+ACMI  S ACMCRIT=$P(^ACM(58.8,ACMRPT,12,ACMI,0),U) D
 .I $Y>(IOSL-4) D PAUSE^ACMRL01 W:$D(IOF) @IOF
 .W !?6,$P(^ACM(58.1,ACMCRIT,0),U),"  (" S X=$O(^ACM(58.8,ACMRPT,12,"B",ACMCRIT,"")) W $P(^ACM(58.8,ACMRPT,12,X,0),U,2),")"
 I $Y>(IOSL-4) D PAUSE^ACMRL01 W:$D(IOF) @IOF
 W !?10,"     TOTAL column width: ",ACMTCW
 Q:'$G(ACMSORT)
 I $Y>(IOSL-4) D PAUSE^ACMRL01 W:$D(IOF) @IOF
 W !!,"Patients will be SORTED by:  ",$P(^ACM(58.1,ACMSORT,0),U),!
 I $Y>(IOSL-4) D PAUSE^ACMRL01 W:$D(IOF) @IOF
 I $G(ACMSPAG) W !?6,"Each ",$P(^ACM(58.1,ACMSORT,0),U)," will be on a separate page.",!
 I '$D(^XTMP("ACMRL",ACMJOB,ACMBTH)) W !!,"NO DATA TO REPORT.",!
PAUSE D PAUSE^ACMRL01 W:$D(IOF) @IOF
 Q
COUNT ;if COUNTING entries only   
 I $Y>(IOSL-5) D PAUSE^ACMRL01 W:$D(IOF) @IOF
 I '$D(^XTMP("ACMRL",ACMJOB,ACMBTH)) W !!!,"NO DATA TO REPORT.",!
 W:$D(ACMRCNT) !!!,"Total COUNT of PATIENTS:  ",ACMRCNT
 Q
WP ;EP - Entry point to print wp fields pass node in ACMNODE
 ;PASS FILE IN ACMFILE, ENTRY IN ACMDA
 K ^UTILITY($J,"W")
 S ACMRLX=0
 S ACMG1=^DIC(ACMFILE,0,"GL"),ACMG=ACMG1_ACMDA_","_ACMNODE_",ACMRLX)",ACMGR=ACMG1_ACMDA_","_ACMNODE_",ACMRLX"
 S DIWL=1,DIWR=$P(^ACM(58.8,ACMRPT,12,ACMI,0),U,2) F  S ACMRLX=$O(@ACMG) Q:ACMRLX'=+ACMRLX  D
 .S Y=ACMGR_",0)" S X=@Y D ^DIWP
 .Q
 S Z=0 F  S Z=$O(^UTILITY($J,"W",DIWL,Z)) Q:Z'=+Z  S ACMPCNT=ACMPCNT+1,ACMPRNM(ACMPCNT)=^UTILITY($J,"W",DIWL,Z,0)
 S ACMPCNT=ACMPCNT+1
 K DIWL,DIWR,DIWF,Z
 K ^UTILITY($J,"W"),ACMNODE,ACMFILE,ACMDA,ACMG1,ACMGR,ACMRLX
 Q