1 | RGSYSTAT ;BAY/ALS-MPI/PD STATUS DISPLAY ;01/05/01
|
---|
2 | ;;1.0;CLINICAL INFO RESOURCE NETWORK;**16,19,23,25,20,43,45,52**;30 Apr 99;Build 2
|
---|
3 | ;
|
---|
4 | ;Reference to ^DGCN(391.98,"AST" supported by IA #3303
|
---|
5 | ;Reference to ^DGCN(391.984 supported by IA #3304
|
---|
6 | ;Reference to ^MPIF(984.9 supported by IA #3298
|
---|
7 | ;Reference to OPTSTAT^XUTMOPT supported by IA #1472
|
---|
8 | ;Reference to ^DPT("ACMORS", ^DPT("AICN", and ^DPT("AICNL" supported by IA #2070
|
---|
9 | ;Reference to ^VAT(391.71 supported by IA #3422
|
---|
10 | EN ;
|
---|
11 | ; Count exceptions on hand
|
---|
12 | EXC ;
|
---|
13 | W @IOF,"Exception Handler Entries:",!,"--------------------------"
|
---|
14 | S CNT=0,EXCTYP="",NTYP="",TOTL=0,PCNT=0
|
---|
15 | N STAT,DFN,ICN
|
---|
16 | S HOME=$$SITE^VASITE()
|
---|
17 | F S EXCTYP=$O(^RGHL7(991.1,"AC",EXCTYP)) Q:'EXCTYP D
|
---|
18 | . I (EXCTYP=234)!(EXCTYP=218) D ;**45;MPIC_772; **52 remove 215, 216, 217, & 227
|
---|
19 | .. I (EXCTYP'=NTYP)&(CNT>0) D
|
---|
20 | ... S ETEXT=$P($G(^RGHL7(991.11,NTYP,10)),"^",1)
|
---|
21 | ... W !,$E(ETEXT,1,47),?55,$J(CNT,6) S TOTL=TOTL+CNT,CNT=0
|
---|
22 | .. S IEN=0,NTYP=EXCTYP
|
---|
23 | .. F S IEN=$O(^RGHL7(991.1,"AC",EXCTYP,IEN)) Q:'IEN D
|
---|
24 | ... S IEN2=0
|
---|
25 | ... F S IEN2=$O(^RGHL7(991.1,"AC",EXCTYP,IEN,IEN2)) Q:'IEN2 D
|
---|
26 | .... S STAT=$P(^RGHL7(991.1,IEN,1,IEN2,0),"^",5) I STAT<1 D
|
---|
27 | ..... S DFN=$P(^RGHL7(991.1,IEN,1,IEN2,0),"^",4) Q:'DFN
|
---|
28 | ..... S ^XTMP("RGEXC",0)=$$FMADD^XLFDT(DT,2)_"^"_DT_"^"_"MPI/PD Status Display"
|
---|
29 | ..... S ^XTMP("RGEXC",DFN)=DFN
|
---|
30 | ..... S ICN=+$$GETICN^MPIF001(DFN)
|
---|
31 | ..... I $E(ICN,1,3)=$E($P(HOME,"^",3),1,3)!(ICN<0)!(EXCTYP=234)!(EXCTYP=218) D ;**43;**45;MPIC_772; **52 remove 215, 216, and 217
|
---|
32 | ...... S CNT=CNT+1
|
---|
33 | I CNT>0 D
|
---|
34 | .S ETEXT=$P($G(^RGHL7(991.11,NTYP,10)),"^",1)
|
---|
35 | .W !,$E(ETEXT,1,47),?55,$J(CNT,6) S TOTL=TOTL+CNT
|
---|
36 | I TOTL=0 W !,"There are no entries in the Exception Handler."
|
---|
37 | I TOTL>0 D
|
---|
38 | . W !!,"Total number of exceptions: ",?55,$J(TOTL,6)
|
---|
39 | . S PDFN=""
|
---|
40 | . F S PDFN=$O(^XTMP("RGEXC",PDFN)) Q:'PDFN D
|
---|
41 | .. S PCNT=PCNT+1
|
---|
42 | . W !,"Total unique patient exceptions: ",?55,$J(PCNT,6)
|
---|
43 | S STDT=$P($G(^RGSITE(991.8,1,"EXCPRG")),"^",1)
|
---|
44 | I $D(^RGSITE(991.8,1,"EXCPRG")) D
|
---|
45 | . S STDT=$$FMTE^XLFDT(STDT,1)
|
---|
46 | . W !!,"The MPI/PD Exception Purge process last ran "_STDT_"."
|
---|
47 | K CNT,EXCTYP,NTYP,ETEXT,TOTL,IEN,IEN2,HOME,PCNT,^XTMP("RGEXC"),PDFN,STDT
|
---|
48 | I $Y>21 D QUIT Q:X="^"
|
---|
49 | PDR ;Count entries in Patient Data Review ;**52 Obsolete data removed from report.
|
---|
50 | ;W !!,"Patient Data Review Entries:",!,"----------------------------"
|
---|
51 | ;S CNT=0,PDRTYP="",NTYP="",TOTL=0
|
---|
52 | ;F S PDRTYP=$O(^DGCN(391.98,"AST",PDRTYP)) Q:'PDRTYP D
|
---|
53 | ;. I (PDRTYP'=NTYP)&(CNT>0) D
|
---|
54 | ;.. S DIC="^DGCN(391.984,",DR=".01",DA=NTYP,DIQ(0)="E",DIQ="RGPDR"
|
---|
55 | ;.. D EN^DIQ1 K DIC,DA,DR,DIQ
|
---|
56 | ;.. S PTEXT=$G(RGPDR(391.984,NTYP,.01,"E"))
|
---|
57 | ;.. W !,$E(PTEXT,1,47),?55,$J(CNT,6) S TOTL=TOTL+CNT,CNT=0
|
---|
58 | ;. I (PDRTYP=1)!(PDRTYP=2)!(PDRTYP=5) D
|
---|
59 | ;.. S IEN=0,NTYP=PDRTYP
|
---|
60 | ;.. F S IEN=$O(^DGCN(391.98,"AST",PDRTYP,IEN)) Q:'IEN D
|
---|
61 | ;... S CNT=CNT+1
|
---|
62 | ;I CNT>0 D
|
---|
63 | ;. S DIC="^DGCN(391.984,",DR=".01",DA=NTYP,DIQ(0)="E",DIQ="RGPDR"
|
---|
64 | ;. D EN^DIQ1 K DIC,DA,DR,DIQ
|
---|
65 | ;. S PTEXT=$G(RGPDR(391.984,NTYP,.01,"E"))
|
---|
66 | ;.W !,$E(PTEXT,1,47),?55,$J(CNT,6) S TOTL=TOTL+CNT
|
---|
67 | ;I TOTL=0 W !,"There are no entries in Patient Data Review."
|
---|
68 | ;K CNT,PDRTYP,NTYP,TOTL,IEN,PTEXT,RGPDR
|
---|
69 | ;Q
|
---|
70 | ;I $Y>20 D QUIT Q:X="^"
|
---|
71 | ;
|
---|
72 | CMOR ;CMOR Requests Status ;**52 Obsolete data removed from report.
|
---|
73 | ;W !!,"CMOR Requests Status:",!,"---------------------"
|
---|
74 | ;S CNT=0,STAT="",NSTAT="",TOTL=0
|
---|
75 | ;F S STAT=$O(^MPIF(984.9,"AC",STAT)) Q:'STAT D
|
---|
76 | ;. I (STAT'=NSTAT)&(CNT>0) D
|
---|
77 | ;.. S TEXT=$$EXTERNAL^DILFD(984.9,.06,,NSTAT)
|
---|
78 | ;.. W !,$E(TEXT,1,47),?55,$J(CNT,6) S TOTL=TOTL+CNT,CNT=0
|
---|
79 | ;. S IEN=0,NSTAT=STAT
|
---|
80 | ;. F S IEN=$O(^MPIF(984.9,"AC",STAT,IEN)) Q:'IEN D
|
---|
81 | ;.. S CNT=CNT+1 S TOTL=TOTL+CNT
|
---|
82 | ;I CNT>0 S TEXT=$$EXTERNAL^DILFD(984.9,.06,,NSTAT) W !,$E(TEXT,1,47),?55,$J(CNT,6) S TOTL=TOTL+CNT,CNT=0
|
---|
83 | ;I TOTL=0 W !,"There are no outstanding CMOR Requests."
|
---|
84 | ;K CNT,STAT,NSTAT,TEXT,TOTL,IEN
|
---|
85 | ;I $Y>20 D QUIT Q:X="^"
|
---|
86 | ;
|
---|
87 | S HOME=$P($$SITE^VASITE(),"^",3)
|
---|
88 | S ICN=0,CNT=0
|
---|
89 | F S ICN=$O(^DPT("AICN",ICN)) Q:'ICN D
|
---|
90 | .Q:$E(ICN,1,3)=HOME
|
---|
91 | .S CNT=CNT+1
|
---|
92 | W !!,"Current total number of National ICNs = ",CNT
|
---|
93 | S ICN=0,CNT=0
|
---|
94 | F S ICN=$O(^DPT("AICNL",1,ICN)) Q:'ICN S CNT=CNT+1
|
---|
95 | W !,"Current total number of Local ICNs = ",CNT
|
---|
96 | K CNT,DFN,ICN
|
---|
97 | Q
|
---|
98 | QUIT S DIR(0)="E" D D ^DIR K DIR
|
---|
99 | .S SS=21-$Y F JJ=1:1:SS W !
|
---|
100 | S $Y=0
|
---|
101 | K JJ,SS
|
---|
102 | Q
|
---|