SDES2CHKCAVAIL ;ALB/LAB - VISTA SCHEDULING SDES2 CHECK CLIN AVAIL DEFINED ;NOV 01,2023
;;5.3;Scheduling;**866,869**;Aug 13, 1993;Build 13
;;Per VHA Directive 6402, this routine should not be modified
Q
;
CHECKAVAIL(RESULT,SDCONTEXT,SDPARM) ;
N ERRORS,RETURN
;validate context array for accuracy
D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
D VALIDATE(.ERRORS,$G(SDPARM("CLINIC IEN")))
I $D(ERRORS) S ERRORS("ClinicAvailabilityDefined")="" D BUILDJSON^SDES2JSON(.RESULT,.ERRORS) Q
S RETURN("ClinicAvailabilityDefined")=$$AVAILDEFINED(SDPARM("CLINIC IEN"))
D BUILDJSON^SDES2JSON(.RESULT,.RETURN)
;
Q
;
VALIDATE(ERRORS,SDCLINIC) ;
;validate clinic
D VALFILEIEN^SDES2VALUTIL(,.ERRORS,44,SDCLINIC,1,"",18,19)
Q
;
AVAILDEFINED(SDCLINIC) ;GET: has the given clinic ever had any availability defined?
Q $S(+$O(^SC(SDCLINIC,"T",0)):1,1:0)
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2CHKCAVAIL 880 printed Dec 13, 2024@02:53:28 Page 2
SDES2CHKCAVAIL ;ALB/LAB - VISTA SCHEDULING SDES2 CHECK CLIN AVAIL DEFINED ;NOV 01,2023
+1 ;;5.3;Scheduling;**866,869**;Aug 13, 1993;Build 13
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 QUIT
+4 ;
CHECKAVAIL(RESULT,SDCONTEXT,SDPARM) ;
+1 NEW ERRORS,RETURN
+2 ;validate context array for accuracy
+3 DO VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
+4 DO VALIDATE(.ERRORS,$GET(SDPARM("CLINIC IEN")))
+5 IF $DATA(ERRORS)
SET ERRORS("ClinicAvailabilityDefined")=""
DO BUILDJSON^SDES2JSON(.RESULT,.ERRORS)
QUIT
+6 SET RETURN("ClinicAvailabilityDefined")=$$AVAILDEFINED(SDPARM("CLINIC IEN"))
+7 DO BUILDJSON^SDES2JSON(.RESULT,.RETURN)
+8 ;
+9 QUIT
+10 ;
VALIDATE(ERRORS,SDCLINIC) ;
+1 ;validate clinic
+2 DO VALFILEIEN^SDES2VALUTIL(,.ERRORS,44,SDCLINIC,1,"",18,19)
+3 QUIT
+4 ;
AVAILDEFINED(SDCLINIC) ;GET: has the given clinic ever had any availability defined?
+1 QUIT $SELECT(+$ORDER(^SC(SDCLINIC,"T",0)):1,1:0)
+2 ;