SDESVALUTIL ;ALB/BWF - VISTA SCHEDULING VALIDATION UTILITIES ;SEP 22, 2022
;;5.3;Scheduling;**826,835**;Aug 13, 1993;Build 4
;;Per VHA Directive 6402, this routine should not be modified
;
Q
; validate appointment ID/IEN
VALAPPTIEN(ERRORS,APPTIEN) ;
I '$L(APPTIEN) D ERRLOG^SDESJSON(.ERRORS,14) Q
I 'APPTIEN D ERRLOG^SDESJSON(.ERRORS,15) Q
I APPTIEN,'$D(^SDEC(409.84,APPTIEN)) D ERRLOG^SDESJSON(.ERRORS,15)
Q
; validate ISO date - generic missing/invalid message
VALDATE(ERRORS,DATE,CLINIC) ;
N FMSDATE
I DATE="" D ERRLOG^SDESJSON(.ERRORS,45) Q ""
S FMSDATE=$$ISOTFM^SDAMUTDT(DATE,$G(CLINIC))
I FMSDATE<1 D ERRLOG^SDESJSON(.ERRORS,46) Q ""
Q FMSDATE
; validate a date using specific error codes from 409.93
VALDATE2(ERRORS,DATE,CLINIC,MISSINGERRID,INVALIDERRID) ;
N FMSDATE,MISSINGID,INVALIDID
S MISSINGID=$S($G(MISSINGERRID):MISSINGERRID,1:45)
S INVALIDID=$S($G(INVALIDERRID):INVALIDERRID,1:46)
I DATE="" D ERRLOG^SDESJSON(.ERRORS,MISSINGID) Q ""
S FMSDATE=$$ISOTFM^SDAMUTDT(DATE,$G(CLINIC))
I FMSDATE<1 D ERRLOG^SDESJSON(.ERRORS,INVALIDID) Q ""
Q FMSDATE
; validate SD SUPERVISOR key
VALKEY(ERRORS,DUZ) ;
I '$$KCHK^XUSRB("SD SUPERVISOR",DUZ) D ERRLOG^SDESJSON(.ERRORS,316)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESVALUTIL 1234 printed Dec 13, 2024@02:57:53 Page 2
SDESVALUTIL ;ALB/BWF - VISTA SCHEDULING VALIDATION UTILITIES ;SEP 22, 2022
+1 ;;5.3;Scheduling;**826,835**;Aug 13, 1993;Build 4
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 QUIT
+5 ; validate appointment ID/IEN
VALAPPTIEN(ERRORS,APPTIEN) ;
+1 IF '$LENGTH(APPTIEN)
DO ERRLOG^SDESJSON(.ERRORS,14)
QUIT
+2 IF 'APPTIEN
DO ERRLOG^SDESJSON(.ERRORS,15)
QUIT
+3 IF APPTIEN
IF '$DATA(^SDEC(409.84,APPTIEN))
DO ERRLOG^SDESJSON(.ERRORS,15)
+4 QUIT
+5 ; validate ISO date - generic missing/invalid message
VALDATE(ERRORS,DATE,CLINIC) ;
+1 NEW FMSDATE
+2 IF DATE=""
DO ERRLOG^SDESJSON(.ERRORS,45)
QUIT ""
+3 SET FMSDATE=$$ISOTFM^SDAMUTDT(DATE,$GET(CLINIC))
+4 IF FMSDATE<1
DO ERRLOG^SDESJSON(.ERRORS,46)
QUIT ""
+5 QUIT FMSDATE
+6 ; validate a date using specific error codes from 409.93
VALDATE2(ERRORS,DATE,CLINIC,MISSINGERRID,INVALIDERRID) ;
+1 NEW FMSDATE,MISSINGID,INVALIDID
+2 SET MISSINGID=$SELECT($GET(MISSINGERRID):MISSINGERRID,1:45)
+3 SET INVALIDID=$SELECT($GET(INVALIDERRID):INVALIDERRID,1:46)
+4 IF DATE=""
DO ERRLOG^SDESJSON(.ERRORS,MISSINGID)
QUIT ""
+5 SET FMSDATE=$$ISOTFM^SDAMUTDT(DATE,$GET(CLINIC))
+6 IF FMSDATE<1
DO ERRLOG^SDESJSON(.ERRORS,INVALIDID)
QUIT ""
+7 QUIT FMSDATE
+8 ; validate SD SUPERVISOR key
VALKEY(ERRORS,DUZ) ;
+1 IF '$$KCHK^XUSRB("SD SUPERVISOR",DUZ)
DO ERRLOG^SDESJSON(.ERRORS,316)
+2 QUIT