SCCVLOG2 ;ALB/RMO,TMP - Scheduling Conversion Log Utilities - Bulletin; [ 05/12/95 13:59 PM ]
;;5.3;Scheduling;**211,1015**;Aug 13, 1993;Build 21
;
SEND(SCLOG,SCACT) ;Send conversion bulletin
; Input -- SCLOG CST ien
; SCACT Action
; Output -- None
N C,SCACTD,SCLNE,SCLOG0,SCLOG1,SCLOG2,SCTXT,X,Y
S SCLOG0=$G(^SD(404.98,SCLOG,0)),SCLOG1=$G(^(1)),SCLOG2=$G(^(2))
S Y=$$EXPAND^SCCVDSP2(404.9875,.02,SCACT)
S SCACTD=$E(Y,1)_$$LOW^XLFSTR($E(Y,2,$L(Y)))
S XMSUB="Scheduling Conversion Template #"_SCLOG_" - Event "_SCACTD
S XMDUZ=.5,XMY(DUZ)=""
S XMTEXT="SCTXT(",SCLNE=0
S X="The conversion event has been '"_SCACTD_"'." D SET
S X=" " D SET
S Y=$$EXPAND^SCCVDSP2(404.98,.05,$P(SCLOG0,U,5))
S X=" Conversion Event: "_$E(Y,1)_$$LOW^XLFSTR($E(Y,2,$L(Y))) D SET
S X=" " D SET
S Y=$P(SCLOG0,U,3) D D^DIQ
S X=" Start Date: "_Y D SET
S Y=$P(SCLOG0,U,4) D D^DIQ
S X=" End Date: "_Y D SET
S X=" " D SET
S X=" # encounters - converted: "_+$P(SCLOG1,U,2) D SET
S X=" - not converted: "_+$P(SCLOG2,U,6) D SET
S X=" Total # of errors logged : "_+$P(SCLOG1,U,5) D SET
;
I $O(^SD(404.98,SCLOG,"ERROR",0)) D
. S Y=+$P($G(^SD(404.98,SCLOG,"R",+$$LSTREQ^SCCVLOG(SCLOG),0)),U,7)
. Q:'Y
. S X=" " D SET
. S X=Y_" error"_$S(Y>1:"s were",1:" was")_" encountered during this conversion run." D SET
. S X="For details, review the 'Error Log' in the 'View Template' action." D SET
;
D ^XMD
K XMSUB,XMDUZ,XMTEXT,XMY
Q
;
SET ;Set message text
S SCLNE=SCLNE+1,SCTXT(SCLNE,0)=X
Q
SCCVLOG2 ;ALB/RMO,TMP - Scheduling Conversion Log Utilities - Bulletin; [ 05/12/95 13:59 PM ]
+1 ;;5.3;Scheduling;**211,1015**;Aug 13, 1993;Build 21
+2 ;
SEND(SCLOG,SCACT) ;Send conversion bulletin
+1 ; Input -- SCLOG CST ien
+2 ; SCACT Action
+3 ; Output -- None
+4 NEW C,SCACTD,SCLNE,SCLOG0,SCLOG1,SCLOG2,SCTXT,X,Y
+5 SET SCLOG0=$GET(^SD(404.98,SCLOG,0))
SET SCLOG1=$GET(^(1))
SET SCLOG2=$GET(^(2))
+6 SET Y=$$EXPAND^SCCVDSP2(404.9875,.02,SCACT)
+7 SET SCACTD=$EXTRACT(Y,1)_$$LOW^XLFSTR($EXTRACT(Y,2,$LENGTH(Y)))
+8 SET XMSUB="Scheduling Conversion Template #"_SCLOG_" - Event "_SCACTD
+9 SET XMDUZ=.5
SET XMY(DUZ)=""
+10 SET XMTEXT="SCTXT("
SET SCLNE=0
+11 SET X="The conversion event has been '"_SCACTD_"'."
DO SET
+12 SET X=" "
DO SET
+13 SET Y=$$EXPAND^SCCVDSP2(404.98,.05,$PIECE(SCLOG0,U,5))
+14 SET X=" Conversion Event: "_$EXTRACT(Y,1)_$$LOW^XLFSTR($EXTRACT(Y,2,$LENGTH(Y)))
DO SET
+15 SET X=" "
DO SET
+16 SET Y=$PIECE(SCLOG0,U,3)
DO D^DIQ
+17 SET X=" Start Date: "_Y
DO SET
+18 SET Y=$PIECE(SCLOG0,U,4)
DO D^DIQ
+19 SET X=" End Date: "_Y
DO SET
+20 SET X=" "
DO SET
+21 SET X=" # encounters - converted: "_+$PIECE(SCLOG1,U,2)
DO SET
+22 SET X=" - not converted: "_+$PIECE(SCLOG2,U,6)
DO SET
+23 SET X=" Total # of errors logged : "_+$PIECE(SCLOG1,U,5)
DO SET
+24 ;
+25 IF $ORDER(^SD(404.98,SCLOG,"ERROR",0))
Begin DoDot:1
+26 SET Y=+$PIECE($GET(^SD(404.98,SCLOG,"R",+$$LSTREQ^SCCVLOG(SCLOG),0)),U,7)
+27 IF 'Y
QUIT
+28 SET X=" "
DO SET
+29 SET X=Y_" error"_$SELECT(Y>1:"s were",1:" was")_" encountered during this conversion run."
DO SET
+30 SET X="For details, review the 'Error Log' in the 'View Template' action."
DO SET
End DoDot:1
+31 ;
+32 DO ^XMD
+33 KILL XMSUB,XMDUZ,XMTEXT,XMY
+34 QUIT
+35 ;
SET ;Set message text
+1 SET SCLNE=SCLNE+1
SET SCTXT(SCLNE,0)=X
+2 QUIT