SDESEDITAPPTREQ2 ;ALB/BLB,MGD - VISTA SCHEDULING RPCS; Oct 03, 2022@10:29
;;5.3;Scheduling;**823,826**;Aug 13, 1993;Build 18
;;Per VHA Directive 6402, this routine should not be modified
;
; SDES EDIT APPT REQ
;
VALIDATEDATEPREF(ERRORS,REQUEST) ;
N ARYIEN,ARYIEN2,DATE,ERR,STARTDATE,ENDDATE
S ARYIEN=0,ERR=0
F S ARYIEN=$O(REQUEST("PATIENT PREFERRED START DATE",ARYIEN)) Q:'ARYIEN!($G(ERR)) D
.S STARTDATE=$G(REQUEST("PATIENT PREFERRED START DATE",ARYIEN))
.S STARTDATE=$$ISOTFM^SDAMUTDT(STARTDATE)
.I STARTDATE=-1!($L(STARTDATE,".")=1) S ERR=1 D ERRLOG^SDESJSON(.ERRORS,206) Q
.S ARYIEN2=0
.F S ARYIEN2=$O(REQUEST("PATIENT PREFERRED END DATE",ARYIEN2)) Q:'ARYIEN2 D
..S ENDDATE=$G(REQUEST("PATIENT PREFERRED END DATE",ARYIEN2))
..S ENDDATE=$$ISOTFM^SDAMUTDT(ENDDATE)
..I ENDDATE=-1!($L(ENDDATE,".")=1) S ERR=1 D ERRLOG^SDESJSON(.ERRORS,206) Q
I $G(REQUEST("PATIENT PREFERRED START DATE",1)),'$G(REQUEST("PATIENT PREFERRED END DATE",1)) D ERRLOG^SDESJSON(.ERRORS,195) Q 0
I $G(REQUEST("PATIENT PREFERRED START DATE",2)),'$G(REQUEST("PATIENT PREFERRED END DATE",2)) D ERRLOG^SDESJSON(.ERRORS,195) Q 0
I $G(REQUEST("PATIENT PREFERRED START DATE",3)),'$G(REQUEST("PATIENT PREFERRED END DATE",3)) D ERRLOG^SDESJSON(.ERRORS,195) Q 0
Q
;
VALIDATEAPPTTYPE(ERRORS,APPTTYPEIEN,APPTTYPENAME) ;
;I APPTTYPEIEN="",APPTTYPENAME="" D ERRLOG^SDESJSON(.ERRORS,306) Q 0
N APPTTYPIEN
S APPTTYPIEN=0
I $G(APPTTYPENAME)'="" D I 'APPTTYPIEN Q 0
. S APPTTYPIEN=$$FIND1^DIC(409.1,"","X",APPTTYPENAME,"B")
. I 'APPTTYPIEN D ERRLOG^SDESJSON(.ERRORS,180)
I APPTTYPIEN S APPTTYPEIEN=APPTTYPIEN Q 1
I APPTTYPEIEN'="",'$D(^SD(409.1,APPTTYPEIEN,0)) D ERRLOG^SDESJSON(.ERRORS,180)
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESEDITAPPTREQ2 1721 printed Dec 13, 2024@02:56:32 Page 2
SDESEDITAPPTREQ2 ;ALB/BLB,MGD - VISTA SCHEDULING RPCS; Oct 03, 2022@10:29
+1 ;;5.3;Scheduling;**823,826**;Aug 13, 1993;Build 18
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 ; SDES EDIT APPT REQ
+5 ;
VALIDATEDATEPREF(ERRORS,REQUEST) ;
+1 NEW ARYIEN,ARYIEN2,DATE,ERR,STARTDATE,ENDDATE
+2 SET ARYIEN=0
SET ERR=0
+3 FOR
SET ARYIEN=$ORDER(REQUEST("PATIENT PREFERRED START DATE",ARYIEN))
if 'ARYIEN!($GET(ERR))
QUIT
Begin DoDot:1
+4 SET STARTDATE=$GET(REQUEST("PATIENT PREFERRED START DATE",ARYIEN))
+5 SET STARTDATE=$$ISOTFM^SDAMUTDT(STARTDATE)
+6 IF STARTDATE=-1!($LENGTH(STARTDATE,".")=1)
SET ERR=1
DO ERRLOG^SDESJSON(.ERRORS,206)
QUIT
+7 SET ARYIEN2=0
+8 FOR
SET ARYIEN2=$ORDER(REQUEST("PATIENT PREFERRED END DATE",ARYIEN2))
if 'ARYIEN2
QUIT
Begin DoDot:2
+9 SET ENDDATE=$GET(REQUEST("PATIENT PREFERRED END DATE",ARYIEN2))
+10 SET ENDDATE=$$ISOTFM^SDAMUTDT(ENDDATE)
+11 IF ENDDATE=-1!($LENGTH(ENDDATE,".")=1)
SET ERR=1
DO ERRLOG^SDESJSON(.ERRORS,206)
QUIT
End DoDot:2
End DoDot:1
+12 IF $GET(REQUEST("PATIENT PREFERRED START DATE",1))
IF '$GET(REQUEST("PATIENT PREFERRED END DATE",1))
DO ERRLOG^SDESJSON(.ERRORS,195)
QUIT 0
+13 IF $GET(REQUEST("PATIENT PREFERRED START DATE",2))
IF '$GET(REQUEST("PATIENT PREFERRED END DATE",2))
DO ERRLOG^SDESJSON(.ERRORS,195)
QUIT 0
+14 IF $GET(REQUEST("PATIENT PREFERRED START DATE",3))
IF '$GET(REQUEST("PATIENT PREFERRED END DATE",3))
DO ERRLOG^SDESJSON(.ERRORS,195)
QUIT 0
+15 QUIT
+16 ;
VALIDATEAPPTTYPE(ERRORS,APPTTYPEIEN,APPTTYPENAME) ;
+1 ;I APPTTYPEIEN="",APPTTYPENAME="" D ERRLOG^SDESJSON(.ERRORS,306) Q 0
+2 NEW APPTTYPIEN
+3 SET APPTTYPIEN=0
+4 IF $GET(APPTTYPENAME)'=""
Begin DoDot:1
+5 SET APPTTYPIEN=$$FIND1^DIC(409.1,"","X",APPTTYPENAME,"B")
+6 IF 'APPTTYPIEN
DO ERRLOG^SDESJSON(.ERRORS,180)
End DoDot:1
IF 'APPTTYPIEN
QUIT 0
+7 IF APPTTYPIEN
SET APPTTYPEIEN=APPTTYPIEN
QUIT 1
+8 IF APPTTYPEIEN'=""
IF '$DATA(^SD(409.1,APPTTYPEIEN,0))
DO ERRLOG^SDESJSON(.ERRORS,180)
+9 QUIT 0