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

SD53A204.m

Go to the documentation of this file.
SD53A204 ;ALB/JAM;Part of post-install routine for patch 204;12/1/99@1105
 ;;5.3;Scheduling;**204,1015**;DEC 01, 1999;Build 21
 ;This post-install will check file 404.52 for invalid .03 field entries
 ;and save to a mail message.
 ;
POST ;Post-init
 N XSCSTOP
 S XSCSTOP=""
 D PROGCHK(.XSCSTOP)
 I XSCSTOP Q
 D MES^XPDUTL(" ")
 D MES^XPDUTL("This installation will generate an e-mail message with")
 D MES^XPDUTL("a list of invalid PRACTITIONER pointers (field #.03)")
 D MES^XPDUTL("from file POSITION ASSIGMENT HISTORY FILE (#404.52)")
 D MES^XPDUTL($$Q(DUZ))
 Q
        ;
PR40452 ;Process file 404.52 for invalid entries in field .03 and 
 ;create message text for mail message
 ;
 N XMY,XMDUZ,XMSUB,XMTEXT,FND
 K ^TMP("PCMM PRACTITIONER",$J),^TMP("SCMSG",$J)
 ;get list of invalid .03 field entries from file 404.52
 S FND=$$LST^SCMCCV5()
 D MAIL
 S XMDUZ=.5,XMY(XMDUZ)=""
 I $G(SCDUZ) S XMY(SCDUZ)=""
 S XMSUB="PCMM PRACTITIONER INCONSISTENCY REPORT"
 S XMTEXT="^TMP(""SCMSG"",$J,"
 D ^XMD
 K ^TMP("PCMM PRACTITIONER",$J),^TMP("SCMSG",$J)
 Q
 ;
MAIL ; Queue report as a MailMan Message.
 N NUM,TXT,I,SCDAT,SCDT,SCTP,SCSTA,SCPRAC,CNT,BL,X,Y
 S NUM=0,$P(BL," ",20)="",CNT=1
 D SET("This message was automatically generated by PCMM patch SD*5.3*204")
 D SET(" ")
 D SET("      INVALID PRACTITIONER POINTERS IN FILE 404.52 REPORT")
 D SET(" ")
 D SET(" ")
 I 'FND D SET("No inconsistencies found.") Q
 D SET("                              EFFECTIVE")
 D SET("IEN #   TEAM POSITION           DATE          PRACT.     STATUS")
 D SET("---------------------------------------------------------------")
 F I=1:1 S NUM=$O(^TMP("PCMM PRACTITIONER",$J,NUM)) Q:'NUM  D
 . S SCDAT=$G(^SCTM(404.52,NUM,0)),Y=$P(SCDAT,U,2) X ^DD("DD") S SCDT=Y
 . S X=$P(SCDAT,U),SCTP=$P($G(^SCTM(404.57,X,0)),U)
 . S SCSTA=$S($P(SCDAT,U,4):"Active",1:"Inactive"),SCPRAC=$P(SCDAT,U,3)
 . S TXT=$E(NUM_BL,1,7)_$E(SCTP_BL,1,21)_" "_$E(SCDT_BL,1,15)
 . S TXT=TXT_"  "_$E(SCPRAC_BL,1,9)_SCSTA
 . D SET(TXT)
 D SET(" ")
 D SET("Total entries found = "_(I-1))
 Q
 ;
SET(TXT) ;Build message array
 S ^TMP("SCMSG",$J,CNT)=TXT
 S CNT=CNT+1
 Q
 ;
PROGCHK(XSCSTOP) ;checks for necessary programmer variables
 ;
 I '$G(DUZ)!($G(DUZ(0))'="@")!('$G(DT))!($G(U)'="^") D
 . D BMES^XPDUTL("*****")
 . D MES^XPDUTL("Your programming variables are not set up properly.")
 . D MES^XPDUTL("Installation aborted.")
 . D MES^XPDUTL("*****")
 . S XSCSTOP=1
 Q
 ;
Q(SCDUZ) ; run job in background
 ; input  = user duz 
 ; output = task #, report via mailman
 N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSAVE
 S ZTRTN="PR40452^SD53A204"
 S ZTDESC="PCMM PRACTITIONER INCONSISTENCY REPORT"
 S ZTDTH=$H
 S ZTIO=""
 S ZTSAVE("SCDUZ")=""
 D ^%ZTLOAD
 Q $S(+ZTSK:": Queued - Task# "_ZTSK,1:": Not Queued!")
 ;