source: WorldVistAEHR/trunk/r/PHARMACY_BENEFITS_MANAGEMENT-PSU/PSUV3.m@ 1361

Last change on this file since 1361 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.5 KB
RevLine 
[613]1PSUV3 ;BIR/CFL - Create mailman messages ;10 JUL 1999
2 ;;4.0;PHARMACY BENEFITS MANAGEMENT;**4**;MARCH, 2005
3 ;DBIAs
4 ; Reference to file #4.3 supported by DBIA 2496
5 ; Reference to file #40.8 supported by DBIA 2438
6 ;
7EN(PSUMSGT) ;
8 ;
9 S PSUNOREC="",NONE="",PSUAIS=""
10 S PSUMSGT("M")=0,PSUMSGT("L")=0
11 I '$D(^XTMP(PSUIVSUB,"RECORDS")) D NODATA Q ;Do not go any further if there is no data to report
12 I '$D(^XTMP("PSU_"_PSUJOB,"PSUFLAG")) D AMIS
13 S PSUDIV=0,Z=0
14 F S PSUDIV=$O(^XTMP(PSUIVSUB,"RECORDS",PSUDIV)) Q:PSUDIV="" D
15 .I PSUSMRY=1 D GETDIV Q ;Print only the summary report
16 .I $G(PSUMASF)!$G(PSUDUZ)!$G(PSUPBMG) D XMD,SETCNT
17 .D GETDIV
18 .D DRUGSUM^PSUV4
19 Q
20 ;
21AMIS ;AMIS SUMMARY
22 D EN^PSUV6 ;LVP AMIS Summary Data
23 D EN^PSUV7 ;PB AMIS Summary Data
24 D EN^PSUV8 ;TPN AMIS Summary Data
25 D EN^PSUV9 ;CHEMO AMIS Summary Data
26 D EN^PSUV10 ;SYRINGE AMIS Summary Data
27 Q
28XMD ;
29 ;
30 NEW PSUMAX,PSULC,PSUTMC,PSUTLC,PSUMC
31 S PSUMAX=$$VAL^PSUTL(4.3,1,8.3)
32 S PSUMAX=$S(PSUMAX="":10000,PSUMAX>10000:10000,1:PSUMAX)
33 K ^XTMP(PSUIVSUB,"XMD")
34 S PSUMC=1,PSUMLC=0
35 F PSULC=1:1 S X=$G(^XTMP(PSUIVSUB,"RECORDS",PSUDIV,PSULC)) Q:X="" D
36 .S PSUMLC=PSUMLC+1
37 .I PSUMLC>PSUMAX S PSUMC=PSUMC+1,PSUMLC=0,PSULC=PSULC-1 Q ; + message
38 .I $L(X)<235 S ^XTMP(PSUIVSUB,"XMD",PSUMC,PSUMLC)=X Q
39 .F I=235:-1:1 S Z=$E(X,I) Q:Z="^"
40 .S ^XTMP(PSUIVSUB,"XMD",PSUMC,PSUMLC)=$E(X,1,I)
41 .S PSUMLC=PSUMLC+1
42 .S ^XTMP(PSUIVSUB,"XMD",PSUMC,PSUMLC)="*"_$E(X,I+1,999)
43 ;
44 ; Count Lines sent
45 S PSUTLC=0
46 F PSUM=1:1:PSUMC S X=$O(^XTMP(PSUIVSUB,"XMD",PSUM,""),-1),PSUTLC=PSUTLC+X
47 ;
48 ; Transmit Messages
49VARS ; Setup variables for contents
50 F PSUM=1:1:PSUMC D
51 .D GETDIV
52 .S XMSUB="V. 4.0 PBMIV "_PSUMON_" "_PSUM_"/"_PSUMC_" "_PSUDIV_" "_PSUDIVNM
53 .S XMTEXT="^XTMP(PSUIVSUB,""XMD"",PSUM,"
54 .S XMCHAN=1
55 .S XMDUZ=DUZ
56 .M XMY=PSUXMYH
57 .D ^XMD
58 ;
59 I NONE S PSUTLC=0
60 S PSUMSG("M")=PSUMC
61 S PSUMSG("L")=PSUTLC
62 Q
63NODATA ;Send "No data to report" message
64 S PSUDIV=PSUSNDR
65 S ^XTMP(PSUIVSUB,"RECORDS",PSUDIV,1)="No data to report" S PSUAIS=1
66 S NONE=1
67 S ^XTMP("PSU_"_PSUJOB,"PSUNONE","IV")=""
68 M PSUXMYH=PSUXMYS1
69 D XMD
70SETCNT ;Set message count and line count
71 S PSUMSGT(PSUDIV,"M")=$G(PSUMSGT(PSUDIV,"M"))+PSUMSG("M")
72 S PSUMSGT(PSUDIV,"L")=$G(PSUMSGT(PSUDIV,"L"))+PSUMSG("L")
73 S ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUDIV,PSUOPTN,"M")=PSUMSGT(PSUDIV,"M")
74 S ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUDIV,PSUOPTN,"L")=PSUMSGT(PSUDIV,"L")
75 Q
76GETDIV ;get division name
77 S X=PSUDIV,DIC=40.8,DIC(0)="X",D="C" D IX^DIC ;**1
78 S X=+Y S PSUDIVNM=$$VAL^PSUTL(40.8,X,.01)
79 S ^XTMP("PSU_"_PSUJOB,"DIV",PSUDIV)=PSUDIVNM
80 Q
Note: See TracBrowser for help on using the repository browser.