81 lines
2.5 KiB
Mathematica
81 lines
2.5 KiB
Mathematica
PSUV3 ;BIR/CFL - Create mailman messages ;10 JUL 1999
|
|
;;4.0;PHARMACY BENEFITS MANAGEMENT;**4**;MARCH, 2005
|
|
;DBIAs
|
|
; Reference to file #4.3 supported by DBIA 2496
|
|
; Reference to file #40.8 supported by DBIA 2438
|
|
;
|
|
EN(PSUMSGT) ;
|
|
;
|
|
S PSUNOREC="",NONE="",PSUAIS=""
|
|
S PSUMSGT("M")=0,PSUMSGT("L")=0
|
|
I '$D(^XTMP(PSUIVSUB,"RECORDS")) D NODATA Q ;Do not go any further if there is no data to report
|
|
I '$D(^XTMP("PSU_"_PSUJOB,"PSUFLAG")) D AMIS
|
|
S PSUDIV=0,Z=0
|
|
F S PSUDIV=$O(^XTMP(PSUIVSUB,"RECORDS",PSUDIV)) Q:PSUDIV="" D
|
|
.I PSUSMRY=1 D GETDIV Q ;Print only the summary report
|
|
.I $G(PSUMASF)!$G(PSUDUZ)!$G(PSUPBMG) D XMD,SETCNT
|
|
.D GETDIV
|
|
.D DRUGSUM^PSUV4
|
|
Q
|
|
;
|
|
AMIS ;AMIS SUMMARY
|
|
D EN^PSUV6 ;LVP AMIS Summary Data
|
|
D EN^PSUV7 ;PB AMIS Summary Data
|
|
D EN^PSUV8 ;TPN AMIS Summary Data
|
|
D EN^PSUV9 ;CHEMO AMIS Summary Data
|
|
D EN^PSUV10 ;SYRINGE AMIS Summary Data
|
|
Q
|
|
XMD ;
|
|
;
|
|
NEW PSUMAX,PSULC,PSUTMC,PSUTLC,PSUMC
|
|
S PSUMAX=$$VAL^PSUTL(4.3,1,8.3)
|
|
S PSUMAX=$S(PSUMAX="":10000,PSUMAX>10000:10000,1:PSUMAX)
|
|
K ^XTMP(PSUIVSUB,"XMD")
|
|
S PSUMC=1,PSUMLC=0
|
|
F PSULC=1:1 S X=$G(^XTMP(PSUIVSUB,"RECORDS",PSUDIV,PSULC)) Q:X="" D
|
|
.S PSUMLC=PSUMLC+1
|
|
.I PSUMLC>PSUMAX S PSUMC=PSUMC+1,PSUMLC=0,PSULC=PSULC-1 Q ; + message
|
|
.I $L(X)<235 S ^XTMP(PSUIVSUB,"XMD",PSUMC,PSUMLC)=X Q
|
|
.F I=235:-1:1 S Z=$E(X,I) Q:Z="^"
|
|
.S ^XTMP(PSUIVSUB,"XMD",PSUMC,PSUMLC)=$E(X,1,I)
|
|
.S PSUMLC=PSUMLC+1
|
|
.S ^XTMP(PSUIVSUB,"XMD",PSUMC,PSUMLC)="*"_$E(X,I+1,999)
|
|
;
|
|
; Count Lines sent
|
|
S PSUTLC=0
|
|
F PSUM=1:1:PSUMC S X=$O(^XTMP(PSUIVSUB,"XMD",PSUM,""),-1),PSUTLC=PSUTLC+X
|
|
;
|
|
; Transmit Messages
|
|
VARS ; Setup variables for contents
|
|
F PSUM=1:1:PSUMC D
|
|
.D GETDIV
|
|
.S XMSUB="V. 4.0 PBMIV "_PSUMON_" "_PSUM_"/"_PSUMC_" "_PSUDIV_" "_PSUDIVNM
|
|
.S XMTEXT="^XTMP(PSUIVSUB,""XMD"",PSUM,"
|
|
.S XMCHAN=1
|
|
.S XMDUZ=DUZ
|
|
.M XMY=PSUXMYH
|
|
.D ^XMD
|
|
;
|
|
I NONE S PSUTLC=0
|
|
S PSUMSG("M")=PSUMC
|
|
S PSUMSG("L")=PSUTLC
|
|
Q
|
|
NODATA ;Send "No data to report" message
|
|
S PSUDIV=PSUSNDR
|
|
S ^XTMP(PSUIVSUB,"RECORDS",PSUDIV,1)="No data to report" S PSUAIS=1
|
|
S NONE=1
|
|
S ^XTMP("PSU_"_PSUJOB,"PSUNONE","IV")=""
|
|
M PSUXMYH=PSUXMYS1
|
|
D XMD
|
|
SETCNT ;Set message count and line count
|
|
S PSUMSGT(PSUDIV,"M")=$G(PSUMSGT(PSUDIV,"M"))+PSUMSG("M")
|
|
S PSUMSGT(PSUDIV,"L")=$G(PSUMSGT(PSUDIV,"L"))+PSUMSG("L")
|
|
S ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUDIV,PSUOPTN,"M")=PSUMSGT(PSUDIV,"M")
|
|
S ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUDIV,PSUOPTN,"L")=PSUMSGT(PSUDIV,"L")
|
|
Q
|
|
GETDIV ;get division name
|
|
S X=PSUDIV,DIC=40.8,DIC(0)="X",D="C" D IX^DIC ;**1
|
|
S X=+Y S PSUDIVNM=$$VAL^PSUTL(40.8,X,.01)
|
|
S ^XTMP("PSU_"_PSUJOB,"DIV",PSUDIV)=PSUDIVNM
|
|
Q
|