XUP732 ;ALB/CMC - XU*8*732 POST-INIT ; 7/2/20
;;8.0;KERNEL;**732**;Jul 10, 1995;Build 3
;
QUE ;Queue off the NPI DUPLICATE CLEANUP PROCESS
N ZTIO,ZTSK,ZTRTN,ZTDESC,ZTSAVE,ZTDTH,Y
S ZTIO="",ZTRTN="EN^XUP732",ZTDTH=$H
S ZTDESC="XU*8.0*732 Post-Install NPI DUPLICATE CLEANUP PROCESS"
D ^%ZTLOAD
I '$G(ZTSK) D MES^XPDUTL(" **** Queuing job failed!!!") Q
D MES^XPDUTL(" Job number #"_ZTSK_" was queued.")
Q
EN ;
N NPI,CNT,CNT2,CNT3,CNT4,ISSUE,IEN,IEN2,NAME,XUARR,XURET,STRT,END
S STRT=$$NOW^XLFDT
S NPI="",CNT=0,CNT2=0,CNT3=0,CNT4=0
F S NPI=$O(^VA(200,"ANPI",NPI)) Q:NPI="" D
.S IEN=$O(^VA(200,"ANPI",NPI,"")) S IEN2=$O(^VA(200,"ANPI",NPI,IEN))
.I IEN2'="" D
..;HAVE MORE THAN ONE DUZ FOR THE NPI
..S CNT=CNT+1 K XURET,XUARR
..;CHECK IF TITLE AND REMARKS ARE "NON-VA PROVIDER"
..I $$GET1^DIQ(200,IEN_",",8)="NON-VA PROVIDER"&($$GET1^DIQ(200,IEN_",",53.9)="NON-VA PROVIDER") S CNT2=CNT2+1 D
...;WE CREATED THE FIRST NPI CLEAN UP THE 2ND
...S NAME=$$GET1^DIQ(200,IEN2_",",.01)
...S XUARR(0)="200;IEN^DUZ^^"_IEN2_"^"_IEN2
...S XUARR(1)="200;.01^NAME^ZZ"_NAME_"^ZZ"_NAME
...S XUARR(2)="200;41.99^NPI^@^@"
...S XUARR(3)="200;42^EFFECTIVE DATE/TIME^"_NPI
...D UPDATE^XUMVINPU(.XURET,.XUARR)
...I XURET(0)=1 S CNT3=CNT3+1
...I XURET(0)'=1 S CNT4=CNT4+1 S ISSUE(NPI)=NPI_"^"_IEN_"^"_IEN2
S END=$$NOW^XLFDT
D MAIL(CNT,CNT2,CNT3,CNT4,.ISSUE,STRT,END) ;SEND MAIL WITH STATS
Q
MAIL(CNT,CNT2,CNT3,CNT4,ISSUE,STRT,END) ;
N XMDUZ,XMTEXT,XMSUB,XMY,XMZ,XUDUN,MSGXU
S XUDUN(1)="Post-Init routine EN^XUP732 has completed NPI cleanup"
S XUDUN(2)=" Processed Started at: "_$$FMTE^XLFDT(STRT)_" - Completed at: "_$$FMTE^XLFDT(END)
S XUDUN(3)="",XUDUN(4)="Total Number of NPI values reviewed: "_CNT
S XUDUN(5)="Total Number of NPI duplicates: "_CNT2
S XUDUN(6)="Total Number of NPI duplicates cleaned up: "_CNT3
S XUDUN(7)="Total Number of NPI duplicates that failed in cleanup: "_CNT4,XUDUN(8)=""
I CNT4>0 D
.S XUDUN(9)=" NPI ^ DUZ1 ^ DUZ2"
.N IEN,JJ S JJ=10,IEN=0 F S IEN=$O(ISSUE(IEN)) Q:IEN="" S XUDUN(JJ)=ISSUE(IEN),JJ=JJ+1
S XMSUB="NPI Cleanup - XU*8*732 -SITE: "_$P($$SITE^VASITE,"^",3)
S XMTEXT="XUDUN(",XMDUZ=.5,XMY(DUZ)=""
S XMY("Christine.Chesney@domain.ext")=""
S XMY("John.Williams30ec0c@domain.ext")=""
D ^XMD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXUP732 2309 printed Dec 13, 2024@02:11:28 Page 2
XUP732 ;ALB/CMC - XU*8*732 POST-INIT ; 7/2/20
+1 ;;8.0;KERNEL;**732**;Jul 10, 1995;Build 3
+2 ;
QUE ;Queue off the NPI DUPLICATE CLEANUP PROCESS
+1 NEW ZTIO,ZTSK,ZTRTN,ZTDESC,ZTSAVE,ZTDTH,Y
+2 SET ZTIO=""
SET ZTRTN="EN^XUP732"
SET ZTDTH=$HOROLOG
+3 SET ZTDESC="XU*8.0*732 Post-Install NPI DUPLICATE CLEANUP PROCESS"
+4 DO ^%ZTLOAD
+5 IF '$GET(ZTSK)
DO MES^XPDUTL(" **** Queuing job failed!!!")
QUIT
+6 DO MES^XPDUTL(" Job number #"_ZTSK_" was queued.")
+7 QUIT
EN ;
+1 NEW NPI,CNT,CNT2,CNT3,CNT4,ISSUE,IEN,IEN2,NAME,XUARR,XURET,STRT,END
+2 SET STRT=$$NOW^XLFDT
+3 SET NPI=""
SET CNT=0
SET CNT2=0
SET CNT3=0
SET CNT4=0
+4 FOR
SET NPI=$ORDER(^VA(200,"ANPI",NPI))
if NPI=""
QUIT
Begin DoDot:1
+5 SET IEN=$ORDER(^VA(200,"ANPI",NPI,""))
SET IEN2=$ORDER(^VA(200,"ANPI",NPI,IEN))
+6 IF IEN2'=""
Begin DoDot:2
+7 ;HAVE MORE THAN ONE DUZ FOR THE NPI
+8 SET CNT=CNT+1
KILL XURET,XUARR
+9 ;CHECK IF TITLE AND REMARKS ARE "NON-VA PROVIDER"
+10 IF $$GET1^DIQ(200,IEN_",",8)="NON-VA PROVIDER"&($$GET1^DIQ(200,IEN_",",53.9)="NON-VA PROVIDER")
SET CNT2=CNT2+1
Begin DoDot:3
+11 ;WE CREATED THE FIRST NPI CLEAN UP THE 2ND
+12 SET NAME=$$GET1^DIQ(200,IEN2_",",.01)
+13 SET XUARR(0)="200;IEN^DUZ^^"_IEN2_"^"_IEN2
+14 SET XUARR(1)="200;.01^NAME^ZZ"_NAME_"^ZZ"_NAME
+15 SET XUARR(2)="200;41.99^NPI^@^@"
+16 SET XUARR(3)="200;42^EFFECTIVE DATE/TIME^"_NPI
+17 DO UPDATE^XUMVINPU(.XURET,.XUARR)
+18 IF XURET(0)=1
SET CNT3=CNT3+1
+19 IF XURET(0)'=1
SET CNT4=CNT4+1
SET ISSUE(NPI)=NPI_"^"_IEN_"^"_IEN2
End DoDot:3
End DoDot:2
End DoDot:1
+20 SET END=$$NOW^XLFDT
+21 ;SEND MAIL WITH STATS
DO MAIL(CNT,CNT2,CNT3,CNT4,.ISSUE,STRT,END)
+22 QUIT
MAIL(CNT,CNT2,CNT3,CNT4,ISSUE,STRT,END) ;
+1 NEW XMDUZ,XMTEXT,XMSUB,XMY,XMZ,XUDUN,MSGXU
+2 SET XUDUN(1)="Post-Init routine EN^XUP732 has completed NPI cleanup"
+3 SET XUDUN(2)=" Processed Started at: "_$$FMTE^XLFDT(STRT)_" - Completed at: "_$$FMTE^XLFDT(END)
+4 SET XUDUN(3)=""
SET XUDUN(4)="Total Number of NPI values reviewed: "_CNT
+5 SET XUDUN(5)="Total Number of NPI duplicates: "_CNT2
+6 SET XUDUN(6)="Total Number of NPI duplicates cleaned up: "_CNT3
+7 SET XUDUN(7)="Total Number of NPI duplicates that failed in cleanup: "_CNT4
SET XUDUN(8)=""
+8 IF CNT4>0
Begin DoDot:1
+9 SET XUDUN(9)=" NPI ^ DUZ1 ^ DUZ2"
+10 NEW IEN,JJ
SET JJ=10
SET IEN=0
FOR
SET IEN=$ORDER(ISSUE(IEN))
if IEN=""
QUIT
SET XUDUN(JJ)=ISSUE(IEN)
SET JJ=JJ+1
End DoDot:1
+11 SET XMSUB="NPI Cleanup - XU*8*732 -SITE: "_$PIECE($$SITE^VASITE,"^",3)
+12 SET XMTEXT="XUDUN("
SET XMDUZ=.5
SET XMY(DUZ)=""
+13 SET XMY("Christine.Chesney@domain.ext")=""
+14 SET XMY("John.Williams30ec0c@domain.ext")=""
+15 DO ^XMD
+16 QUIT