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

XUP732.m

Go to the documentation of this file.
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