source: FOIAVistA/tag/r/ZZREGIONAL-A1C-A5C-CRHD-RGED-RGUT-RGWB-RG/RGMTDPCT.m@ 1424

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1RGMTDPCT ;GAI/TMG-Count Entries for ^DPT in Dup. Record file ;3-11-98
2 ;;1.0; CLINICAL INFO RESOURCE NETWORK ;;30 Apr 99
3 ;; Counts duplicate entries for ^DPT in Duplicate Record file by each
4 ;; of the following and then by the match percentile.
5 ;; - STATUS (verification status)
6 ;; P = potential duplicate
7 ;; N = verified, not a duplicate
8 ;; V = verified duplicate
9 ;; X = verification in progress
10 ;; R = required review
11 ;; - MERGE STATUS - 0 = not ready
12 ;; 1 = ready
13 ;; 2 = merged
14 ;; 3 = in progress
15 ;;
16START W !,"Duplicate Record File Statistics Scan",!
17 I '$D(DUZ) W !!,"Your user identification is not set. Please D ^XUP and try again." Q
18 S USER=DUZ,ZTIO="",ZTRTN="SCAN^RGMTDPCT",ZTDESC="Duplicate Record Statistics Search"
19 S ZTSAVE("USER")="" D ^%ZTLOAD I $D(ZTSK) W !," Task# ",ZTSK," queued to run." D ^%ZISC,KILL
20 S:$D(ZTQUEUED) ZTREQ="@"
21 Q
22 ;;
23SCAN K ^XTMP("RGMTDPCT") S U="^"
24 ;set purge date of XTMP = 30 days
25 S ^XTMP("RGMTDPCT",0)=$$FMADD^XLFDT($$NOW^XLFDT,30)_U_$$NOW^XLFDT_U_"DUPLICATE RECORD CHECK"
26 S ^XTMP("RGMTDPCT","@@@@","STARTED")=$$NOW^XLFDT
27 S (^XTMP("RGMTDPCT","@@@@","SITE"),SITE)=$$SITE^VASITE()
28 S IEN=0 F S IEN=$O(^VA(15,IEN)) Q:+IEN'>0 I $D(^VA(15,+IEN,0)) S NODE0=^(0) D
29 .S ^XTMP("RGMTDPCT","@@@@","CURR IEN")=IEN
30 .S (VSTAT,MSTAT)="ZZZ" S:$P(NODE0,U,3)'="" VSTAT=$P(NODE0,U,3) S:$P(NODE0,U,5)'="" MSTAT=$P(NODE0,U,5)
31 .S MPERC=(($P(NODE0,U,19))\10)*10
32 .S:'$D(^XTMP("RGMTDPCT","VERIF",VSTAT,MPERC)) ^XTMP("RGMTDPCT","VERIF",VSTAT,MPERC)=0 S ^XTMP("RGMTDPCT","VERIF",VSTAT,MPERC)=^XTMP("RGMTDPCT","VERIF",VSTAT,MPERC)+1
33 .S:'$D(^XTMP("RGMTDPCT","MERGE",MSTAT,MPERC)) ^XTMP("RGMTDPCT","MERGE",MSTAT,MPERC)=0 S ^XTMP("RGMTDPCT","MERGE",MSTAT,MPERC)=^XTMP("RGMTDPCT","MERGE",MSTAT,MPERC)+1
34 ;
35MSG ;
36 S X=^XTMP("RGMTDPCT","@@@@","STARTED")
37 S %DT="T" D ^%DT S X=Y X ^DD("DD") S MSGDT=Y
38 S BLANKS=" "
39 S TXT(.1)="Duplicate Record (^DPT) Statistics"_$J(" ",15)_"Run Date: "_MSGDT
40 S TXT(.2)=""
41 S TXT(.3)=$P(SITE,U,2)_" ("_$P(SITE,U)_")"
42 S TXT(.4)=""
43 S TXT(.5)=" Counts by: Merge Status and Match Percentile:"
44 S LINE=1,STATUS="" F S STATUS=$O(^XTMP("RGMTDPCT","MERGE",STATUS)) Q:STATUS="" D
45 .S MSGSTAT=$S(STATUS=0:"NOT READY",STATUS=1:"READY",STATUS=2:"MERGED",STATUS=3:"IN PROGRESS",STATUS="ZZZ":"UNKNOWN")
46 . S LINE=LINE+.001
47 . S TXT(LINE)=""
48 . S LINE=LINE+.001 S TXT(LINE)=" Merge Status: "_MSGSTAT
49 .S PERC=0 F S PERC=$O(^XTMP("RGMTDPCT","MERGE",STATUS,PERC)) Q:+PERC'>0 S COUNT=^(PERC) D
50 . . S LINE=LINE+.001
51 . . S TEXT=" Percentile: "_PERC_BLANKS,TEXT=$E(TEXT,1,30),TEXT=TEXT_COUNT
52 . . S TXT(LINE)=TEXT
53 S LINE=2,LINE=LINE+.001 S TXT(LINE)=""
54 S LINE=LINE+.001
55 S TXT(LINE)=" Counts by: Verification Status and Match Percentile:"
56 S STATUS="" F S STATUS=$O(^XTMP("RGMTDPCT","VERIF",STATUS)) Q:STATUS="" D
57 . S MSGSTAT=$S(STATUS="P":"POTENTIAL DUP., UNVERIF",STATUS="N":"VERIFIED, NOT A DUPLICATE",STATUS="V":"VERIFIED DUPLICATE",STATUS="X":"VERIF. IN PROGRESS",STATUS="R":"REQUIRES RESOLUTION",1:"")
58 . S LINE=LINE+.001,TXT(LINE)=""
59 . S LINE=LINE+.001,TXT(LINE)=" Verification Status: "_MSGSTAT
60 . S PERC=0 F S PERC=$O(^XTMP("RGMTDPCT","VERIF",STATUS,PERC)) Q:+PERC'>0 S COUNT=^(PERC) D
61 . . S LINE=LINE+.001
62 . . S TEXT=" Percentile: "_PERC_BLANKS,TEXT=$E(TEXT,1,30),TEXT=TEXT_COUNT
63 . . S TXT(LINE)=TEXT
64 S (XMY(DUZ),XMY(USER))="",(XMDUZ)=DUZ
65 S XMSUB="Duplicate Record Counts: "_$P(SITE,U,2)
66 S XMTEXT="TXT(" D ^XMD
67 ;
68KILL K ^XTMP("RGMTDPCT"),BLANKS,COUNT,IEN,LINE,MPERC,MSGDT,MSGSTAT,MSTAT,NODE0
69 K PERC,SITE,STATUS,TEXT,TXT,USER,VSTAT,X,XMDUZ,XMSUB,XMTEXT,XMY,Y,ZTSAVE
70 K ZTDESC,ZTIO,ZTRTN,ZTSK,%DT
71 Q
Note: See TracBrowser for help on using the repository browser.