[613] | 1 | SCUTBK10 ;ALB/SCK - Scheduling Broker Utilities ; 04 Sep 2002 12:53 PM
|
---|
| 2 | ;;5.3;Scheduling;**41,264,297**;AUG 13, 1993
|
---|
| 3 | ;
|
---|
| 4 | Q
|
---|
| 5 | ;
|
---|
| 6 | PARSE(SC) ;
|
---|
| 7 | S SCFILE=$G(SC("FILE"))
|
---|
| 8 | S SCIEN=$G(SC("IEN"))
|
---|
| 9 | S SCVAL=$G(SC("VALUE"))
|
---|
| 10 | S SCSTATUS=$G(SC("STATUS"))
|
---|
| 11 | S SCSUBJ=$G(SC("SUBJ"),"PCMM NOTIFICATION")
|
---|
| 12 | S SCDATE=$G(SC("DATE"))
|
---|
| 13 | S SCADR=$G(SC("ADDRESS"))
|
---|
| 14 | S SCHIEN=$G(SC("HIEN"))
|
---|
| 15 | Q
|
---|
| 16 | ;
|
---|
| 17 | PTASGMM(SCOK,SC) ; Send MailMan message on single patient assignment to either
|
---|
| 18 | ; a team or a position.
|
---|
| 19 | ;
|
---|
| 20 | ; Input: SC = BT^404.42 Ien Sets before action for team assign.
|
---|
| 21 | ; SC = AT^404.42 Ien Sets after action for team assign.
|
---|
| 22 | ; SC = BP^404.43 Ien Sets before action for position assign
|
---|
| 23 | ; SC = BA^404.43 Ien Sets after action for position assign
|
---|
| 24 | ;
|
---|
| 25 | N SCACT,SCIEN
|
---|
| 26 | ;
|
---|
| 27 | D CHK^SCUTBK
|
---|
| 28 | D TMP^SCUTBK
|
---|
| 29 | ;
|
---|
| 30 | S SCOK=0
|
---|
| 31 | S SCACT=$P($G(SC),U,1)
|
---|
| 32 | S SCIEN=$P($G(SC),U,2)
|
---|
| 33 | G:SCACT="" PTASGNQ
|
---|
| 34 | G:SCIEN="" PTASGNQ
|
---|
| 35 | ;
|
---|
| 36 | D @SCACT
|
---|
| 37 | S SCOK=1
|
---|
| 38 | PTASGNQ Q
|
---|
| 39 | ;
|
---|
| 40 | BT ;
|
---|
| 41 | D BEFORETM^SCMCDD1(SCIEN)
|
---|
| 42 | Q
|
---|
| 43 | AT ;
|
---|
| 44 | D AFTERTM^SCMCDD1(SCIEN)
|
---|
| 45 | Q
|
---|
| 46 | BP ;
|
---|
| 47 | D BEFORETP^SCMCDD1(SCIEN)
|
---|
| 48 | Q
|
---|
| 49 | AP ;
|
---|
| 50 | D AFTERTP^SCMCDD1(SCIEN)
|
---|
| 51 | Q
|
---|
| 52 | ;
|
---|
| 53 | MAILC(SCOK,SC) ; call to invoke broker to send a mailman message from the
|
---|
| 54 | ; client
|
---|
| 55 | ;
|
---|
| 56 | N SCSUBJ,SCTEXT
|
---|
| 57 | ;
|
---|
| 58 | D CHK^SCUTBK
|
---|
| 59 | D TMP^SCUTBK
|
---|
| 60 | ;
|
---|
| 61 | S SCOK=0
|
---|
| 62 | S SCSUBJ=$G(SC("SUBJ"),"PCMM NOTIFICATION")
|
---|
| 63 | S SCADR=$G(SC("ADDRESS"))
|
---|
| 64 | ;
|
---|
| 65 | S XMDUZ=DUZ
|
---|
| 66 | S XMSUB=SCSUBJ
|
---|
| 67 | D XMZ^XMA2
|
---|
| 68 | G:XMZ<1 MAILQ
|
---|
| 69 | ;
|
---|
| 70 | D BLDTEXT(.SC,.SCTEXT)
|
---|
| 71 | S XMTEXT="SCTEXT("
|
---|
| 72 | ;
|
---|
| 73 | I $P(SCADR,U,2)="TEST" D
|
---|
| 74 | . S XMY("G.PCM MESSAGING@DEVFEX.ISC-ALBANY.VA.GOV")=""
|
---|
| 75 | ;
|
---|
| 76 | I $P(SCADR,U,2)="S" D
|
---|
| 77 | . S XMY($P(SCADR,U,1))=""
|
---|
| 78 | ;
|
---|
| 79 | I $D(XMY)>0 D
|
---|
| 80 | . D ^XMD
|
---|
| 81 | . S SCOK=XMZ
|
---|
| 82 | MAILQ Q
|
---|
| 83 | ;
|
---|
| 84 | BLDTEXT(SCVAL,SCTXT) ; Build the message text array from the client
|
---|
| 85 | ;
|
---|
| 86 | N SCLINE,CNT
|
---|
| 87 | S SCLINE=""
|
---|
| 88 | F S SCLINE=$O(SCVAL(SCLINE)) Q:+SCLINE=0 D
|
---|
| 89 | . S SCTXT(SCLINE)=SCVAL(SCLINE)
|
---|
| 90 | Q
|
---|
| 91 | ;
|
---|
| 92 | NEWHIST(SCOK,SC) ; Call to invoke the broker to determine whether the date for
|
---|
| 93 | ; the history entry being added is valid.
|
---|
| 94 | ;
|
---|
| 95 | N SCFILE,SCIEN,SCDATE,SCSTATUS,SCVAL,SCERMSG
|
---|
| 96 | D CHK^SCUTBK
|
---|
| 97 | D TMP^SCUTBK
|
---|
| 98 | ;
|
---|
| 99 | S SCOK=0
|
---|
| 100 | D PARSE(.SC)
|
---|
| 101 | ;
|
---|
| 102 | S SCOK=$$NEWHIST^SCMCDD(SCFILE,SCIEN,SCDATE,"SCERMSG",SCSTATUS)
|
---|
| 103 | NEWDTQ Q
|
---|
| 104 | ;
|
---|
| 105 | NEWSTC(SCOK,SC) ; Call to invoke the broker to determine whether the status
|
---|
| 106 | ; entry for the current entry is valid.
|
---|
| 107 | ;
|
---|
| 108 | N SCFILE,SCIEN,SCDATE,SCSTATUS,SCVAL,SCERMSG
|
---|
| 109 | D CHK^SCUTBK
|
---|
| 110 | D TMP^SCUTBK
|
---|
| 111 | ;
|
---|
| 112 | S SCOK=0
|
---|
| 113 | D PARSE(.SC)
|
---|
| 114 | ;
|
---|
| 115 | S SCOK=$$NEWHIST^SCMCDD(SCFILE,SCIEN,SCDATE,"SCERMSG",SCSTATUS)
|
---|
| 116 | NEWSTQ Q
|
---|
| 117 | ;
|
---|
| 118 | DELDTC(SCOK,SC) ; Call to invoke the broker to see if the history entry can
|
---|
| 119 | ; be deleted.
|
---|
| 120 | ;
|
---|
| 121 | N SCFILE,SCHIEN,SCERMSG
|
---|
| 122 | D CHK^SCUTBK
|
---|
| 123 | D TMP^SCUTBK
|
---|
| 124 | ;
|
---|
| 125 | S SCOK=0
|
---|
| 126 | D PARSE(.SC)
|
---|
| 127 | ;
|
---|
| 128 | S SCOK=$$OKDEL^SCMCDD(SCFILE,SCHIEN,"SCERMSG")
|
---|
| 129 | DELDTQ Q
|
---|
| 130 | ;
|
---|
| 131 | INACTC(SCOK,SC) ; Call to invoke the broker to see if the history entry can
|
---|
| 132 | ; be inactivated.
|
---|
| 133 | ;
|
---|
| 134 | N SCFILE,SCIEN,SCDATE
|
---|
| 135 | D CHK^SCUTBK
|
---|
| 136 | D TMP^SCUTBK
|
---|
| 137 | ;
|
---|
| 138 | S SCOK=0
|
---|
| 139 | D PARSE(.SC)
|
---|
| 140 | ;
|
---|
| 141 | S SCOK=$$OKINACT^SCMCDD(SCFILE,SCIEN,SCDATE,"SCERMSG")
|
---|
| 142 | INACTQ Q
|
---|
| 143 | ;
|
---|
| 144 | CHGDTC(SCOK,SC) ; Call to see if the date change for the history entry is
|
---|
| 145 | ; valid.
|
---|
| 146 | ;
|
---|
| 147 | N SCFILE,SCIEN,SCDATE,SCERMSG
|
---|
| 148 | D CHK^SCUTBK
|
---|
| 149 | D TMP^SCUTBK
|
---|
| 150 | ;
|
---|
| 151 | S SCOK=0
|
---|
| 152 | D PARSE(.SC)
|
---|
| 153 | ;
|
---|
| 154 | S SCOK=$$OKCHGDT^SCMCDD(SCFILE,SCHIEN,SCDATE,"SCERMSG")
|
---|
| 155 | CHGDTQ Q
|
---|
| 156 | ;
|
---|
| 157 | MNTEST(SCOK,SC) ;
|
---|
| 158 | D CHK^SCUTBK
|
---|
| 159 | D TMP^SCUTBK
|
---|
| 160 | S DFN=+SC
|
---|
| 161 | S SCOK=$$LST^DGMTU(DFN),$P(SCOK,U,10)=$$ONWAIT^SCMCWAIT(DFN),$P(SCOK,U,11)=$$SC^SCMCWAIT(SC)
|
---|
| 162 | S $P(SCOK,U,12)=$$IU^SCMCTSK1(DFN)
|
---|
| 163 | Q
|
---|
| 164 | ;
|
---|