Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: RGMTUT02

RGMTUT02.m

Go to the documentation of this file.
  1. RGMTUT02 ;BIR/CML-MPI/PD Compile and Correct Data Validation Data for Local Sites (CON'T) ;07/30/02
  1. ;;1.0;CLINICAL INFO RESOURCE NETWORK;**20,37,41**;30 Apr 99
  1. ;
  1. ;Reference to ^DPT("AICN" & ^DPT("AICNL" supported by IA #2070
  1. ;Reference to $$SETLOC MPIF001 supported by IA #2705
  1. ;Reference to EDIT^VAFCPTED supported by IA #2784
  1. ;
  1. Q
  1. ;
  1. REIND ;Correct any existing xref problems:
  1. ;patch RG*1.0*41 only removed code - specifically the check to see if the REIND has already run that day
  1. ; - missing SSN xref (only if they have a local or national ICN)
  1. ; - missing AICN xref
  1. ; - missing AICNL xref and field Locally assigned ICN
  1. ;Also get counts of national ICNs, Local ICNs and NO ICNs
  1. ;
  1. ;NOSSN = number of patients missing an SSN xref (only if they have a local or national ICN)
  1. ;NOAICN = number of patients missing an AICN xref
  1. ;NOAICNL = number of patients missing an AICNL xref
  1. ;NICNCNT = number of patients with a national ICN
  1. ;LICNCNT = number of patients with a local ICN
  1. ;NOICNCNT = number of patients no ICN
  1. ;
  1. K ^XTMP("RGMT","UT01","REIND")
  1. S (NOSSN,NOAICN,NOAICNL,NICNCNT,LICNCNT,NOICNCNT,DFNCNT)=0
  1. F TYPE="MISSING SSN XREF","MISSING AICN XREF","MISSING AICNL XREF","NATIONAL ICN COUNT","LOCAL ICN COUNT","NO ICN COUNT" D
  1. .S ^XTMP("RGMT","UT01","REIND",TYPE)=0
  1. ;
  1. S SITE=$P($$SITE^VASITE(),"^",3)
  1. ;
  1. I '$D(RGHLMQ) D
  1. .W !!,"Checking for:"
  1. .W !,"Missing ""SSN"" xrefs in ^DPT"
  1. .W !,"Missing ""AICN"" xrefs in ^DPT"
  1. .W !,"Missing ""AICNL"" xrefs in ^DPT"
  1. .W !,"Counts on total National ICNs"
  1. .W !,"Counts on total Local ICNs"
  1. .W !,"Counts on total patients without ICNs"
  1. ;
  1. S DFN=0 F S DFN=$O(^DPT(DFN)) Q:'DFN S DFNCNT=DFNCNT+1 S MNODE=$G(^DPT(DFN,"MPI")) D
  1. .I '$D(RGHLMQ),'(DFNCNT#10000) W !,DFN
  1. .I MNODE="" S NOICNCNT=NOICNCNT+1 Q
  1. .S ICN=$P(MNODE,"^") I ICN="" S NOICNCNT=NOICNCNT+1 Q
  1. .S SSN=$P($G(^DPT(DFN,0)),"^",9)
  1. .I $G(SSN),'$D(^DPT("SSN",SSN,DFN)) S NOSSN=NOSSN+1 D
  1. ..; if SSN xref exists for a different patient, send exception and quit
  1. ..; otherwise, edit the field to set the xref
  1. ..I $D(^DPT("SSN",SSN)) D Q
  1. ...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)
  1. ..I $L(SSN)>8 K ARR S ARR(2,.09)=SSN D EDIT^VAFCPTED(DFN,"ARR(2)",".09")
  1. .I '$D(^DPT("AICN",ICN,DFN)) S NOAICN=NOAICN+1,^DPT("AICN",ICN,DFN)=""
  1. .I $E(ICN,1,3)'=SITE S NICNCNT=NICNCNT+1 Q
  1. .I $E(ICN,1,3)=SITE D
  1. ..S LICNCNT=LICNCNT+1
  1. ..I '$D(^DPT("AICNL",1,DFN)) S LOCAL=$$SETLOC^MPIF001(DFN,1),^DPT("AICNL",1,DFN)="",NOAICNL=NOAICNL+1
  1. ;
  1. ;
  1. S ^XTMP("RGMT","UT01","REIND","MISSING SSN XREF")=NOSSN
  1. S ^XTMP("RGMT","UT01","REIND","MISSING AICN XREF")=NOAICN
  1. S ^XTMP("RGMT","UT01","REIND","MISSING AICNL XREF")=NOAICNL
  1. S ^XTMP("RGMT","UT01","REIND","NATIONAL ICN COUNT")=NICNCNT
  1. S ^XTMP("RGMT","UT01","REIND","LOCAL ICN COUNT")=LICNCNT
  1. S ^XTMP("RGMT","UT01","REIND","NO ICN COUNT")=NOICNCNT
  1. ;
  1. I '$D(RGHLMQ) D
  1. .W !!,"Results:"
  1. .W !?3,"Missing SSN xrefs created :",?41,$J(NOSSN,7)
  1. .W !?3,"Missing AICN xrefs created :",?41,$J(NOAICN,7)
  1. .W !?3,"Missing AICNL xrefs created:",?41,$J(NOAICNL,7)
  1. .W !?3,"Total DFNs processed : ",$J(DFNCNT,8)
  1. .W !?6,"Total National ICNs : ",$J(NICNCNT,8)
  1. .W !?6,"Total Local ICNs : ",$J(LICNCNT,8)
  1. .W !?6,"Total without ICNs : ",$J(NOICNCNT,8)
  1. .W !!,"(List global ^XTMP(""RGMT"",""UT01"",""REIND"" for data.)"
  1. ;
  1. K ARR,CURDT,DFN,DFNCNT,ICN,LICNCNT,LOCAL,MNODE,NICNCNT,NOAICN,NOAICNL,NOICNCNT,NOSSN,SITE,SSN,TYPE
  1. Q