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

DG967PST.m

Go to the documentation of this file.
  1. DG967PST ;BIR/CML-PATCH DG*5.3*967 POST INSTALLATION ROUTINE ;8/14/18
  1. ;;5.3;Registration;**967**;Aug 13, 1993;Build 3
  1. ;
  1. ; - Story 783361 (cml) DG*5.3*967
  1. ; This post-init will loop thru the DG SECURITY LOG FILE (#38.1) and identify entries that are marked as "sensitive".
  1. ; The job will be scheduled to run after 10:00pm local time.
  1. ; Any records that are found will trigger an A31 message to the MPI.
  1. ; When the job is complete it will send an email with stats to:
  1. ; - (locally) POSTMASTER and the person who installed the patch (DUZ)
  1. ; - (MPI Outlook) Christine.Chesney@domain.ext, Link.Christine@domain.ext and John.Williams30ec0c@domain.ext.
  1. ;
  1. ; - Story 827326 (cml) DG*5.3*967
  1. ; This post-init will loop thru the Patient file (#2) and look for any records with the ZIP+4 field (#.1112) that contains a "-".
  1. ; The job will be scheduled to run after 10:00pm local time.
  1. ; Any records that are found will strip out the dash and reset the field which will put the edit in the ADT/HL7 PIVOT file (#391.71)
  1. ; When the job is complete it will send an email with stats to:
  1. ; - (locally) POSTMASTER and the person who installed the patch (DUZ)
  1. ; - (MPI Outlook) Christine.Chesney@domain.ext, Link.Christine@domain.ext and John.Williams30ec0c@domain.ext.
  1. ;
  1. POST ;queue off post-init to identify patients marked as "sensitive" and trigger A31 to MPI and clean up ZIP+4 records
  1. N DGI,DGFLDS
  1. D BMES^XPDUTL("Post-Install for Sensitivity Seeding/ZIP+4 Cleanup:") ;,MES^XPDUTL("")
  1. I $$PATCH^XPDUTL("DG*5.3*967") D BMES^XPDUTL("Post-Install for Sensitivity Seeding/ZIP+4 previously run.") Q
  1. D QUE ;Task off seeding job of sensitivity updates to MPI and ZIP+4 cleanup
  1. D BMES^XPDUTL("Post-Install for Sensitivity Seeding/ZIP4 Queued.")
  1. Q
  1. ;
  1. QUE ; Queue off seeding job of sensitivity updates to MPI and ZIP+4 cleanup to run after 10:00pm
  1. D BMES^XPDUTL(" Queuing job to seed sensitivity updates to MPI/ZIP+4 cleanup after 10:00pm.")
  1. N DAY,DONE,QQ,TIME,ZTIO,ZTSK,ZTRTN,ZTDESC,ZTSAVE,ZTDTH,Y
  1. S ZTIO="",ZTRTN="SECLOOP^DG967PST"
  1. ;schedule job after 10:00pm
  1. K SCH S QQ=$$NOW^XLFDT,DAY=$P(QQ,"."),TIME=$P(QQ,".",2)
  1. I TIME<"215900" S SCH=DAY_".2205"
  1. I TIME>"220000" S SCH=$$NOW^XLFDT
  1. S ZTDTH=SCH
  1. S ZTDESC="DG*5.3*967 post-install seeding sensitivity updates and ZIP+4 cleanup."
  1. D ^%ZTLOAD
  1. I '$G(ZTSK) D MES^XPDUTL(" **** Queuing job failed!!!") Q
  1. D MES^XPDUTL(" Job number #"_ZTSK_" was queued.")
  1. Q
  1. ;
  1. SECLOOP ; entry point for queued job to loop on DG SECURITY LOG FILE
  1. N DFNCNT,DFN,ICN,SENSI,A31CNT,START,TRY,DONE
  1. S START=$$FMTE^XLFDT($$NOW^XLFDT)
  1. S (DFNCNT,DFN,A31CNT)=0
  1. F S DFN=$O(^DGSL(38.1,DFN)) Q:'DFN S DFNCNT=DFNCNT+1 D
  1. .I $D(^DPT(DFN,-9)) Q
  1. .S SENSI=$P(^DGSL(38.1,DFN,0),"^",2) I SENSI D
  1. ..S ICN=$P($G(^DPT(DFN,"MPI")),"^") I ICN S A31CNT=A31CNT+1 S TRY=$$A31^MPIFA31B(DFN)
  1. ;
  1. S DONE=$$FMTE^XLFDT($$NOW^XLFDT)
  1. ;
  1. EMAILS1 ; Send email to person who ran the INIT, letting them know results
  1. N XMDUZ,XMTEXT,XMSUB,XMY,XMZ,XMDUN,X,R
  1. S R(1)="Seeding of patients marked as Sensitive:"
  1. S R(2)=" "
  1. S R(3)="Process started: "_START
  1. S R(4)="Process completed: "_DONE
  1. S R(5)="Total number of patients processed : "_DFNCNT
  1. S R(6)="Total number of A31 messages triggered to MPI: "_A31CNT
  1. S XMTEXT="R(",XMSUB="Result of running patch DG*5.3*967 (Sensitivity Seeding)"
  1. S XMDUZ=.5
  1. S XMY(DUZ)=""
  1. D ^XMD
  1. ;
  1. ; Send message to MPI developers on Outlook
  1. ; IA#4440 supported call to check for test or production account
  1. I $$PROD^XUPROD()=0 G ZIP4LOOP ;not a production account. Don't send email to MPI dev
  1. ;
  1. N DGSNAME,DGSITE,XMDUZ,XMTEXT,XMSUB,XMY,XMZ,XMDUN,R
  1. S X=$$SITE^VASITE()
  1. S DGSNAME=$P(X,"^",2),DGSITE=$P(X,"^",3)
  1. S R(1)="Post-Init routine ^DG967PST run at station: "_DGSITE_" - "_DGSNAME
  1. S R(2)=" "
  1. S R(3)="Seeding of patients marked as Sensitive:"
  1. S R(4)="Process Started: "_START_" - Completed: "_DONE
  1. S R(5)=" "
  1. S R(6)="Total number of patients processed: "_DFNCNT_" "
  1. S R(7)="Total number of A31 messages triggered to MPI: "_A31CNT
  1. S XMTEXT="R(",XMSUB="Result of running patch DG*5.3*967 (Sensitivity) at station: "_DGSITE
  1. S XMDUZ=DUZ
  1. S XMY("Christine.Chesney@domain.ext")=""
  1. S XMY("John.Williams30ec0c@domain.ext")=""
  1. S XMY("Christine.Link@domain.ext")=""
  1. D ^XMD
  1. ;
  1. ZIP4LOOP ; start cleanup of ZIP+4 records
  1. N DFNCNT,DFN,NODE,ZIP4,EDZIP,EDCNT,START,DONE
  1. S START=$$FMTE^XLFDT($$NOW^XLFDT)
  1. S (DFNCNT,DFN,EDCNT)=0
  1. F S DFN=$O(^DPT(DFN)) Q:'DFN S DFNCNT=DFNCNT+1 D
  1. .I $D(^DPT(DFN,-9)) Q
  1. .S NODE=$G(^DPT(DFN,.11)),ZIP4=$P(NODE,"^",12) I ZIP4["-" S EDCNT=EDCNT+1 D
  1. ..S EDZIP=$P(ZIP4,"-")_$P(ZIP4,"-",2) S X=EDZIP,DIE="^DPT(",DA=DFN,DR=".1112///^S X=EDZIP" D ^DIE K DIE,DA,DR
  1. ;
  1. S DONE=$$FMTE^XLFDT($$NOW^XLFDT)
  1. ;
  1. EMAILS2 ; Send email to person who ran the INIT, letting them know results
  1. N XMDUZ,XMTEXT,XMSUB,XMY,XMZ,XMDUN,X,R
  1. S R(1)="Cleanup of Patient file records having ZIP+4 field (#.1112) with dashes:"
  1. S R(2)=" "
  1. S R(3)="Process started: "_START
  1. S R(4)="Process completed: "_DONE
  1. S R(5)="Total number of patients processed : "_DFNCNT
  1. S R(6)="Total number of ZIP+4 records edited: "_EDCNT
  1. S R(7)=" ",R(8)="You can now delete the post-init routine ^DG967PST."
  1. S XMTEXT="R(",XMSUB="Result of running patch DG*5.3*967 (ZIP+4 cleanup)"
  1. S XMDUZ=.5
  1. S XMY(DUZ)=""
  1. D ^XMD
  1. ;
  1. ; Send message to MPI developers on Outlook
  1. ; IA#4440 supported call to check for test or production account
  1. Q:$$PROD^XUPROD()=0 ;not a production account. Don't send email to MPI dev
  1. ;
  1. N DGSNAME,DGSITE,XMDUZ,XMTEXT,XMSUB,XMY,XMZ,XMDUN,R
  1. S X=$$SITE^VASITE()
  1. S DGSNAME=$P(X,"^",2),DGSITE=$P(X,"^",3)
  1. S R(1)="Post-Init routine ^DG967PST run at station: "_DGSITE_" - "_DGSNAME
  1. S R(2)=" "
  1. S R(3)="Cleanup of Patient file records having ZIP+4 field (#.1112) with dashes:"
  1. S R(4)="Process Started: "_START_" - Completed: "_DONE
  1. S R(5)=" "
  1. S R(6)="Total number of patients processed: "_DFNCNT_" "
  1. S R(7)="Total number of ZIP+4 records edited: "_EDCNT
  1. S XMTEXT="R(",XMSUB="Result of running patch DG*5.3*967 (ZIP+4) at station: "_DGSITE
  1. S XMDUZ=DUZ
  1. S XMY("Christine.Chesney@domain.ext")=""
  1. S XMY("John.Williams30ec0c@domain.ext")=""
  1. S XMY("Christine.Link@domain.ext")=""
  1. D ^XMD
  1. Q