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