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

AMQQRMA1.m

Go to the documentation of this file.
AMQQRMA1 ; IHS/CMI/THL - MAKES AGE BIN REPORTS ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
 I '$D(AMQQBZZZ) S (AMQQBZZZ,AMQQBXXX)=0
 S AMQQBZZZ=AMQQBZZZ+1
VAR S AMQQBDFN=AMQP(0)
 S AMQQBVAL=AMQP(+AMQQRMA)
 I '$D(^DPT(AMQQBDFN)) D FAIL Q
 I AMQQRMA="" S AMQQBVAL=""
 S AMQQBDOB=$P(^DPT(AMQQBDFN,0),U,3)
 I AMQQBDOB="" D FAIL Q
 I IOST["C-",AMQQBZZZ>1 W $C(13),AMQQBZZZ I AMQQBXXX W "  (",AMQQBXXX,")"
 I AMQQBVAL="" S AMQQBVAL="UNSPECIFIED"
 I $D(AMQQBBIN) D ATT Q
 S AMQQBNN=AMQQRMB
 S AMQQBA=""
 I IOST["C-" W !!!!,"CRUNCH, CRUNCH....",!!
 K ^UTILITY("BIN",$J)
 F I=1:1 S AMQQBX=$P(AMQQBNN,";",I) Q:AMQQBX=""  D SETA
 S AMQQBBIN=AMQQBA
 S G="^UTILITY(""AMQQ"",$J,""BIN"")"
 F I=1:1:$L(AMQQBA,";") S @G@("B",I)=0
 D ATT
 Q
 ;
FAIL S AMQQBXXX=AMQQBXXX+1
 I AMQQBZZZ>1 W $C(13),AMQQBZZZ,"  (",AMQQBXXX,")"
 Q
 ;
SETA S AMQQBY=$P(AMQQBX,":")
 S AMQQBZ=$P(AMQQBX,":",2)
 I AMQQBA'="" S AMQQBA=AMQQBA_";"
 S AMQQBA=AMQQBA_(AMQQDTE+1-(10000*(AMQQBZ+1)))_":"_(AMQQDTE-(AMQQBY*10000))
 Q
 ;
ATT S AMQQBA=AMQQBBIN
 F I=1:1 S AMQQBNN=$P(AMQQBA,";",I) Q:AMQQBNN=""  S AMQQBX=$P(AMQQBNN,":"),AMQQBY=$P(AMQQBNN,":",2) I AMQQBDOB'<AMQQBX,AMQQBDOB'>AMQQBY D SETV Q
 Q
 ;
SETV S:$G(AMQQBVAL)="" AMQQBVAL="UNSPECIFIED"
 I '$D(@G@("V",AMQQBVAL)) S ^(AMQQBVAL)=0
 S @G@("V",AMQQBVAL)=@G@("V",AMQQBVAL)+1
 S @G@("B",I)=@G@("B",I)+1
 I '$D(@G@(1,AMQQBVAL,I)) S ^(I)=0
 S @G@(1,AMQQBVAL,I)=@G@(1,AMQQBVAL,I)+1
 Q
 ;
PRINT ; ENTRY POINT
 I IOST["P" D
 .N AMQQRV,AMQQXV,AMQQNV
 .S AMQQXV=""
 .S (AMQQNV,AMQQRV)="AMQQXV"
 .D COVER^AMQQCMPP
 D HEADER
BLVAR S G="^UTILITY(""AMQQ"",$J,""BIN"")"
 S N=""
 I AMQQRMA="" G TOT
 F AMQQBLIN=1:1 S I=0,N=$O(@G@(1,N)) Q:N=""  D:'(AMQQBLIN#(IOSL-4)) PAUSE Q:AMQQBLIN=999999  D TRANS,B1
TOT W !!,"TOTAL"
 S (I,AMQQBZ)=0
 F J=16:7 S I=$O(@G@("B",I)) Q:'I  W ?J,^(I) S AMQQBZ=AMQQBZ+^(I)
 W ?J,AMQQBZ
 I $D(AMQQBXXX),AMQQBXXX W !!,AMQQBXXX," ENTR",$S(AMQQBXXX>1:"IES",1:"Y")," NOT INCLUDED BECAUSE OF BAD POINTERS OR LACK OF DOB"
 I IOST'?1"C-".E W @IOF D ^%ZISC G EXIT
 D ^%ZISC
 R !!,"<>",AMQQBX:DTIME
EXIT K ^UTILITY("AMQQ",$J,"BIN"),X,Y,Z,AMQQBNN,AMQQBVAL,AMQQBAV,AMQQBDFN,AMQQBDOB,AMQQBSNA,AMQQBSNO,A,G,AMQQBZZZ,AMQQBXXX,AMQQBLIN,AMQQBBIN,N,AMQQBA,AMQQBX,AMQQBY,AMQQBZ,AMQQRMA,AMQQRMB,AMQQRMFL,%,A,I,J,AMQQDTE
 Q
 ;
B1 F J=16:7 S I=I+1 Q:I>$L(AMQQRMB,";")  W ?J,$S($D(@G@(1,N,I)):^(I),1:".") I I+1>$L(AMQQRMB,";") W ?(J+7),@G@("V",N) Q
 Q
 ;
PAUSE I IOST["C-" R !,"<>",AMQQBQ:DTIME S:'$T!(AMQQBQ=U) AMQQBLIN=999999 K AMQQBQ
 D HEADER
 Q
 ;
 W !,?35,"AGE GROUPS",!
 S AMQQBSNA=$P(AMQQRMA,";",3)
 I AMQQBSNA="" S AMQQBSNA="ATTRIBUTE"
 S AMQQBNN=$E(AMQQBSNA,1,12)
 I $L(AMQQBNN)<12 S AMQQBNN=AMQQBNN_$J("",12-$L(AMQQBNN))
 W AMQQBNN
 S AMQQBNN=AMQQRMB
 S AMQQBI=0
 S AMQQBJ=""
 F AMQQBJ=14:7 S AMQQBI=AMQQBI+1,AMQQBX=$P(AMQQBNN,";",AMQQBI) Q:AMQQBX=""  D
 .W ?(AMQQBJ+($P(AMQQBX,":",2)=199)),$S($P(AMQQBX,":")=$P(AMQQBX,":",2):"  ",1:($P(AMQQBX,":")_$S($P(AMQQBX,":",2)=199:"+",1:"-"))) I $P(AMQQBX,":",2)'=199 W $P(AMQQBX,":",2)
 W ?(AMQQBJ+2),"TOT"
 S AMQQBX=""
 S $P(AMQQBX,"-",80)=""
 W !,AMQQBX
 K AMQQBI,AMQQBJ,AMQQBX
 Q
 ;
TRANS N X,%
 S X=N
 S %=$P(AMQQRMA,";",2)
 I %="" W !,$E(X,1,12) Q
 X %
 W !,$E(X,1,12)
 Q
 ;