source: WorldVistAEHR/trunk/r/PHARMACY_BENEFITS_MANAGEMENT-PSU/PSURT2.m@ 1177

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1PSURT2 ; BIR/RDC - DYNAMIC REPORT OF PATIENT DEMOGRAPHIC DATA; 12 APR 2004
2 ;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
3 ;
4 ; THIS PROGRAM IS CALLED TO EXTRACT DATES FROM ^PSUDEM AND
5 ; CALLS ^PSUDEM1 TO EXTRACT PMB PATIENT DEMOGRAPHIC DATA
6 ;
7EN ;
8 D INITZ
9 D LODXTMP
10 D MAILIT
11 K ^XTMP("PSU"_PSUJOB,"REXMT")
12 Q
13 ;
14INITZ ;
15 S START=PSUSTART,LAST=PSULAST
16 I $D(PSURMON) S PSURMON=$E(PSURMON,1,5)
17 I '$D(PSURMON) S PSURMON=PSUSRNG_" through "_PSUERNG
18 S PSUJOB=$J_"_"_$P($H,",",2)
19 S PSUMASF=$G(PSUMASF)
20 S PSUDUZ=$G(PSUDUZ)
21 S PSUPBMG=$G(PSUPBMG)
22 N PSURXMT
23 S PSURXMT=1
24 ;
25 S X=$$VALI^PSUTL(4.3,1,217)
26 S PSUSNDR=+$$VAL^PSUTL(4,X,99)
27 S X=PSUSNDR,DIC=40.8,DIC(0)="X",D="C" D IX^DIC ; ** set facility
28 S X=+Y S PSUVDIV=$$VAL^PSUTL(40.8,X,.01) ; ** set division
29 ;
30 Q
31 ;
32LODXTMP ;
33 ;
34 S START=START-1
35 F S START=$O(^PSUDEM("B",START)) Q:START>LAST!(START="") D
36 . S I=""
37 . S I=$O(^PSUDEM("B",START,I))
38 . S DFN=$P(^PSUDEM(I,0),U,2)
39 . S ^XTMP("PSU"_PSUJOB,"REXMT",DFN)=""
40 ;
41 ; ** ^XTMP SHOULD NOW HOLD ONE NODE PER PATIENT FOR THIS TIME FRAME **
42 Q
43 ;
44MAILIT ;
45 S ^XTMP("PSU_"_PSUJOB,"REXMIT")="YES"
46 S XMCHAN=1
47 S XMDUZ=DUZ
48 I $G(PSUMSTR) S PSUXMYH("G.PSU PBM@CMOP-NAT.MED.VA.GOV")=""
49 I $G(PSUMME) S PSUXMYH(DUZ)="",PSUXMYH("G.PSU PBM")=""
50 M XMY=PSUXMYH
51 ; MAILGROUPS ARE SET INTO XMY
52 S DFN=""
53 F S (DFN,PSUDMDFN)=$O(^XTMP("PSU"_PSUJOB,"REXMT",DFN)) Q:PSUDMDFN="" D
54 . D DAT^PSUDEM1
55 . D DEM1^PSUDEM1
56 D XMD^PSUDEM1
57 D CONFIRM
58 ;
59 Q
60CONFIRM ;
61 I $G(PSUMSTR) S PSUXMYH("G.PSU PBM@CMOP-NAT.MED.VA.GOV")=""
62 I $G(PSUMME) S PSUXMYH(DUZ)="",PSUXMYH("G.PSU PBM")=""
63 M XMY=PSUXMYH
64 F I=1:1:79 S $E(ZZ,I)="-"
65 S PSUPKG="Patient Demographics"
66 S PSUCONF(1)="The chart below shows the package(s) whose dispensing statistics were extracted"
67 S PSUCONF(2)="by the PBM Pharmacy Statistics Retransmission option."
68 S PSUCONF(3)=" "
69 S PSUCONF(4)="PACKAGE"_$J("# Line items",35)_$J("# MailMan msgs",19)
70 S PSUCONF(5)=ZZ
71 K ^XTMP(PSUSUB,"XMD")
72 M ^XTMP(PSUSUB,"XMD")=PSUCONF
73 S ^XTMP(PSUSUB,"XMD",6)=PSUPKG_$J(PSUMLC,37-$L(PSUPKG))_$J(PSUM,12)
74 S XMSUB="V. 4.0 PBMRXMT "_PSURMON_" "_PSUSIT_" "_PSUDIVNM
75 S XMDUZ=DUZ
76 S XMCHAN=1
77 S XMTEXT="^XTMP(PSUSUB,""XMD"","
78 D ^XMD
79 ;
80 Q
Note: See TracBrowser for help on using the repository browser.