Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDES2UNBLOCKPBSP

SDES2UNBLOCKPBSP.m

Go to the documentation of this file.
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
 ;