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

DGYPPOST.m

Go to the documentation of this file.
  1. DGYPPOST ;ALB/MLI - Clean-up cross-reference on Annual Means Test file ; 20 JUNE 95
  1. ;;5.3;Registration;**68**;Aug 13, 1993
  1. ;
  1. ; This routine will run through entries in the AD cross-reference on
  1. ; the ANNUAL MEANS TEST file (#408.31) to ensure they are accurate.
  1. ;
  1. EN ; entry point
  1. N I,X
  1. W !! F I=1:1 S X=$P($T(TEXT+I),";;",2) Q:X="QUIT" W !,X
  1. S ZTRTN="DQ^DGYPPOST",ZTIO="",ZTDESC="MT X-REF CLEAN-UP"
  1. D ^%ZTLOAD
  1. I $D(ZTSK) W !,"Task queued: ",ZTSK
  1. E W "...RUNNING IMMEDIATELY" D DQ W !,"Done!"
  1. K ZTDESC,ZTIO,ZTRTN,ZTSK
  1. Q
  1. ;
  1. ;
  1. DQ ; call to begin processing
  1. N DGSTART,COUNT
  1. S DGSTART=$$NOW^XLFDT()
  1. D ADCLN,MAIL
  1. Q
  1. ;
  1. ;
  1. ADCLN N I,J,K,X
  1. S COUNT=0,COUNT(1)=0
  1. I '$D(ZTQUEUED) W !,">>Checking AD cross-reference and killing erroneous entries..."
  1. S I=0 F S I=$O(^DGMT(408.31,"AD",I)) Q:'I D
  1. . F J=0:0 S J=$O(^DGMT(408.31,"AD",I,J)) Q:'J D
  1. . . F K=0:0 S K=$O(^DGMT(408.31,"AD",I,J,K)) Q:'K S DA=+$O(^(K,0)) D
  1. . . . S X=$G(^DGMT(408.31,DA,0))
  1. . . . S COUNT=COUNT+1 I '$D(ZTQUEUED),'(COUNT#250) W "."
  1. . . . I +X'=K!($P(X,"^",19)'=I)!($P(X,"^",2)'=J) S COUNT(1)=COUNT(1)+1 K ^DGMT(408.31,"AD",I,J,K,DA)
  1. I '$D(ZTQUEUED) W !,">>Done...",COUNT(1)," entr",$S(COUNT(1)'=1:"ies",1:"y")," deleted from ""AD"" cross-reference."
  1. Q
  1. ;
  1. ;
  1. MAIL ; generate an e-mail bulletin when done
  1. N DIFROM
  1. S DGCOUNT=0
  1. D LINE("The post-init for patch DG*5.3*68 has run to completion."),LINE("")
  1. D LINE(COUNT(1)_" entr"_$S(COUNT(1)'=1:"ies",1:"y")_" deleted from ""AD"" cross-reference."),LINE("")
  1. D LINE(" Start Time: "_DGSTART)
  1. D LINE(" End Time: "_$$NOW^XLFDT()),LINE("")
  1. D LINE("Please remove routine DGYPPOST from all systems at this time.")
  1. S XMSUB="Patch DG*5.3*68 post-init has completed",XMN=0
  1. S XMTEXT="DGTEXT("
  1. S XMDUZ=.5,XMY(DUZ)=""
  1. D ^XMD
  1. K DGCOUNT,DGTEXT,XMDUZ,XMN,XMSUB,XMTEXT,XMY
  1. Q
  1. ;
  1. ;
  1. LINE(TEXT) ; add text to mail message
  1. S DGCOUNT=DGCOUNT+1,DGTEXT(DGCOUNT)=TEXT
  1. Q
  1. ;
  1. ;
  1. TEXT ; text to display
  1. ;;You will now be asked for a time to queue the cross-reference
  1. ;;clean-up. We recommend you respond NOW as this update can be done
  1. ;;with users on the system. It is being queued in order to make the
  1. ;;initialization finish faster. Once the clean-up has finished, you
  1. ;;will receive an e-mail message.
  1. ;;
  1. ;;Please note, if you exit (^) without answering the 'Requested Start
  1. ;;Time: NOW//' prompt, the cross-reference clean-up will occur
  1. ;;immediately.
  1. ;;
  1. ;;QUIT