YSCL154P ; HEC/hrubovcak - NCC Pre-install;1 Oct 2019 12:31:04
;;5.01;MENTAL HEALTH;**154**;Dec 30, 1994;Build 48
;
Q
;
START ;
D DT^DICRW
N Y,YSCNTR,YSDA,YSFLD,YSFMERR,YSMSG,YSTRGT
D XTMPZRO^YSCLTST5 ; update ^XTMP("YSCLTRN",0)
D XTMPZRO^YSCLDIS ; update ^XTMP("YSCLDIS",0)
; YSCNTR - error count
S YSTRGT="YSCL DAILY TRANSMISSION",YSCNTR=0
D ADD2TXT(.YSMSG,YSTRGT_" information in file #19.2:")
D ; check that the option is scheduled
. S YSDA=$$FIND1^DIC(19.2,"","B",YSTRGT,"","","YSFMERR")
. I '(YSDA>0) D Q
.. D ADD2TXT(.YSMSG,"*** WARNING *** The option is NOT scheduled.")
.. D ADD2TXT("This MUST be scheduled to run in TaskMan.")
.. S YSCNTR=1
. ;
. S YSFLD=2,Y=$$GET1^DIQ(19.2,YSDA,YSFLD) S:'$L(Y) YSCNTR=YSCNTR+1
. D ADD2TXT(.YSMSG," QUEUED TO RUN AT WHAT TIME: "_$S($L(Y):Y,1:" * Time not found! *"))
. S YSFLD=6,Y=$$GET1^DIQ(19.2,YSDA,YSFLD) S:'$L(Y) YSCNTR=YSCNTR+1
. D ADD2TXT(.YSMSG," RESCHEDULING FREQUENCY: "_$S($L(Y):Y,1:" * Frequency not found! *"))
. S YSFLD=12,Y=$$GET1^DIQ(19.2,YSDA,YSFLD) S:'$L(Y) YSCNTR=YSCNTR+1
. D ADD2TXT(.YSMSG," TASK ID: "_$S($L(Y):Y,1:" * Task not found! *"))
. I 'YSCNTR D Q ; no errors found
.. D ADD2TXT(.YSMSG,"No issues found for the "_YSTRGT_" option.")
. S Y=YSCNTR_" error"_$E("s",'(YSCNTR=1))_" found for the Option."
;
I YSCNTR D
. D ADD2TXT(.YSMSG," ") ; skip a line
. D ADD2TXT(.YSMSG,"The "_YSTRGT_" Option should be scheduled to be run daily,")
. D ADD2TXT(.YSMSG," in the early AM hours with no DEVICE.")
;
S Y=0 F S Y=$O(YSMSG(Y)) Q:'Y D MES^XPDUTL(YSMSG(Y,0))
Q
;
ADD2TXT(TXT,L) ; TXT passed by ref. - add L to TXT array in W-P format
Q:'$L($G(L)) ; must have text
S TXT(0)=$G(TXT(0))+1,TXT(TXT(0),0)=L Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HYSCL154P 1768 printed Nov 22, 2024@17:23:37 Page 2
YSCL154P ; HEC/hrubovcak - NCC Pre-install;1 Oct 2019 12:31:04
+1 ;;5.01;MENTAL HEALTH;**154**;Dec 30, 1994;Build 48
+2 ;
+3 QUIT
+4 ;
START ;
+1 DO DT^DICRW
+2 NEW Y,YSCNTR,YSDA,YSFLD,YSFMERR,YSMSG,YSTRGT
+3 ; update ^XTMP("YSCLTRN",0)
DO XTMPZRO^YSCLTST5
+4 ; update ^XTMP("YSCLDIS",0)
DO XTMPZRO^YSCLDIS
+5 ; YSCNTR - error count
+6 SET YSTRGT="YSCL DAILY TRANSMISSION"
SET YSCNTR=0
+7 DO ADD2TXT(.YSMSG,YSTRGT_" information in file #19.2:")
+8 ; check that the option is scheduled
Begin DoDot:1
+9 SET YSDA=$$FIND1^DIC(19.2,"","B",YSTRGT,"","","YSFMERR")
+10 IF '(YSDA>0)
Begin DoDot:2
+11 DO ADD2TXT(.YSMSG,"*** WARNING *** The option is NOT scheduled.")
+12 DO ADD2TXT("This MUST be scheduled to run in TaskMan.")
+13 SET YSCNTR=1
End DoDot:2
QUIT
+14 ;
+15 SET YSFLD=2
SET Y=$$GET1^DIQ(19.2,YSDA,YSFLD)
if '$LENGTH(Y)
SET YSCNTR=YSCNTR+1
+16 DO ADD2TXT(.YSMSG," QUEUED TO RUN AT WHAT TIME: "_$SELECT($LENGTH(Y):Y,1:" * Time not found! *"))
+17 SET YSFLD=6
SET Y=$$GET1^DIQ(19.2,YSDA,YSFLD)
if '$LENGTH(Y)
SET YSCNTR=YSCNTR+1
+18 DO ADD2TXT(.YSMSG," RESCHEDULING FREQUENCY: "_$SELECT($LENGTH(Y):Y,1:" * Frequency not found! *"))
+19 SET YSFLD=12
SET Y=$$GET1^DIQ(19.2,YSDA,YSFLD)
if '$LENGTH(Y)
SET YSCNTR=YSCNTR+1
+20 DO ADD2TXT(.YSMSG," TASK ID: "_$SELECT($LENGTH(Y):Y,1:" * Task not found! *"))
+21 ; no errors found
IF 'YSCNTR
Begin DoDot:2
+22 DO ADD2TXT(.YSMSG,"No issues found for the "_YSTRGT_" option.")
End DoDot:2
QUIT
+23 SET Y=YSCNTR_" error"_$EXTRACT("s",'(YSCNTR=1))_" found for the Option."
End DoDot:1
+24 ;
+25 IF YSCNTR
Begin DoDot:1
+26 ; skip a line
DO ADD2TXT(.YSMSG," ")
+27 DO ADD2TXT(.YSMSG,"The "_YSTRGT_" Option should be scheduled to be run daily,")
+28 DO ADD2TXT(.YSMSG," in the early AM hours with no DEVICE.")
End DoDot:1
+29 ;
+30 SET Y=0
FOR
SET Y=$ORDER(YSMSG(Y))
if 'Y
QUIT
DO MES^XPDUTL(YSMSG(Y,0))
+31 QUIT
+32 ;
ADD2TXT(TXT,L) ; TXT passed by ref. - add L to TXT array in W-P format
+1 ; must have text
if '$LENGTH($GET(L))
QUIT
+2 SET TXT(0)=$GET(TXT(0))+1
SET TXT(TXT(0),0)=L
QUIT
+3 ;