source: FOIAVistA/tag/r/SCHEDULING-SD-SC/SD53A204.m@ 794

Last change on this file since 794 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1SD53A204 ;ALB/JAM;Part of post-install routine for patch 204;12/1/99@1105
2 ;;5.3;Scheduling;**204**;DEC 01, 1999
3 ;This post-install will check file 404.52 for invalid .03 field entries
4 ;and save to a mail message.
5 ;
6POST ;Post-init
7 N XSCSTOP
8 S XSCSTOP=""
9 D PROGCHK(.XSCSTOP)
10 I XSCSTOP Q
11 D MES^XPDUTL(" ")
12 D MES^XPDUTL("This installation will generate an e-mail message with")
13 D MES^XPDUTL("a list of invalid PRACTITIONER pointers (field #.03)")
14 D MES^XPDUTL("from file POSITION ASSIGMENT HISTORY FILE (#404.52)")
15 D MES^XPDUTL($$Q(DUZ))
16 Q
17 ;
18PR40452 ;Process file 404.52 for invalid entries in field .03 and
19 ;create message text for mail message
20 ;
21 N XMY,XMDUZ,XMSUB,XMTEXT,FND
22 K ^TMP("PCMM PRACTITIONER",$J),^TMP("SCMSG",$J)
23 ;get list of invalid .03 field entries from file 404.52
24 S FND=$$LST^SCMCCV5()
25 D MAIL
26 S XMDUZ=.5,XMY(XMDUZ)=""
27 I $G(SCDUZ) S XMY(SCDUZ)=""
28 S XMSUB="PCMM PRACTITIONER INCONSISTENCY REPORT"
29 S XMTEXT="^TMP(""SCMSG"",$J,"
30 D ^XMD
31 K ^TMP("PCMM PRACTITIONER",$J),^TMP("SCMSG",$J)
32 Q
33 ;
34MAIL ; Queue report as a MailMan Message.
35 N NUM,TXT,I,SCDAT,SCDT,SCTP,SCSTA,SCPRAC,CNT,BL,X,Y
36 S NUM=0,$P(BL," ",20)="",CNT=1
37 D SET("This message was automatically generated by PCMM patch SD*5.3*204")
38 D SET(" ")
39 D SET(" INVALID PRACTITIONER POINTERS IN FILE 404.52 REPORT")
40 D SET(" ")
41 D SET(" ")
42 I 'FND D SET("No inconsistencies found.") Q
43 D SET(" EFFECTIVE")
44 D SET("IEN # TEAM POSITION DATE PRACT. STATUS")
45 D SET("---------------------------------------------------------------")
46 F I=1:1 S NUM=$O(^TMP("PCMM PRACTITIONER",$J,NUM)) Q:'NUM D
47 . S SCDAT=$G(^SCTM(404.52,NUM,0)),Y=$P(SCDAT,U,2) X ^DD("DD") S SCDT=Y
48 . S X=$P(SCDAT,U),SCTP=$P($G(^SCTM(404.57,X,0)),U)
49 . S SCSTA=$S($P(SCDAT,U,4):"Active",1:"Inactive"),SCPRAC=$P(SCDAT,U,3)
50 . S TXT=$E(NUM_BL,1,7)_$E(SCTP_BL,1,21)_" "_$E(SCDT_BL,1,15)
51 . S TXT=TXT_" "_$E(SCPRAC_BL,1,9)_SCSTA
52 . D SET(TXT)
53 D SET(" ")
54 D SET("Total entries found = "_(I-1))
55 Q
56 ;
57SET(TXT) ;Build message array
58 S ^TMP("SCMSG",$J,CNT)=TXT
59 S CNT=CNT+1
60 Q
61 ;
62PROGCHK(XSCSTOP) ;checks for necessary programmer variables
63 ;
64 I '$G(DUZ)!($G(DUZ(0))'="@")!('$G(DT))!($G(U)'="^") D
65 . D BMES^XPDUTL("*****")
66 . D MES^XPDUTL("Your programming variables are not set up properly.")
67 . D MES^XPDUTL("Installation aborted.")
68 . D MES^XPDUTL("*****")
69 . S XSCSTOP=1
70 Q
71 ;
72Q(SCDUZ) ; run job in background
73 ; input = user duz
74 ; output = task #, report via mailman
75 N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSAVE
76 S ZTRTN="PR40452^SD53A204"
77 S ZTDESC="PCMM PRACTITIONER INCONSISTENCY REPORT"
78 S ZTDTH=$H
79 S ZTIO=""
80 S ZTSAVE("SCDUZ")=""
81 D ^%ZTLOAD
82 Q $S(+ZTSK:": Queued - Task# "_ZTSK,1:": Not Queued!")
83 ;
Note: See TracBrowser for help on using the repository browser.