source: WorldVistAEHR/trunk/r/PHARMACY_BENEFITS_MANAGEMENT-PSU/PSUSUM1.m@ 1093

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

revised back to 6/30/08 version

File size: 3.4 KB
Line 
1PSUSUM1 ;BIR/DAM - Summary Report for Provider Extract ; 20 DEC 2001
2 ;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
3 ;
4 ; No DBIA's required.
5 ;
6EN ;EN CALLED FROM ^PSUDEM4
7 ;
8 D PULL^PSUCP
9 D DATE
10 D PRSUM^PSUDEM5 ;Mail message
11 Q
12 ;
13DATE ;Convert dates to external format
14 ;
15 S %H=$E($H,1,5) ;today's date
16 D YX^%DTC
17 N PSUD S PSUD=Y
18 ;
19 S Y=PSUSDT ;Start date of extract
20 D DD^%DT
21 N PSUS S PSUS=Y
22 ;
23 S Y=PSUEDT ;End date of extract
24 D DD^%DT
25 N PSUE S PSUE=Y
26 ;
27 D SUMM
28 Q
29 ;
30SUMM ;Compose summary mail message by placing all text into a
31 ;temporary global, designated ^XTMP("PSU_"_PSUJOB,"PSUSUM",
32 ;
33 ;
34 ;Report header
35 I '$D(^XTMP("PSU_"_PSUJOB,"PSUPROV")) D Q
36 .S ^XTMP("PSU_"_PSUJOB,"PSUSUM",1)="No data to report"
37 S ^XTMP("PSU_"_PSUJOB,"PSUSUM",1)="Provider Summary Report "_PSUD
38 S ^XTMP("PSU_"_PSUJOB,"PSUSUM",2)="" ;Blank line
39 S ^XTMP("PSU_"_PSUJOB,"PSUSUM",3)=" "_PSUS_" through "_PSUE
40 S ^XTMP("PSU_"_PSUJOB,"PSUSUM",4)=""
41 S $P(^XTMP("PSU_"_PSUJOB,"PSUSUM",5),"-",80)="" ;Separator Bar
42 S $P(^XTMP("PSU_"_PSUJOB,"PSUSUM",7),"-",80)=""
43 S ^XTMP("PSU_"_PSUJOB,"PSUSUM",8)=""
44 S ^XTMP("PSU_"_PSUJOB,"PSUSUM",9)="IEN Provider Name (SSN) Missing Data"
45 S $P(^XTMP("PSU_"_PSUJOB,"PSUSUM",10),"-",80)=""
46 D PROV
47 ;
48 Q
49 ;
50PROV ;Gather missing provider data for summary report
51 ;
52 N PSUSSN3,PSUMIS,PSUCL,PSUSS,PSUSP,PSUSUB,PSULN,PSUM
53 S PSUM=0
54 S PSULN=11
55 S PSUIP=0
56 F S PSUIP=$O(^XTMP("PSU_"_PSUJOB,"PSUPROV",PSUIP)) Q:PSUIP="" Q:PSUIP["U" D
57 .S PSUSSN3=$E($P($G(^XTMP("PSU_"_PSUJOB,"PSUPROV",PSUIP)),U,3),6,9)
58 .I PSUSSN3="" S PSUSSN3="????",PSUMIS="SSN" D NAM ;No SSN
59 .S PSUCL=$P($G(^XTMP("PSU_"_PSUJOB,"PSUPROV",PSUIP)),U,5)
60 .I PSUCL="" S PSUMIS="PROVIDER CLASS" D NAM ;No Class
61 .S PSUSS=$P($G(^XTMP("PSU_"_PSUJOB,"PSUPROV",PSUIP)),U,6)
62 .I PSUSS="" S PSUMIS="SERVICE/SECTION" D NAM ;No Ser/Sec
63 .S PSUSP=$P($G(^XTMP("PSU_"_PSUJOB,"PSUPROV",PSUIP)),U,7)
64 .I PSUSP="" S PSUMIS="SPECIALTY" D NAM ;No Spec
65 .Q:PSUSP["Intern" ;Omit interns from missing subspec. on report
66 .Q:PSUSP["Resident" ;Omit residents from missing subspc. on report
67 .S PSUSUB=$P($G(^XTMP("PSU_"_PSUJOB,"PSUPROV",PSUIP)),U,8)
68 .I PSUSUB="" S PSUMIS="SUBSPECIALTY" D NAM ;No Subsp
69 Q
70 ;
71NAM ;Get Provider name and create entry line in summary report
72 ;
73 N PSUNAM,PSUT1,PSUT2,PSUT3,PSUT4,S1,S2,S3
74 N PSUT5,PSUT6,PSUT7,PSUT8,PSUT9,PSUT10
75 ;
76 S PSUT4=" "
77 S PSUT1=11
78 S PSUT2=PSUT1-$L(PSUIP)
79 F S1=1:1:(PSUT2-1) S PSUT3(S1)=" " D
80 .S PSUT4=PSUT4_PSUT3(S1) ;First tab position
81 ;
82 S PSUNAM=$P($G(^XTMP("PSU_"_PSUJOB,"PSUPROV",PSUIP)),U,9)
83 ;
84 S PSUT5=" "
85 S PSUT6=54
86 S PSUT7=(PSUT6-$L(PSUNAM)-7-$L(PSUT4)-$L(PSUIP))
87 F S2=1:1:(PSUT7-1) S PSUT8(S2)=" " D
88 .S PSUT5=PSUT5_PSUT8(S2) ;Second tab position
89 ;
90 S PSUT10=" "
91 F S3=1:1:(PSUT6-1) S PSUT9(S3)=" " D
92 .S PSUT10=PSUT10_PSUT9(S3) ;Third tab position
93 ;
94 ;
95 ;I '$D(^XTMP("PSU_"_PSUJOB,"PSUSUM",PSULN)) D
96 S ^XTMP("PSU_"_PSUJOB,"PSUSUM",PSULN)=PSUIP_PSUT4_PSUNAM_" ("_PSUSSN3_")"_PSUT5_PSUMIS
97 F I=1:1:5 I $P($G(^XTMP("PSU_"_PSUJOB,"PSUSUM",PSULN-I)),U,1)[PSUNAM D
98 .S ^XTMP("PSU_"_PSUJOB,"PSUSUM",PSULN)=PSUT10_PSUMIS
99 ;
100 I $P($G(^XTMP("PSU_"_PSUJOB,"PSUSUM",PSULN)),U,1)[PSUNAM D
101 .S PSUM=PSUM+1 ;Set a counter for number of patients accessed
102 .S ^XTMP("PSU_"_PSUJOB,"PSUSUM",6)="Total Number of Incomplete Provider Records Extracted: "_PSUM
103 S PSULN=PSULN+1
104 ;
105 Q
Note: See TracBrowser for help on using the repository browser.