BSDX29 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ;
;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
;
;
BSDXCPD(BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND) ;EP
;Entry point for debugging
;
;D DEBUG^%Serenji("BSDXCP^BSDX29(.BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND)")
Q
;
BSDXCP(BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND) ;EP
;Copy appointments from HOSPITAL LOCATION entry BSDX44 to BSDX RESOURCE entry BSDXRES
;Beginning with appointments on day BSDXBEG and ending on BSDXEND, inclusive
;
;Returns ADO Recordset formatted fields containing count of records copied and error message:
;
;
S BSDXY="^BSDXTMP("_$J_")"
N BSDXI,BSDXST,ZTSK
S BSDXI=0
S X="ETRAP^BSDX29",@^%ZOSF("TRAP")
S ^BSDXTMP($J,0)="T00010TASK_NUMBER^T00020ERRORID"_$C(30)
;
;Convert beginning and ending dates
;
S X=BSDXBEG,%DT="X" D ^%DT S BSDXBEG=$P(Y,"."),BSDXBEG=BSDXBEG-1
I Y=-1 D ERR(BSDXI,0,"Routine: BSDX29, Error: Invalid Date") Q
S X=BSDXEND,%DT="X" D ^%DT S BSDXEND=$P(Y,"."),BSDXEND=BSDXEND+1
I Y=-1 D ERR(BSDXI,0,"Routine: BSDX29, Error: Invalid Date") Q
;
S ZTRTN="ZTM^BSDX29",ZTDTH=$H,ZTDESC="COPY PATIENT APPTS"
S ZTSAVE("BSDXBEG")="",ZTSAVE("BSDXEND")="",ZTSAVE("BSDX44")="",ZTSAVE("BSDXRES")=""
D ^%ZTLOAD
;
S BSDXI=BSDXI+1
S BSDXST=$S($G(ZTSK)>0:"OK",1:"Unable to create task.")
S ^BSDXTMP($J,BSDXI)=$G(ZTSK)_"^"_BSDXST_$C(30)_$C(31)
Q
;
ZTMTST ;
;
S %DT="AE" D ^%DT S BSDXBEG=Y
S %DT="AE" D ^%DT S BSDXEND=Y
S BSDX44=3,BSDXSRES=1,ZTSK=3380
D ZTM
Q
;
ZTMD ;EP - Debug entry point
;D DEBUG^%Serenji("ZTM^BSDX29")
Q
;
ZTM ;EP
;Taskman entry point
S X="ZTMERR^BSDX29",@^%ZOSF("TRAP")
;$O through ^SC(BSDX44,"S",
Q:'$D(ZTSK)
N BSDXCNT,BSDXIEN,BSDXNOD,BSDXNOTE,BSDXCAN,BSDXPAT,BSDXLEN,BSDXMADE,BSDXCLRK,BSDXPAT,BSDXQUIT
S BSDXCNT=0,BSDXQUIT=0
S ^BSDXTMP("BSDXCOPY",ZTSK)=BSDXCNT
TSTART
F S BSDXBEG=$O(^SC(BSDX44,"S",BSDXBEG)) Q:'+BSDXBEG Q:BSDXBEG>BSDXEND Q:BSDXQUIT D
. S BSDXIEN=0 F S BSDXIEN=$O(^SC(BSDX44,"S",BSDXBEG,1,BSDXIEN)) Q:'+BSDXIEN Q:BSDXQUIT D
. . S BSDXNOD=$G(^SC(BSDX44,"S",BSDXBEG,1,BSDXIEN,0))
. . Q:'+BSDXNOD
. . S BSDXCAN=$P(BSDXNOD,U,9)
. . Q:BSDXCAN="C"
. . S BSDXPAT=$P(BSDXNOD,U)
. . S BSDXLEN=$P(BSDXNOD,U,2) ;duration in minutes
. . S BSDXCLRK=$P(BSDXNOD,U,6) ;appt made by (clerk)
. . S BSDXMADE=$P(BSDXNOD,U,7) ;date appt made
. . S BSDXNOTE=$P(BSDXNOD,U,4) ;'OTHER' field contains note
. . S BSDXCNT=BSDXCNT+$$XFER(BSDXRES,BSDXBEG,BSDXPAT,BSDXLEN,BSDXCLRK,BSDXMADE,BSDXNOTE)
. . I +BSDXCNT,BSDXCNT#10=0 S ^BSDXTMP("BSDXCOPY",ZTSK)=BSDXCNT_" records copied." ;every 10th record
. . I $D(^BSDXTMP("BSDXCOPY",ZTSK,"CANCEL")) S BSDXQUIT=1 ;Check for cancel flag
. . Q
. Q
I 'BSDXQUIT TCOMMIT
E TROLLBACK
S ^BSDXTMP("BSDXCOPY",ZTSK)=$S(BSDXQUIT:"Cancelled. No records copied.",1:"Finished. "_BSDXCNT_" records copied.")
Q
;
ZTMERR ;
TROLLBACK
D ^%ZTER
Q
;
XFER(BSDXRES,BSDXBEG,BSDXPAT,BSDXLEN,BSDXCLRK,BSDXMADE,BSDXNOTE) ;EP
;
;Copy record to BSDX APPOINTMENT file
;Return 1 if record copied, otherwise 0
;
;$O Thru ^BSDXAPPT to determine if this appt already added
N BSDXEND,BSDXIEN,BSDXFND,BSDXPAT2
S BSDXIEN=0,BSDXFND=0
F S BSDXIEN=$O(^BSDXAPPT("ARSRC",BSDXRES,BSDXBEG,BSDXIEN)) Q:'+BSDXIEN D Q:BSDXFND
. S BSDXNOD=$G(^BSDXAPPT(BSDXIEN,0))
. Q:'+BSDXNOD
. S BSDXPAT2=$P(BSDXNOD,U,5)
. S BSDXFND=0
. I BSDXPAT2=BSDXPAT S BSDXFND=1
. Q
Q:BSDXFND 0
;
;Add to BSDX APPOINTMENT
S BSDXEND=BSDXBEG
;Calculate ending time from beginning time and duration.
S BSDXEND=$$ADDMIN(BSDXBEG,BSDXLEN)
S BSDXIENS="+1,"
S BSDXFDA(9002018.4,BSDXIENS,.01)=BSDXBEG
S BSDXFDA(9002018.4,BSDXIENS,.02)=BSDXEND
S BSDXFDA(9002018.4,BSDXIENS,.05)=BSDXPAT
S BSDXFDA(9002018.4,BSDXIENS,.07)=BSDXRES
S BSDXFDA(9002018.4,BSDXIENS,.08)=BSDXCLRK
S BSDXFDA(9002018.4,BSDXIENS,.09)=BSDXMADE
;
K BSDXIEN
D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG")
S BSDXIEN=+$G(BSDXIEN(1))
I '+BSDXIEN Q 0
;
;Add WP field
I BSDXNOTE]"" S BSDXNOTE(.5)=BSDXNOTE,BSDXNOTE="" D
. D WP^DIE(9002018.4,BSDXIEN_",",1,"","BSDXNOTE","BSDXMSG")
;
Q 1
;
ERR(BSDXI,BSDXCNT,BSDXERR) ;Error processing
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=BSDXCNT_"^"_BSDXERR_$C(30)
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=$C(31)
Q
;
ETRAP ;EP Error trap entry
D ^%ZTER
I '$D(BSDXI) N BSDXI S BSDXI=999
S BSDXI=BSDXI+1
D ERR(BSDXI,$G(BSDXCNT),"Routine: BSDX29, Error: "_$G(%ZTERROR))
Q
;
CPSTAT(BSDXY,BSDXTSK) ;EP
;Return status (copied record count) of tasked job having ZTSK=BSDXTSK
;
S BSDXY="^BSDXTMP("_$J_")"
N BSDXI,BSDXCNT
S BSDXI=0
S X="ETRAP^BSDX29",@^%ZOSF("TRAP")
S ^BSDXTMP($J,0)="T00020RECORD_COUNT^T00020ERRORID"_$C(30)
S BSDXCNT=$G(^BSDXTMP("BSDXCOPY",BSDXTSK))
I BSDXCNT["Finished" K ^BSDXTMP("BSDXCOPY",BSDXTSK)
I BSDXCNT["Cancelled" K ^BSDXTMP("BSDXCOPY",BSDXTSK)
;I $D(^BSDXTMP("BSDXCOPY",BSDXTSK,"CANCEL")) K ^BSDXTMP("BSDXCOPY",BSDXTSK)
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=BSDXCNT_"^"_"OK"_$C(30)_$C(31)
Q
;
CPCANC(BSDXY,BSDXTSK) ;EP
;Signal tasked job having ZTSK=BSDXTSK to cancel
;Returns current record count of copy process
;
S BSDXY="^BSDXTMP("_$J_")"
N BSDXI,BSDXCNT
S BSDXI=0
S X="ETRAP^BSDX29",@^%ZOSF("TRAP")
S ^BSDXTMP($J,0)="T00020RECORD_COUNT^T00020ERRORID"_$C(30)
S BSDXCNT=$G(^BSDXTMP("BSDXCOPY",BSDXTSK))
I BSDXCNT["FINISHED" K ^BSDXTMP("BSDXCOPY",BSDXTSK)
E S ^BSDXTMP("BSDXCOPY",BSDXTSK,"CANCEL")=""
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=BSDXCNT_"^"_"OK"_$C(30)_$C(31)
Q
;
ADDMIN(BSDXSTRT,BSDXLEN) ;
;
;Add BSDXLEN minutes to time BSDXSTRT and return end time
N BSDXEND,BSDXH,BSDXM,BSDXSTIM,BSDXETIM
S BSDXEND=$P(BSDXSTRT,".")
;
;Convert start time to minutes past midnight
S BSDXSTIM=$P(BSDXSTRT,".",2)
S BSDXSTIM=BSDXSTIM_"0000"
S BSDXSTIM=$E(BSDXSTIM,1,4)
S BSDXH=$E(BSDXSTIM,1,2)
S BSDXH=BSDXH*60
S BSDXH=BSDXH+$E(BSDXSTIM,3,4)
;
;Add duration to find minutes past midnight of end time
S BSDXETIM=BSDXH+BSDXLEN
;
;Convert back to a time
S BSDXH=BSDXETIM\60
S BSDXH="00"_BSDXH
S BSDXH=$E(BSDXH,$L(BSDXH)-1,$L(BSDXH))
S BSDXM=BSDXETIM#60
S BSDXM="00"_BSDXM
S BSDXM=$E(BSDXM,$L(BSDXM)-1,$L(BSDXM))
S BSDXETIM=BSDXH_BSDXM
I BSDXETIM>2400 S BSDXETIM=2400
S $P(BSDXEND,".",2)=BSDXETIM
Q BSDXEND
BSDX29 ; IHS/OIT/HMW/MSC/SAT - WINDOWS SCHEDULING RPCS ;
+1 ;;3.0;IHS WINDOWS SCHEDULING;;DEC 09, 2010
+2 ;
+3 ;
BSDXCPD(BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND) ;EP
+1 ;Entry point for debugging
+2 ;
+3 ;D DEBUG^%Serenji("BSDXCP^BSDX29(.BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND)")
+4 QUIT
+5 ;
BSDXCP(BSDXY,BSDXRES,BSDX44,BSDXBEG,BSDXEND) ;EP
+1 ;Copy appointments from HOSPITAL LOCATION entry BSDX44 to BSDX RESOURCE entry BSDXRES
+2 ;Beginning with appointments on day BSDXBEG and ending on BSDXEND, inclusive
+3 ;
+4 ;Returns ADO Recordset formatted fields containing count of records copied and error message:
+5 ;
+6 ;
+7 SET BSDXY="^BSDXTMP("_$JOB_")"
+8 NEW BSDXI,BSDXST,ZTSK
+9 SET BSDXI=0
+10 SET X="ETRAP^BSDX29"
SET @^%ZOSF("TRAP")
+11 SET ^BSDXTMP($JOB,0)="T00010TASK_NUMBER^T00020ERRORID"_$CHAR(30)
+12 ;
+13 ;Convert beginning and ending dates
+14 ;
+15 SET X=BSDXBEG
SET %DT="X"
DO ^%DT
SET BSDXBEG=$PIECE(Y,".")
SET BSDXBEG=BSDXBEG-1
+16 IF Y=-1
DO ERR(BSDXI,0,"Routine: BSDX29, Error: Invalid Date")
QUIT
+17 SET X=BSDXEND
SET %DT="X"
DO ^%DT
SET BSDXEND=$PIECE(Y,".")
SET BSDXEND=BSDXEND+1
+18 IF Y=-1
DO ERR(BSDXI,0,"Routine: BSDX29, Error: Invalid Date")
QUIT
+19 ;
+20 SET ZTRTN="ZTM^BSDX29"
SET ZTDTH=$HOROLOG
SET ZTDESC="COPY PATIENT APPTS"
+21 SET ZTSAVE("BSDXBEG")=""
SET ZTSAVE("BSDXEND")=""
SET ZTSAVE("BSDX44")=""
SET ZTSAVE("BSDXRES")=""
+22 DO ^%ZTLOAD
+23 ;
+24 SET BSDXI=BSDXI+1
+25 SET BSDXST=$SELECT($GET(ZTSK)>0:"OK",1:"Unable to create task.")
+26 SET ^BSDXTMP($JOB,BSDXI)=$GET(ZTSK)_"^"_BSDXST_$CHAR(30)_$CHAR(31)
+27 QUIT
+28 ;
ZTMTST ;
+1 ;
+2 SET %DT="AE"
DO ^%DT
SET BSDXBEG=Y
+3 SET %DT="AE"
DO ^%DT
SET BSDXEND=Y
+4 SET BSDX44=3
SET BSDXSRES=1
SET ZTSK=3380
+5 DO ZTM
+6 QUIT
+7 ;
ZTMD ;EP - Debug entry point
+1 ;D DEBUG^%Serenji("ZTM^BSDX29")
+2 QUIT
+3 ;
ZTM ;EP
+1 ;Taskman entry point
+2 SET X="ZTMERR^BSDX29"
SET @^%ZOSF("TRAP")
+3 ;$O through ^SC(BSDX44,"S",
+4 IF '$DATA(ZTSK)
QUIT
+5 NEW BSDXCNT,BSDXIEN,BSDXNOD,BSDXNOTE,BSDXCAN,BSDXPAT,BSDXLEN,BSDXMADE,BSDXCLRK,BSDXPAT,BSDXQUIT
+6 SET BSDXCNT=0
SET BSDXQUIT=0
+7 SET ^BSDXTMP("BSDXCOPY",ZTSK)=BSDXCNT
+8 TSTART
+9 FOR
SET BSDXBEG=$ORDER(^SC(BSDX44,"S",BSDXBEG))
IF '+BSDXBEG
QUIT
IF BSDXBEG>BSDXEND
QUIT
IF BSDXQUIT
QUIT
Begin DoDot:1
+10 SET BSDXIEN=0
FOR
SET BSDXIEN=$ORDER(^SC(BSDX44,"S",BSDXBEG,1,BSDXIEN))
IF '+BSDXIEN
QUIT
IF BSDXQUIT
QUIT
Begin DoDot:2
+11 SET BSDXNOD=$GET(^SC(BSDX44,"S",BSDXBEG,1,BSDXIEN,0))
+12 IF '+BSDXNOD
QUIT
+13 SET BSDXCAN=$PIECE(BSDXNOD,U,9)
+14 IF BSDXCAN="C"
QUIT
+15 SET BSDXPAT=$PIECE(BSDXNOD,U)
+16 ;duration in minutes
SET BSDXLEN=$PIECE(BSDXNOD,U,2)
+17 ;appt made by (clerk)
SET BSDXCLRK=$PIECE(BSDXNOD,U,6)
+18 ;date appt made
SET BSDXMADE=$PIECE(BSDXNOD,U,7)
+19 ;'OTHER' field contains note
SET BSDXNOTE=$PIECE(BSDXNOD,U,4)
+20 SET BSDXCNT=BSDXCNT+$$XFER(BSDXRES,BSDXBEG,BSDXPAT,BSDXLEN,BSDXCLRK,BSDXMADE,BSDXNOTE)
+21 ;every 10th record
IF +BSDXCNT
IF BSDXCNT#10=0
SET ^BSDXTMP("BSDXCOPY",ZTSK)=BSDXCNT_" records copied."
+22 ;Check for cancel flag
IF $DATA(^BSDXTMP("BSDXCOPY",ZTSK,"CANCEL"))
SET BSDXQUIT=1
+23 QUIT
End DoDot:2
+24 QUIT
End DoDot:1
+25 IF 'BSDXQUIT
TCOMMIT
+26 IF '$TEST
TROLLBACK
+27 SET ^BSDXTMP("BSDXCOPY",ZTSK)=$SELECT(BSDXQUIT:"Cancelled. No records copied.",1:"Finished. "_BSDXCNT_" records copied.")
+28 QUIT
+29 ;
ZTMERR ;
+1 TROLLBACK
+2 DO ^%ZTER
+3 QUIT
+4 ;
XFER(BSDXRES,BSDXBEG,BSDXPAT,BSDXLEN,BSDXCLRK,BSDXMADE,BSDXNOTE) ;EP
+1 ;
+2 ;Copy record to BSDX APPOINTMENT file
+3 ;Return 1 if record copied, otherwise 0
+4 ;
+5 ;$O Thru ^BSDXAPPT to determine if this appt already added
+6 NEW BSDXEND,BSDXIEN,BSDXFND,BSDXPAT2
+7 SET BSDXIEN=0
SET BSDXFND=0
+8 FOR
SET BSDXIEN=$ORDER(^BSDXAPPT("ARSRC",BSDXRES,BSDXBEG,BSDXIEN))
IF '+BSDXIEN
QUIT
Begin DoDot:1
+9 SET BSDXNOD=$GET(^BSDXAPPT(BSDXIEN,0))
+10 IF '+BSDXNOD
QUIT
+11 SET BSDXPAT2=$PIECE(BSDXNOD,U,5)
+12 SET BSDXFND=0
+13 IF BSDXPAT2=BSDXPAT
SET BSDXFND=1
+14 QUIT
End DoDot:1
IF BSDXFND
QUIT
+15 IF BSDXFND
QUIT 0
+16 ;
+17 ;Add to BSDX APPOINTMENT
+18 SET BSDXEND=BSDXBEG
+19 ;Calculate ending time from beginning time and duration.
+20 SET BSDXEND=$$ADDMIN(BSDXBEG,BSDXLEN)
+21 SET BSDXIENS="+1,"
+22 SET BSDXFDA(9002018.4,BSDXIENS,.01)=BSDXBEG
+23 SET BSDXFDA(9002018.4,BSDXIENS,.02)=BSDXEND
+24 SET BSDXFDA(9002018.4,BSDXIENS,.05)=BSDXPAT
+25 SET BSDXFDA(9002018.4,BSDXIENS,.07)=BSDXRES
+26 SET BSDXFDA(9002018.4,BSDXIENS,.08)=BSDXCLRK
+27 SET BSDXFDA(9002018.4,BSDXIENS,.09)=BSDXMADE
+28 ;
+29 KILL BSDXIEN
+30 DO UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG")
+31 SET BSDXIEN=+$GET(BSDXIEN(1))
+32 IF '+BSDXIEN
QUIT 0
+33 ;
+34 ;Add WP field
+35 IF BSDXNOTE]""
SET BSDXNOTE(.5)=BSDXNOTE
SET BSDXNOTE=""
Begin DoDot:1
+36 DO WP^DIE(9002018.4,BSDXIEN_",",1,"","BSDXNOTE","BSDXMSG")
End DoDot:1
+37 ;
+38 QUIT 1
+39 ;
ERR(BSDXI,BSDXCNT,BSDXERR) ;Error processing
+1 SET BSDXI=BSDXI+1
+2 SET ^BSDXTMP($JOB,BSDXI)=BSDXCNT_"^"_BSDXERR_$CHAR(30)
+3 SET BSDXI=BSDXI+1
+4 SET ^BSDXTMP($JOB,BSDXI)=$CHAR(31)
+5 QUIT
+6 ;
ETRAP ;EP Error trap entry
+1 DO ^%ZTER
+2 IF '$DATA(BSDXI)
NEW BSDXI
SET BSDXI=999
+3 SET BSDXI=BSDXI+1
+4 DO ERR(BSDXI,$GET(BSDXCNT),"Routine: BSDX29, Error: "_$GET(%ZTERROR))
+5 QUIT
+6 ;
CPSTAT(BSDXY,BSDXTSK) ;EP
+1 ;Return status (copied record count) of tasked job having ZTSK=BSDXTSK
+2 ;
+3 SET BSDXY="^BSDXTMP("_$JOB_")"
+4 NEW BSDXI,BSDXCNT
+5 SET BSDXI=0
+6 SET X="ETRAP^BSDX29"
SET @^%ZOSF("TRAP")
+7 SET ^BSDXTMP($JOB,0)="T00020RECORD_COUNT^T00020ERRORID"_$CHAR(30)
+8 SET BSDXCNT=$GET(^BSDXTMP("BSDXCOPY",BSDXTSK))
+9 IF BSDXCNT["Finished"
KILL ^BSDXTMP("BSDXCOPY",BSDXTSK)
+10 IF BSDXCNT["Cancelled"
KILL ^BSDXTMP("BSDXCOPY",BSDXTSK)
+11 ;I $D(^BSDXTMP("BSDXCOPY",BSDXTSK,"CANCEL")) K ^BSDXTMP("BSDXCOPY",BSDXTSK)
+12 SET BSDXI=BSDXI+1
+13 SET ^BSDXTMP($JOB,BSDXI)=BSDXCNT_"^"_"OK"_$CHAR(30)_$CHAR(31)
+14 QUIT
+15 ;
CPCANC(BSDXY,BSDXTSK) ;EP
+1 ;Signal tasked job having ZTSK=BSDXTSK to cancel
+2 ;Returns current record count of copy process
+3 ;
+4 SET BSDXY="^BSDXTMP("_$JOB_")"
+5 NEW BSDXI,BSDXCNT
+6 SET BSDXI=0
+7 SET X="ETRAP^BSDX29"
SET @^%ZOSF("TRAP")
+8 SET ^BSDXTMP($JOB,0)="T00020RECORD_COUNT^T00020ERRORID"_$CHAR(30)
+9 SET BSDXCNT=$GET(^BSDXTMP("BSDXCOPY",BSDXTSK))
+10 IF BSDXCNT["FINISHED"
KILL ^BSDXTMP("BSDXCOPY",BSDXTSK)
+11 IF '$TEST
SET ^BSDXTMP("BSDXCOPY",BSDXTSK,"CANCEL")=""
+12 SET BSDXI=BSDXI+1
+13 SET ^BSDXTMP($JOB,BSDXI)=BSDXCNT_"^"_"OK"_$CHAR(30)_$CHAR(31)
+14 QUIT
+15 ;
ADDMIN(BSDXSTRT,BSDXLEN) ;
+1 ;
+2 ;Add BSDXLEN minutes to time BSDXSTRT and return end time
+3 NEW BSDXEND,BSDXH,BSDXM,BSDXSTIM,BSDXETIM
+4 SET BSDXEND=$PIECE(BSDXSTRT,".")
+5 ;
+6 ;Convert start time to minutes past midnight
+7 SET BSDXSTIM=$PIECE(BSDXSTRT,".",2)
+8 SET BSDXSTIM=BSDXSTIM_"0000"
+9 SET BSDXSTIM=$EXTRACT(BSDXSTIM,1,4)
+10 SET BSDXH=$EXTRACT(BSDXSTIM,1,2)
+11 SET BSDXH=BSDXH*60
+12 SET BSDXH=BSDXH+$EXTRACT(BSDXSTIM,3,4)
+13 ;
+14 ;Add duration to find minutes past midnight of end time
+15 SET BSDXETIM=BSDXH+BSDXLEN
+16 ;
+17 ;Convert back to a time
+18 SET BSDXH=BSDXETIM\60
+19 SET BSDXH="00"_BSDXH
+20 SET BSDXH=$EXTRACT(BSDXH,$LENGTH(BSDXH)-1,$LENGTH(BSDXH))
+21 SET BSDXM=BSDXETIM#60
+22 SET BSDXM="00"_BSDXM
+23 SET BSDXM=$EXTRACT(BSDXM,$LENGTH(BSDXM)-1,$LENGTH(BSDXM))
+24 SET BSDXETIM=BSDXH_BSDXM
+25 IF BSDXETIM>2400
SET BSDXETIM=2400
+26 SET $PIECE(BSDXEND,".",2)=BSDXETIM
+27 QUIT BSDXEND