SCUTBK10 ;ALB/SCK - Scheduling Broker Utilities ; 04 Sep 2002 12:53 PM
;;5.3;Scheduling;**41,264,297,1015**;AUG 13, 1993;Build 21
;
Q
;
PARSE(SC) ;
S SCFILE=$G(SC("FILE"))
S SCIEN=$G(SC("IEN"))
S SCVAL=$G(SC("VALUE"))
S SCSTATUS=$G(SC("STATUS"))
S SCSUBJ=$G(SC("SUBJ"),"PCMM NOTIFICATION")
S SCDATE=$G(SC("DATE"))
S SCADR=$G(SC("ADDRESS"))
S SCHIEN=$G(SC("HIEN"))
Q
;
PTASGMM(SCOK,SC) ; Send MailMan message on single patient assignment to either
; a team or a position.
;
; Input: SC = BT^404.42 Ien Sets before action for team assign.
; SC = AT^404.42 Ien Sets after action for team assign.
; SC = BP^404.43 Ien Sets before action for position assign
; SC = BA^404.43 Ien Sets after action for position assign
;
N SCACT,SCIEN
;
D CHK^SCUTBK
D TMP^SCUTBK
;
S SCOK=0
S SCACT=$P($G(SC),U,1)
S SCIEN=$P($G(SC),U,2)
G:SCACT="" PTASGNQ
G:SCIEN="" PTASGNQ
;
D @SCACT
S SCOK=1
PTASGNQ Q
;
BT ;
D BEFORETM^SCMCDD1(SCIEN)
Q
AT ;
D AFTERTM^SCMCDD1(SCIEN)
Q
BP ;
D BEFORETP^SCMCDD1(SCIEN)
Q
AP ;
D AFTERTP^SCMCDD1(SCIEN)
Q
;
MAILC(SCOK,SC) ; call to invoke broker to send a mailman message from the
; client
;
N SCSUBJ,SCTEXT
;
D CHK^SCUTBK
D TMP^SCUTBK
;
S SCOK=0
S SCSUBJ=$G(SC("SUBJ"),"PCMM NOTIFICATION")
S SCADR=$G(SC("ADDRESS"))
;
S XMDUZ=DUZ
S XMSUB=SCSUBJ
D XMZ^XMA2
G:XMZ<1 MAILQ
;
D BLDTEXT(.SC,.SCTEXT)
S XMTEXT="SCTEXT("
;
I $P(SCADR,U,2)="TEST" D
. S XMY("G.PCM MESSAGING@DEVFEX.ISC-ALBANY.VA.GOV")=""
;
I $P(SCADR,U,2)="S" D
. S XMY($P(SCADR,U,1))=""
;
I $D(XMY)>0 D
. D ^XMD
. S SCOK=XMZ
MAILQ Q
;
BLDTEXT(SCVAL,SCTXT) ; Build the message text array from the client
;
N SCLINE,CNT
S SCLINE=""
F S SCLINE=$O(SCVAL(SCLINE)) Q:+SCLINE=0 D
. S SCTXT(SCLINE)=SCVAL(SCLINE)
Q
;
NEWHIST(SCOK,SC) ; Call to invoke the broker to determine whether the date for
; the history entry being added is valid.
;
N SCFILE,SCIEN,SCDATE,SCSTATUS,SCVAL,SCERMSG
D CHK^SCUTBK
D TMP^SCUTBK
;
S SCOK=0
D PARSE(.SC)
;
S SCOK=$$NEWHIST^SCMCDD(SCFILE,SCIEN,SCDATE,"SCERMSG",SCSTATUS)
NEWDTQ Q
;
NEWSTC(SCOK,SC) ; Call to invoke the broker to determine whether the status
; entry for the current entry is valid.
;
N SCFILE,SCIEN,SCDATE,SCSTATUS,SCVAL,SCERMSG
D CHK^SCUTBK
D TMP^SCUTBK
;
S SCOK=0
D PARSE(.SC)
;
S SCOK=$$NEWHIST^SCMCDD(SCFILE,SCIEN,SCDATE,"SCERMSG",SCSTATUS)
NEWSTQ Q
;
DELDTC(SCOK,SC) ; Call to invoke the broker to see if the history entry can
; be deleted.
;
N SCFILE,SCHIEN,SCERMSG
D CHK^SCUTBK
D TMP^SCUTBK
;
S SCOK=0
D PARSE(.SC)
;
S SCOK=$$OKDEL^SCMCDD(SCFILE,SCHIEN,"SCERMSG")
DELDTQ Q
;
INACTC(SCOK,SC) ; Call to invoke the broker to see if the history entry can
; be inactivated.
;
N SCFILE,SCIEN,SCDATE
D CHK^SCUTBK
D TMP^SCUTBK
;
S SCOK=0
D PARSE(.SC)
;
S SCOK=$$OKINACT^SCMCDD(SCFILE,SCIEN,SCDATE,"SCERMSG")
INACTQ Q
;
CHGDTC(SCOK,SC) ; Call to see if the date change for the history entry is
; valid.
;
N SCFILE,SCIEN,SCDATE,SCERMSG
D CHK^SCUTBK
D TMP^SCUTBK
;
S SCOK=0
D PARSE(.SC)
;
S SCOK=$$OKCHGDT^SCMCDD(SCFILE,SCHIEN,SCDATE,"SCERMSG")
CHGDTQ Q
;
MNTEST(SCOK,SC) ;
D CHK^SCUTBK
D TMP^SCUTBK
S DFN=+SC
S SCOK=$$LST^DGMTU(DFN),$P(SCOK,U,10)=$$ONWAIT^SCMCWAIT(DFN),$P(SCOK,U,11)=$$SC^SCMCWAIT(SC)
S $P(SCOK,U,12)=$$IU^SCMCTSK1(DFN)
Q
;
SCUTBK10 ;ALB/SCK - Scheduling Broker Utilities ; 04 Sep 2002 12:53 PM
+1 ;;5.3;Scheduling;**41,264,297,1015**;AUG 13, 1993;Build 21
+2 ;
+3 QUIT
+4 ;
PARSE(SC) ;
+1 SET SCFILE=$GET(SC("FILE"))
+2 SET SCIEN=$GET(SC("IEN"))
+3 SET SCVAL=$GET(SC("VALUE"))
+4 SET SCSTATUS=$GET(SC("STATUS"))
+5 SET SCSUBJ=$GET(SC("SUBJ"),"PCMM NOTIFICATION")
+6 SET SCDATE=$GET(SC("DATE"))
+7 SET SCADR=$GET(SC("ADDRESS"))
+8 SET SCHIEN=$GET(SC("HIEN"))
+9 QUIT
+10 ;
PTASGMM(SCOK,SC) ; Send MailMan message on single patient assignment to either
+1 ; a team or a position.
+2 ;
+3 ; Input: SC = BT^404.42 Ien Sets before action for team assign.
+4 ; SC = AT^404.42 Ien Sets after action for team assign.
+5 ; SC = BP^404.43 Ien Sets before action for position assign
+6 ; SC = BA^404.43 Ien Sets after action for position assign
+7 ;
+8 NEW SCACT,SCIEN
+9 ;
+10 DO CHK^SCUTBK
+11 DO TMP^SCUTBK
+12 ;
+13 SET SCOK=0
+14 SET SCACT=$PIECE($GET(SC),U,1)
+15 SET SCIEN=$PIECE($GET(SC),U,2)
+16 IF SCACT=""
GOTO PTASGNQ
+17 IF SCIEN=""
GOTO PTASGNQ
+18 ;
+19 DO @SCACT
+20 SET SCOK=1
PTASGNQ QUIT
+1 ;
BT ;
+1 DO BEFORETM^SCMCDD1(SCIEN)
+2 QUIT
AT ;
+1 DO AFTERTM^SCMCDD1(SCIEN)
+2 QUIT
BP ;
+1 DO BEFORETP^SCMCDD1(SCIEN)
+2 QUIT
AP ;
+1 DO AFTERTP^SCMCDD1(SCIEN)
+2 QUIT
+3 ;
MAILC(SCOK,SC) ; call to invoke broker to send a mailman message from the
+1 ; client
+2 ;
+3 NEW SCSUBJ,SCTEXT
+4 ;
+5 DO CHK^SCUTBK
+6 DO TMP^SCUTBK
+7 ;
+8 SET SCOK=0
+9 SET SCSUBJ=$GET(SC("SUBJ"),"PCMM NOTIFICATION")
+10 SET SCADR=$GET(SC("ADDRESS"))
+11 ;
+12 SET XMDUZ=DUZ
+13 SET XMSUB=SCSUBJ
+14 DO XMZ^XMA2
+15 IF XMZ<1
GOTO MAILQ
+16 ;
+17 DO BLDTEXT(.SC,.SCTEXT)
+18 SET XMTEXT="SCTEXT("
+19 ;
+20 IF $PIECE(SCADR,U,2)="TEST"
Begin DoDot:1
+21 SET XMY("G.PCM MESSAGING@DEVFEX.ISC-ALBANY.VA.GOV")=""
End DoDot:1
+22 ;
+23 IF $PIECE(SCADR,U,2)="S"
Begin DoDot:1
+24 SET XMY($PIECE(SCADR,U,1))=""
End DoDot:1
+25 ;
+26 IF $DATA(XMY)>0
Begin DoDot:1
+27 DO ^XMD
+28 SET SCOK=XMZ
End DoDot:1
MAILQ QUIT
+1 ;
BLDTEXT(SCVAL,SCTXT) ; Build the message text array from the client
+1 ;
+2 NEW SCLINE,CNT
+3 SET SCLINE=""
+4 FOR
SET SCLINE=$ORDER(SCVAL(SCLINE))
IF +SCLINE=0
QUIT
Begin DoDot:1
+5 SET SCTXT(SCLINE)=SCVAL(SCLINE)
End DoDot:1
+6 QUIT
+7 ;
NEWHIST(SCOK,SC) ; Call to invoke the broker to determine whether the date for
+1 ; the history entry being added is valid.
+2 ;
+3 NEW SCFILE,SCIEN,SCDATE,SCSTATUS,SCVAL,SCERMSG
+4 DO CHK^SCUTBK
+5 DO TMP^SCUTBK
+6 ;
+7 SET SCOK=0
+8 DO PARSE(.SC)
+9 ;
+10 SET SCOK=$$NEWHIST^SCMCDD(SCFILE,SCIEN,SCDATE,"SCERMSG",SCSTATUS)
NEWDTQ QUIT
+1 ;
NEWSTC(SCOK,SC) ; Call to invoke the broker to determine whether the status
+1 ; entry for the current entry is valid.
+2 ;
+3 NEW SCFILE,SCIEN,SCDATE,SCSTATUS,SCVAL,SCERMSG
+4 DO CHK^SCUTBK
+5 DO TMP^SCUTBK
+6 ;
+7 SET SCOK=0
+8 DO PARSE(.SC)
+9 ;
+10 SET SCOK=$$NEWHIST^SCMCDD(SCFILE,SCIEN,SCDATE,"SCERMSG",SCSTATUS)
NEWSTQ QUIT
+1 ;
DELDTC(SCOK,SC) ; Call to invoke the broker to see if the history entry can
+1 ; be deleted.
+2 ;
+3 NEW SCFILE,SCHIEN,SCERMSG
+4 DO CHK^SCUTBK
+5 DO TMP^SCUTBK
+6 ;
+7 SET SCOK=0
+8 DO PARSE(.SC)
+9 ;
+10 SET SCOK=$$OKDEL^SCMCDD(SCFILE,SCHIEN,"SCERMSG")
DELDTQ QUIT
+1 ;
INACTC(SCOK,SC) ; Call to invoke the broker to see if the history entry can
+1 ; be inactivated.
+2 ;
+3 NEW SCFILE,SCIEN,SCDATE
+4 DO CHK^SCUTBK
+5 DO TMP^SCUTBK
+6 ;
+7 SET SCOK=0
+8 DO PARSE(.SC)
+9 ;
+10 SET SCOK=$$OKINACT^SCMCDD(SCFILE,SCIEN,SCDATE,"SCERMSG")
INACTQ QUIT
+1 ;
CHGDTC(SCOK,SC) ; Call to see if the date change for the history entry is
+1 ; valid.
+2 ;
+3 NEW SCFILE,SCIEN,SCDATE,SCERMSG
+4 DO CHK^SCUTBK
+5 DO TMP^SCUTBK
+6 ;
+7 SET SCOK=0
+8 DO PARSE(.SC)
+9 ;
+10 SET SCOK=$$OKCHGDT^SCMCDD(SCFILE,SCHIEN,SCDATE,"SCERMSG")
CHGDTQ QUIT
+1 ;
MNTEST(SCOK,SC) ;
+1 DO CHK^SCUTBK
+2 DO TMP^SCUTBK
+3 SET DFN=+SC
+4 SET SCOK=$$LST^DGMTU(DFN)
SET $PIECE(SCOK,U,10)=$$ONWAIT^SCMCWAIT(DFN)
SET $PIECE(SCOK,U,11)=$$SC^SCMCWAIT(SC)
+5 SET $PIECE(SCOK,U,12)=$$IU^SCMCTSK1(DFN)
+6 QUIT
+7 ;