SD53P780 ;TMP/DRF - TMP POST INSTALL FOR PATCH SD*5.3*780;July 30, 2018
;;5.3;Scheduling;**780**;May 29, 2018;Build 17
;
;Post install routine for SD*5.3*780 to load existing non-clinic days and blocked hours that occur in the future.
;
POST ;Post install routines for SD*5.3*780
N SC,SD,ST,SDCAN
D NONCLIN
D BLOCKED
D BMES^XPDUTL("Rebuilding Menus....") D BLD D BMES^XPDUTL("Rebuilding menus complete.")
Q
;
NONCLIN ;Send existing non-clinic days
S SC=0 F S SC=$O(^SC(SC)) Q:'SC D
. S SD=DT F S SD=$O(^SC(SC,"ST",SD)) Q:'SD D
.. S ST=$G(^SC(SC,"ST",SD,1)) I ST'["[" D DAYS
Q
;
BLOCKED ;Finding existing blocked hours
S SC=0 F S SC=$O(^SC(SC)) Q:'SC D
. S SD=DT F S SD=$O(^SC(SC,"SDCAN",SD)) Q:'SD D
.. S SDCAN=$G(^SC(SC,"SDCAN",SD,0)) I SDCAN]"" D HOURS
Q
;
DAYS ;Call HL7 builder
D EN^SDTMPHLC(SC,SD_".0",1440,"C",$E(ST,10,99))
Q
;
HOURS ;Sending existing blocked hours
N SDSTRT,SDEND,SDLNGTH
S SDSTRT=$P(SDCAN,"^",1),SDEND=$P(SDCAN,"^",2),SDEND=+($P(SDSTRT,".",1)_"."_SDEND)
S SDLNGTH=$$FMDIFF^XLFDT(SDEND,SDSTRT,2)/60
D EN^SDTMPHLC(SC,SDSTRT,SDLNGTH,"P","BLOCKED")
Q
;
BLD ; Menu updates
N ADDED
S ADDED=$$DELETE^XPDMENU("SDSUP","SD TELE TOOLS")
S ADDED=$$ADD^XPDMENU("SD TELE TOOLS","SD PROVIDER ADD/EDIT")
S ADDED=$$ADD^XPDMENU("SDMGR","SD TELE TOOLS")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSD53P780 1344 printed Nov 22, 2024@17:56:38 Page 2
SD53P780 ;TMP/DRF - TMP POST INSTALL FOR PATCH SD*5.3*780;July 30, 2018
+1 ;;5.3;Scheduling;**780**;May 29, 2018;Build 17
+2 ;
+3 ;Post install routine for SD*5.3*780 to load existing non-clinic days and blocked hours that occur in the future.
+4 ;
POST ;Post install routines for SD*5.3*780
+1 NEW SC,SD,ST,SDCAN
+2 DO NONCLIN
+3 DO BLOCKED
+4 DO BMES^XPDUTL("Rebuilding Menus....")
DO BLD
DO BMES^XPDUTL("Rebuilding menus complete.")
+5 QUIT
+6 ;
NONCLIN ;Send existing non-clinic days
+1 SET SC=0
FOR
SET SC=$ORDER(^SC(SC))
if 'SC
QUIT
Begin DoDot:1
+2 SET SD=DT
FOR
SET SD=$ORDER(^SC(SC,"ST",SD))
if 'SD
QUIT
Begin DoDot:2
+3 SET ST=$GET(^SC(SC,"ST",SD,1))
IF ST'["["
DO DAYS
End DoDot:2
End DoDot:1
+4 QUIT
+5 ;
BLOCKED ;Finding existing blocked hours
+1 SET SC=0
FOR
SET SC=$ORDER(^SC(SC))
if 'SC
QUIT
Begin DoDot:1
+2 SET SD=DT
FOR
SET SD=$ORDER(^SC(SC,"SDCAN",SD))
if 'SD
QUIT
Begin DoDot:2
+3 SET SDCAN=$GET(^SC(SC,"SDCAN",SD,0))
IF SDCAN]""
DO HOURS
End DoDot:2
End DoDot:1
+4 QUIT
+5 ;
DAYS ;Call HL7 builder
+1 DO EN^SDTMPHLC(SC,SD_".0",1440,"C",$EXTRACT(ST,10,99))
+2 QUIT
+3 ;
HOURS ;Sending existing blocked hours
+1 NEW SDSTRT,SDEND,SDLNGTH
+2 SET SDSTRT=$PIECE(SDCAN,"^",1)
SET SDEND=$PIECE(SDCAN,"^",2)
SET SDEND=+($PIECE(SDSTRT,".",1)_"."_SDEND)
+3 SET SDLNGTH=$$FMDIFF^XLFDT(SDEND,SDSTRT,2)/60
+4 DO EN^SDTMPHLC(SC,SDSTRT,SDLNGTH,"P","BLOCKED")
+5 QUIT
+6 ;
BLD ; Menu updates
+1 NEW ADDED
+2 SET ADDED=$$DELETE^XPDMENU("SDSUP","SD TELE TOOLS")
+3 SET ADDED=$$ADD^XPDMENU("SD TELE TOOLS","SD PROVIDER ADD/EDIT")
+4 SET ADDED=$$ADD^XPDMENU("SDMGR","SD TELE TOOLS")
+5 QUIT