source: FOIAVistA/trunk/r/ZZREGIONAL-A1C-A5C-CRHD-RGED-RGUT-RGWB-RG/RGMTUT03.m@ 1334

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

initial load of FOIAVistA 6/30/08 version

File size: 7.0 KB
Line 
1RGMTUT03 ;BIR/CML-MPI/PD Compile and Correct Data Validation Data for Local Sites (CON'T) ;08/12/02
2 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**20**;30 Apr 99
3 ;
4 I '$D(^XTMP("RGMT","UT01")) D G QUIT
5 .I '$D(RGHLMQ) W !!,"^RGMTUT01 must be run before this report can be printed!"
6 K ^XTMP("RGMT","HLMQUT01")
7 I '$D(SITEOPT) S SITEOPT=0
8 ;
9DEV ;
10 I $D(RGHLMQ) G START
11 W !!,"Right Margin for this report is 80."
12 K ZTSAVE S ZTSAVE("SITEOPT")=""
13 D EN^XUTMDEVQ("START^RGMTUT03","MPI/PD - Print Local Site Statistic Report",.ZTSAVE) I 'POP Q
14 W !,"NO DEVICE SELECTED OR REPORT PRINTED!!"
15 G QUIT
16 ;
17START ;
18 K LN
19 S SITE=$P($$SITE^VASITE(),"^",2),LOCSTA=$P($$SITE^VASITE(),"^",3),$P(LN,"-",81)=""
20 D NOW^%DTC S HDT=$$FMTE^XLFDT($E(%,1,12))
21 S COMPDT=$$FMTE^XLFDT($E(^XTMP("RGMT","UT01","@@","COMPILE STOPPED"),1,12))
22 ;calculate compile time
23 S COMPB=^XTMP("RGMT","UT01","@@","COMPILE STARTED")
24 S COMPS=^XTMP("RGMT","UT01","@@","COMPILE STOPPED")
25 S DIFF=($$FMDIFF^XLFDT(COMPS,COMPB,2))/3600
26 ;
27 I '$D(RGHLMQ) D
28 .W @IOF,"MPI/PD Statistics - ",SITE,?53,"Printed ",HDT
29 .W !,"Compiled ",COMPDT," (Compile Time: ",$J(DIFF,5,2)," hrs)",!,LN
30 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"@@ RUNDATE")=HDT_"^(Compile Time: "_$J(DIFF,5,2)_" hrs)"
31 ;
32 I '$D(RGHLMQ)&(SITEOPT=2) G DIAG1
33 ;
34CMOR ;Loop on CMOR totals in ^XTMP("RGMT","UT01","CMOR")
35 S GRAND=0
36 I '$D(RGHLMQ) W !,"=>CMOR TOTALS:"
37 S CMOR="" F S CMOR=$O(^XTMP("RGMT","UT01","CMOR",CMOR)) Q:$E(CMOR)="Z" Q:CMOR="" D
38 .S CMORSTA=0 F S CMORSTA=$O(^XTMP("RGMT","UT01","CMOR",CMOR,CMORSTA)) Q:'CMORSTA D
39 ..S SKIP=0
40 ..I CMORSTA=564 S SKIP=1,CMORNM="FAYETTEVILLE, AR"
41 ..I CMORSTA=565 S SKIP=1,CMORNM="FAYETTEVILLE, NC"
42 ..I 'SKIP D
43 ...S FRSTNM=$P(CMOR,",")
44 ...S CMORNM=$S(FRSTNM="VAMC":$P(CMOR,",",2),1:FRSTNM)
45 ..S TOT=$G(^XTMP("RGMT","UT01","CMOR",CMOR,CMORSTA,"1TOT"))
46 ..I TOT="" S TOT=$G(^XTMP("RGMT","UT01","CMOR",CMOR,CMORSTA))
47 ..S GRAND=GRAND+TOT
48 ..I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"CMOR",CMOR,CMORSTA)=TOT
49 ..I '$D(RGHLMQ) W !,CMORNM,?30," = ",?33,$J(TOT,7)
50 I '$D(RGHLMQ) W !?59,"TOTAL: ",?66,$J(GRAND,7)
51 ;
52TF ;Loop on Treating Facility totals
53 I '$D(RGHLMQ) W !!,"=>TREATING FACILITY TOTALS:"
54 S TF=""
55 F S TF=$O(^XTMP("RGMT","UT01","TF",TF)) Q:$E(TF)="Z" Q:TF="" D
56 .S TFSTA=0 F S TFSTA=$O(^XTMP("RGMT","UT01","TF",TF,TFSTA)) Q:'TFSTA D
57 ..S SKIP=0
58 ..I TFSTA=564 S SKIP=1,TFNM="FAYETTEVILLE, AR"
59 ..I TFSTA=565 S SKIP=1,TFNM="FAYETTEVILLE, NC"
60 ..I 'SKIP D
61 ...S FRSTNM=$P(TF,",")
62 ...S TFNM=$S(FRSTNM="VAMC":$P(TF,",",2),1:FRSTNM)
63 ..S TOT=^XTMP("RGMT","UT01","TF",TF,TFSTA)
64 ..I '$D(RGHLMQ) W !,TFNM,?30," = ",?33,$J(TOT,7)
65 ..I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"TF",TF,TFSTA)=TOT
66 ;
67 I SITEOPT=1,'$D(RGHLMQ) W !! G DIAG2
68 ;
69DIAG1 ;print diagnostic data
70 I '$D(^XTMP("RGMT","UT01","TOT CMOR MISS TF")) S ^XTMP("RGMT","UT01","TOT CMOR MISS TF")=0
71 I '$D(RGHLMQ) D
72 .W !,"Total CMORs missing a Treating Facility",?66,"="
73 .W $J(^XTMP("RGMT","UT01","TOT CMOR MISS TF"),6)
74 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"TOT CMOR MISS TF")=^XTMP("RGMT","UT01","TOT CMOR MISS TF")
75 ;
76 I '$D(^XTMP("RGMT","UT01","TOT LOC SITE MISS TF")) S ^XTMP("RGMT","UT01","TOT LOC SITE MISS TF")=0
77 I '$D(RGHLMQ) D
78 .W !,"Total patients with NATIONAL ICN and missing local TF",?66,"="
79 .W $J(^XTMP("RGMT","UT01","TOT LOC SITE MISS TF"),6)
80 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"TOT LOC SITE MISS TF")=^XTMP("RGMT","UT01","TOT LOC SITE MISS TF")
81 ;
82 I '$D(^XTMP("RGMT","UT01","TOT TFDUP")) S ^XTMP("RGMT","UT01","TOT TFDUP")=0
83 I '$D(RGHLMQ) D
84 .W !,"Total patients with Treating Facility dups",?66,"="
85 .W $J(^XTMP("RGMT","UT01","TOT TFDUP"),6)
86 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"TOT TFDUP")=^XTMP("RGMT","UT01","TOT TFDUP")
87 ;
88 I '$D(^XTMP("RGMT","UT01","REIND","MISSING AICN XREF")) S ^XTMP("RGMT","UT01","REIND","MISSING AICN XREF")=0
89 I '$D(RGHLMQ) D
90 .W !,"Total patients with any type ICN and no ""AICN"" xref",?66,"="
91 .W $J(^XTMP("RGMT","UT01","REIND","MISSING AICN XREF"),6)
92 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"MISSING AICN XREF")=^XTMP("RGMT","UT01","REIND","MISSING AICN XREF")
93 ;
94 I '$D(^XTMP("RGMT","UT01","REIND","MISSING AICNL XREF")) S ^XTMP("RGMT","UT01","REIND","MISSING AICNL XREF")=0
95 I '$D(RGHLMQ) D
96 .W !,"Total patients with LOCAL ICN and no ""AICNL"" xref",?66,"="
97 .W $J(^XTMP("RGMT","UT01","REIND","MISSING AICNL XREF"),6)
98 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"MISSING AICNL XREF")=^XTMP("RGMT","UT01","REIND","MISSING AICNL XREF")
99 ;
100 I '$D(^XTMP("RGMT","UT01","REIND","MISSING SSN XREF")) S ^XTMP("RGMT","UT01","REIND","MISSING SSN XREF")=0
101 I '$D(RGHLMQ) D
102 .W !,"Total patients with any type ICN and missing ""SSN"" xref",?66,"="
103 .W $J(^XTMP("RGMT","UT01","REIND","MISSING SSN XREF"),6)
104 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"MISSING SSN XREF")=^XTMP("RGMT","UT01","REIND","MISSING SSN XREF")
105 ;
106 I '$D(^XTMP("RGMT","UT01","CMOR WITH NO ICN")) S ^XTMP("RGMT","UT01","CMOR WITH NO ICN")=0
107 I '$D(RGHLMQ) D
108 .W !,"Total patients with NO ICN but have a CMOR assigned",?66,"="
109 .W $J(^XTMP("RGMT","UT01","CMOR WITH NO ICN"),6)
110 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"CMOR WITH NO ICN")=^XTMP("RGMT","UT01","CMOR WITH NO ICN")
111 ;
112 I '$D(^XTMP("RGMT","UT01","TOT NO ICN W/TF")) S ^XTMP("RGMT","UT01","TOT NO ICN W/TF")=0
113 I '$D(RGHLMQ) D
114 .W !,"Total patients with NO ICN but have TFs assigned",?66,"="
115 .W $J(^XTMP("RGMT","UT01","TOT NO ICN W/TF"),6)
116 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"TOT NO ICN W/TF")=^XTMP("RGMT","UT01","TOT NO ICN W/TF")
117 ;
118 I '$D(^XTMP("RGMT","UT01","TOT LOC ICN W/REMOTE TF")) S ^XTMP("RGMT","UT01","TOT LOC ICN W/REMOTE TF")=0
119 I '$D(RGHLMQ) D
120 .W !,"Total patients with LOCAL ICN but have remote TFs assigned",?66,"="
121 .W $J(^XTMP("RGMT","UT01","TOT LOC ICN W/REMOTE TF"),6)
122 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"TOT LOC ICN W/REMOTE TF")=^XTMP("RGMT","UT01","TOT LOC ICN W/REMOTE TF")
123 ;
124DIAG2 ;display counts for total patients with local/nat'l/no ICN
125 ;
126 I '$D(^XTMP("RGMT","UT01","REIND","NATIONAL ICN COUNT")) S ^XTMP("RGMT","UT01","REIND","NATIONAL ICN COUNT")=0
127 I '$D(RGHLMQ) D
128 .W !?3,"Total patients with a national ICN",?42,"= "
129 .W $J(^XTMP("RGMT","UT01","REIND","NATIONAL ICN COUNT"),8)
130 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"NATIONAL ICN COUNT")=^XTMP("RGMT","UT01","REIND","NATIONAL ICN COUNT")
131 ;
132 I '$D(^XTMP("RGMT","UT01","REIND","LOCAL ICN COUNT")) S ^XTMP("RGMT","UT01","REIND","LOCAL ICN COUNT")=0
133 I '$D(RGHLMQ) D
134 .W !?3,"Total patients with a local ICN",?42,"= "
135 .W $J(^XTMP("RGMT","UT01","REIND","LOCAL ICN COUNT"),8)
136 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"LOCAL ICN COUNT")=^XTMP("RGMT","UT01","REIND","LOCAL ICN COUNT")
137 ;
138 I '$D(^XTMP("RGMT","UT01","REIND","NO ICN COUNT")) S ^XTMP("RGMT","UT01","REIND","NO ICN COUNT")=0
139 I '$D(RGHLMQ) D
140 .W !?3,"Total patients with no ICN",?42,"= "
141 .W $J(^XTMP("RGMT","UT01","REIND","NO ICN COUNT"),8)
142 I $D(RGHLMQ) S ^XTMP("RGMT","HLMQUT01",LOCSTA,"NO ICN COUNT")=^XTMP("RGMT","UT01","REIND","NO ICN COUNT")
143 ;
144QUIT ;
145 K %,CMOR,CMORNM,CMORSTA,COMDT,COMPB,COMPDT,COMPS,DIFF,FRSTNM,GRAND,HDT,LN,LOCSTA,SITE,SITEOPT,SKIP,TF,TFNM,TFSTA,TOT
146 Q
Note: See TracBrowser for help on using the repository browser.