SDES2UNBLOCKPBSP ;ALB/BLB - SDES2 UNBLOCK PBSP CLINIC AVAIL; FEB 27 2024 11:30 AM
;;5.3;Scheduling;**877**;Aug 13, 1993;Build 14
;;Per VHA Directive 6402, this routine should not be modified
;
Q
;
UNBLOCK(JSON,SDCONTEXT,UNBLOCK) ;
N ERRORS,PBSPID,RESTOREDATETIME,RETURN
;
D POPULATE(.UNBLOCK,.PBSPID,.RESTOREDATETIME)
D VALIDATE(.ERRORS,.SDCONTEXT,$G(PBSPID),$G(RESTOREDATETIME))
I $D(ERRORS) S ERRORS("UnBlockPBSPID")="" D BUILDJSON^SDES2JSON(.JSON,.ERRORS) Q
;
D UNBLOCKSLOTS(PBSPID,RESTOREDATETIME,.SDCONTEXT)
S RETURN("UnBlockPBSPID")=1
D BUILDJSON^SDES2JSON(.JSON,.RETURN)
Q
;
UNBLOCKSLOTS(PBSPID,RESTOREDATETIME,SDCONTEXT) ;
N CLINICIEN,RESTORE,RESTOREJSON
;
S CLINICIEN=0
F S CLINICIEN=$O(^SC("PBSP",PBSPID,CLINICIEN)) Q:'CLINICIEN D
.S RESTORE("CLINIC IEN")=CLINICIEN
.S RESTORE("DATE OR DATETIME")=RESTOREDATETIME
.S RESTORE("RESTORE TYPE")="P"
.;
.D RESTORE^SDES2RSTCAVAIL(.RESTOREJSON,.SDCONTEXT,.RESTORE)
Q
;
VALIDATE(ERRORS,SDCONTEXT,PBSPID,RESTOREDATETIME) ;
D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
I $D(ERRORS) Q
;
S RESTOREDATETIME=$$VALISODTTM^SDES2VALISODTTM(.ERRORS,RESTOREDATETIME,,1,165,166)
;
I '$L($G(PBSPID)) D ERRLOG^SDESJSON(.ERRORS,557) Q
I '$D(^SC("PBSP",PBSPID)) D ERRLOG^SDESJSON(.ERRORS,556) Q
I $L(PBSPID)>100 D ERRLOG^SDESJSON(.ERRORS,556)
I $D(ERRORS) Q
;
Q
;
POPULATE(UNBLOCK,PBSPID,RESTOREDATETIME) ;
S PBSPID=$G(UNBLOCK("PBSPID"))
S RESTOREDATETIME=$G(UNBLOCK("RESTORE DATE TIME"))
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2UNBLOCKPBSP 1526 printed Nov 22, 2024@18:04:38 Page 2
SDES2UNBLOCKPBSP ;ALB/BLB - SDES2 UNBLOCK PBSP CLINIC AVAIL; FEB 27 2024 11:30 AM
+1 ;;5.3;Scheduling;**877**;Aug 13, 1993;Build 14
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 QUIT
+5 ;
UNBLOCK(JSON,SDCONTEXT,UNBLOCK) ;
+1 NEW ERRORS,PBSPID,RESTOREDATETIME,RETURN
+2 ;
+3 DO POPULATE(.UNBLOCK,.PBSPID,.RESTOREDATETIME)
+4 DO VALIDATE(.ERRORS,.SDCONTEXT,$GET(PBSPID),$GET(RESTOREDATETIME))
+5 IF $DATA(ERRORS)
SET ERRORS("UnBlockPBSPID")=""
DO BUILDJSON^SDES2JSON(.JSON,.ERRORS)
QUIT
+6 ;
+7 DO UNBLOCKSLOTS(PBSPID,RESTOREDATETIME,.SDCONTEXT)
+8 SET RETURN("UnBlockPBSPID")=1
+9 DO BUILDJSON^SDES2JSON(.JSON,.RETURN)
+10 QUIT
+11 ;
UNBLOCKSLOTS(PBSPID,RESTOREDATETIME,SDCONTEXT) ;
+1 NEW CLINICIEN,RESTORE,RESTOREJSON
+2 ;
+3 SET CLINICIEN=0
+4 FOR
SET CLINICIEN=$ORDER(^SC("PBSP",PBSPID,CLINICIEN))
if 'CLINICIEN
QUIT
Begin DoDot:1
+5 SET RESTORE("CLINIC IEN")=CLINICIEN
+6 SET RESTORE("DATE OR DATETIME")=RESTOREDATETIME
+7 SET RESTORE("RESTORE TYPE")="P"
+8 ;
+9 DO RESTORE^SDES2RSTCAVAIL(.RESTOREJSON,.SDCONTEXT,.RESTORE)
End DoDot:1
+10 QUIT
+11 ;
VALIDATE(ERRORS,SDCONTEXT,PBSPID,RESTOREDATETIME) ;
+1 DO VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
+2 IF $DATA(ERRORS)
QUIT
+3 ;
+4 SET RESTOREDATETIME=$$VALISODTTM^SDES2VALISODTTM(.ERRORS,RESTOREDATETIME,,1,165,166)
+5 ;
+6 IF '$LENGTH($GET(PBSPID))
DO ERRLOG^SDESJSON(.ERRORS,557)
QUIT
+7 IF '$DATA(^SC("PBSP",PBSPID))
DO ERRLOG^SDESJSON(.ERRORS,556)
QUIT
+8 IF $LENGTH(PBSPID)>100
DO ERRLOG^SDESJSON(.ERRORS,556)
+9 IF $DATA(ERRORS)
QUIT
+10 ;
+11 QUIT
+12 ;
POPULATE(UNBLOCK,PBSPID,RESTOREDATETIME) ;
+1 SET PBSPID=$GET(UNBLOCK("PBSPID"))
+2 SET RESTOREDATETIME=$GET(UNBLOCK("RESTORE DATE TIME"))
+3 QUIT
+4 ;