source: WorldVistAEHR/trunk/r/ZZREGIONAL-A1C-A5C-CRHD-RGED-RGUT-RGWB-RG/RGMTUT02.m@ 634

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1RGMTUT02 ;BIR/CML-MPI/PD Compile and Correct Data Validation Data for Local Sites (CON'T) ;07/30/02
2 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**20,37,41**;30 Apr 99
3 ;
4 ;Reference to ^DPT("AICN" & ^DPT("AICNL" supported by IA #2070
5 ;Reference to $$SETLOC MPIF001 supported by IA #2705
6 ;Reference to EDIT^VAFCPTED supported by IA #2784
7 ;
8 Q
9 ;
10REIND ;Correct any existing xref problems:
11 ;patch RG*1.0*41 only removed code - specifically the check to see if the REIND has already run that day
12 ; - missing SSN xref (only if they have a local or national ICN)
13 ; - missing AICN xref
14 ; - missing AICNL xref and field Locally assigned ICN
15 ;Also get counts of national ICNs, Local ICNs and NO ICNs
16 ;
17 ;NOSSN = number of patients missing an SSN xref (only if they have a local or national ICN)
18 ;NOAICN = number of patients missing an AICN xref
19 ;NOAICNL = number of patients missing an AICNL xref
20 ;NICNCNT = number of patients with a national ICN
21 ;LICNCNT = number of patients with a local ICN
22 ;NOICNCNT = number of patients no ICN
23 ;
24 K ^XTMP("RGMT","UT01","REIND")
25 S (NOSSN,NOAICN,NOAICNL,NICNCNT,LICNCNT,NOICNCNT,DFNCNT)=0
26 F TYPE="MISSING SSN XREF","MISSING AICN XREF","MISSING AICNL XREF","NATIONAL ICN COUNT","LOCAL ICN COUNT","NO ICN COUNT" D
27 .S ^XTMP("RGMT","UT01","REIND",TYPE)=0
28 ;
29 S SITE=$P($$SITE^VASITE(),"^",3)
30 ;
31 I '$D(RGHLMQ) D
32 .W !!,"Checking for:"
33 .W !,"Missing ""SSN"" xrefs in ^DPT"
34 .W !,"Missing ""AICN"" xrefs in ^DPT"
35 .W !,"Missing ""AICNL"" xrefs in ^DPT"
36 .W !,"Counts on total National ICNs"
37 .W !,"Counts on total Local ICNs"
38 .W !,"Counts on total patients without ICNs"
39 ;
40 S DFN=0 F S DFN=$O(^DPT(DFN)) Q:'DFN S DFNCNT=DFNCNT+1 S MNODE=$G(^DPT(DFN,"MPI")) D
41 .I '$D(RGHLMQ),'(DFNCNT#10000) W !,DFN
42 .I MNODE="" S NOICNCNT=NOICNCNT+1 Q
43 .S ICN=$P(MNODE,"^") I ICN="" S NOICNCNT=NOICNCNT+1 Q
44 .S SSN=$P($G(^DPT(DFN,0)),"^",9)
45 .I $G(SSN),'$D(^DPT("SSN",SSN,DFN)) S NOSSN=NOSSN+1 D
46 ..; if SSN xref exists for a different patient, send exception and quit
47 ..; otherwise, edit the field to set the xref
48 ..I $D(^DPT("SSN",SSN)) D Q
49 ...D EXC^RGHLLOG(210,"SSN xref does not exist for patient DFN #"_DFN_" for SSN "_SSN_". This SSN appears to exist for a different patient.",DFN)
50 ..I $L(SSN)>8 K ARR S ARR(2,.09)=SSN D EDIT^VAFCPTED(DFN,"ARR(2)",".09")
51 .I '$D(^DPT("AICN",ICN,DFN)) S NOAICN=NOAICN+1,^DPT("AICN",ICN,DFN)=""
52 .I $E(ICN,1,3)'=SITE S NICNCNT=NICNCNT+1 Q
53 .I $E(ICN,1,3)=SITE D
54 ..S LICNCNT=LICNCNT+1
55 ..I '$D(^DPT("AICNL",1,DFN)) S LOCAL=$$SETLOC^MPIF001(DFN,1),^DPT("AICNL",1,DFN)="",NOAICNL=NOAICNL+1
56 ;
57 ;
58 S ^XTMP("RGMT","UT01","REIND","MISSING SSN XREF")=NOSSN
59 S ^XTMP("RGMT","UT01","REIND","MISSING AICN XREF")=NOAICN
60 S ^XTMP("RGMT","UT01","REIND","MISSING AICNL XREF")=NOAICNL
61 S ^XTMP("RGMT","UT01","REIND","NATIONAL ICN COUNT")=NICNCNT
62 S ^XTMP("RGMT","UT01","REIND","LOCAL ICN COUNT")=LICNCNT
63 S ^XTMP("RGMT","UT01","REIND","NO ICN COUNT")=NOICNCNT
64 ;
65 I '$D(RGHLMQ) D
66 .W !!,"Results:"
67 .W !?3,"Missing SSN xrefs created :",?41,$J(NOSSN,7)
68 .W !?3,"Missing AICN xrefs created :",?41,$J(NOAICN,7)
69 .W !?3,"Missing AICNL xrefs created:",?41,$J(NOAICNL,7)
70 .W !?3,"Total DFNs processed : ",$J(DFNCNT,8)
71 .W !?6,"Total National ICNs : ",$J(NICNCNT,8)
72 .W !?6,"Total Local ICNs : ",$J(LICNCNT,8)
73 .W !?6,"Total without ICNs : ",$J(NOICNCNT,8)
74 .W !!,"(List global ^XTMP(""RGMT"",""UT01"",""REIND"" for data.)"
75 ;
76 K ARR,CURDT,DFN,DFNCNT,ICN,LICNCNT,LOCAL,MNODE,NICNCNT,NOAICN,NOAICNL,NOICNCNT,NOSSN,SITE,SSN,TYPE
77 Q
Note: See TracBrowser for help on using the repository browser.