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

SDESEDITAPREQVAL.m

Go to the documentation of this file.
SDESEDITAPREQVAL  ;ALB/JAS - Additional validation for SDESEDITAPPTREQ; FEB 21, 2024
 ;;5.3;Scheduling;**873**;Aug 13, 1993;Build 10
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 Q
 ;
 ; RPC: SDES EDIT APPT REQ (Continued from SDESEDITAPPTREQ)
 ;
VALIDATEAPPTREQ(ERRORS,REQIEN) ;
 I REQIEN="@" D ERRLOG^SDESJSON(.ERRORS,229) Q 0
 I REQIEN="" D ERRLOG^SDESJSON(.ERRORS,3) Q 0
 I REQIEN'="",('$D(^SDEC(409.85,REQIEN)))!(REQIEN=0) D ERRLOG^SDESJSON(.ERRORS,4) Q 0
 Q 1
 ;
VALIDATEDFN(ERRORS,DFN) ;
 I DFN="@" D ERRLOG^SDESJSON(.ERRORS,229) Q 0
 I DFN="" D ERRLOG^SDESJSON(.ERRORS,1) Q 0
 I DFN'="",'$D(^DPT(DFN,0)) D ERRLOG^SDESJSON(.ERRORS,2) Q 0
 Q 1
 ;
VALIDATEDATETIME(ERRORS,REQUEST) ;
 I $G(REQUEST("CREATE DATE"))="@" D ERRLOG^SDESJSON(.ERRORS,229) Q 0
 I $G(REQUEST("CREATE DATE"))="" D ERRLOG^SDESJSON(.ERRORS,48) Q 0
 I $G(REQUEST("CREATE DATE"))'="" S REQUEST("CREATE DATE")=$$ISOTFM^SDAMUTDT($G(REQUEST("CREATE DATE")))
 I $G(REQUEST("CREATE DATE"))=-1 D ERRLOG^SDESJSON(.ERRORS,49) Q 0
 Q 1
 ;
VALIDATEREQTYPE(ERRORS,REQTYPE) ;
 I REQTYPE="@" D ERRLOG^SDESJSON(.ERRORS,229) Q 0
 I REQTYPE="" D ERRLOG^SDESJSON(.ERRORS,60) Q 0
 I REQTYPE'="",REQTYPE'="APPT",REQTYPE'="MOBILE",REQTYPE'="RTC",REQTYPE'="VETERAN" D ERRLOG^SDESJSON(.ERRORS,61) Q 0
 Q 1
 ;
STATIONTOINST(ERRORS,STATIONNUM,INSTNAME) ; station number has precedence over institution name
 N INSTITUTIONIEN
 I STATIONNUM="",INSTNAME="" D ERRLOG^SDESJSON(.ERRORS,204) Q 0
 I STATIONNUM="",INSTNAME'="" D
 .S INSTITUTIONIEN=$$FIND1^DIC(4,"","X",INSTNAME,"B") I 'INSTITUTIONIEN D ERRLOG^SDESJSON(.ERRORS,205)
 I STATIONNUM'="" S INSTITUTIONIEN=$$FIND1^DIC(4,"","X",STATIONNUM,"D") I 'INSTITUTIONIEN D ERRLOG^SDESJSON(.ERRORS,197) Q 0
 Q INSTITUTIONIEN
 ;
VALIDATECLINSTOP(ERRORS,REQUEST,CLINICIEN,STOPCODE,SECSTOPCODE) ;
 N STOPCODEIEN
 I CLINICIEN'="",'$D(^SC(CLINICIEN,0)) D ERRLOG^SDESJSON(.ERRORS,19) Q 0
 I STOPCODE'="" S STOPCODE=$$FIND1^DIC(40.7,"","X",STOPCODE,"C") I '$G(STOPCODE) D ERRLOG^SDESJSON(.ERRORS,99) Q 0
 I SECSTOPCODE'="" S SECSTOPCODE=$$FIND1^DIC(40.7,"","X",SECSTOPCODE,"C") I '$G(SECSTOPCODE) D ERRLOG^SDESJSON(.ERRORS,214) Q 0
 I SECSTOPCODE'="",STOPCODE="" D ERRLOG^SDESJSON(.ERRORS,234) Q 0
 I CLINICIEN="",STOPCODE="" D ERRLOG^SDESJSON(.ERRORS,63) Q 0
 I STOPCODE'="",CLINICIEN'="" D ERRLOG^SDESJSON(.ERRORS,202) Q 0
 I SECSTOPCODE'="",CLINICIEN'="" D ERRLOG^SDESJSON(.ERRORS,202) Q 0
 ; STOP CODE IENs per VSE-5396 patch 845 - TJB
 S:STOPCODE'="" REQUEST("STOP CODE")=STOPCODE
 S:SECSTOPCODE'="" REQUEST("SECONDARY STOP CODE")=SECSTOPCODE
 Q 1
 ;
VALIDATEREQBY(ERRORS,REQUESTEDBY) ;
 I REQUESTEDBY="@" D ERRLOG^SDESJSON(.ERRORS,229) Q 0
 I REQUESTEDBY="" D ERRLOG^SDESJSON(.ERRORS,62) Q 0
 I REQUESTEDBY'="",REQUESTEDBY'="PATIENT",REQUESTEDBY'="PROVIDER" D ERRLOG^SDESJSON(.ERRORS,198) Q 0
 Q 1