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

SDESCRTAPPREQVAL.m

Go to the documentation of this file.
SDESCRTAPPREQVAL  ;ALB/JAS - Additional validation for SDESCREATEAPPREQ; FEB 07, 2024
 ;;5.3;Scheduling;**871**;Aug 13, 1993;Build 13
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 Q
 ;
 ; RPC: SDES CREATE APPT REQ (Continued from SDESCREATEAPPREQ)
 ;
VALIDATEDFN(ERRORS,DFN) ;
 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  Q 1
 . S REQUEST("CREATE DATE")=DT
 . N NOWDT S NOWDT=$$FMTISO^SDAMUTDT($$NOW^XLFDT) Q:NOWDT=-1
 . S REQUEST("CREATE DATE")=$P($$ISOTFM^SDAMUTDT(NOWDT,$G(REQUEST("CLINIC IEN"))),".")
 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,60) Q 0
 I REQTYPE'="",REQTYPE'="APPT",REQTYPE'="MOBILE",REQTYPE'="RTC",REQTYPE'="VETERAN",REQTYPE'="W2VA" D ERRLOG^SDESJSON(.ERRORS,61) Q 0
 Q 1
 ;
STATIONTOINST(ERRORS,STATIONNUM,INSTNAME) ;
 N INSTITUTIONIEN
 I STATIONNUM="",INSTNAME="" D ERRLOG^SDESJSON(.ERRORS,204) Q 0
 I STATIONNUM="",INSTNAME'="" S INSTITUTIONIEN=$$FIND1^DIC(4,"","X",INSTNAME,"B") I 'INSTITUTIONIEN D ERRLOG^SDESJSON(.ERRORS,205) Q 0
 I STATIONNUM'="" S INSTITUTIONIEN=$$FIND1^DIC(4,"","X",STATIONNUM,"D") I 'INSTITUTIONIEN D ERRLOG^SDESJSON(.ERRORS,197) Q 0
 Q INSTITUTIONIEN
 ;
VALIDATECLINSTOP(ERRORS,CLINICIEN,STOP,SECSTOP) ;
 N RESTYPE
 S STOP=$G(STOP),SECSTOP=$G(SECSTOP),REQTYPE=$G(REQTYPE)
 I CLINICIEN'="",'$D(^SC(CLINICIEN,0)) D ERRLOG^SDESJSON(.ERRORS,19) Q 0
 ;
 I STOP=900 D ERRLOG^SDESJSON(.ERRORS,273) Q 0
 I STOP'="" S STOP=$$FIND1^DIC(40.7,"","X",STOP,"C") I 'STOP D ERRLOG^SDESJSON(.ERRORS,270) Q 0
 S RESTYPE=$$GET1^DIQ(40.7,STOP,5,"I")
 I STOP'="",RESTYPE'="P",RESTYPE'="E" D ERRLOG^SDESJSON(.ERRORS,287) Q 0
 ;
 I SECSTOP=900 D ERRLOG^SDESJSON(.ERRORS,273) Q 0
 I SECSTOP'="" S SECSTOP=$$FIND1^DIC(40.7,"","X",SECSTOP,"C") I 'SECSTOP D ERRLOG^SDESJSON(.ERRORS,271) Q 0
 S RESTYPE=$$GET1^DIQ(40.7,SECSTOP,5,"I")
 I SECSTOP'="",RESTYPE'="S",RESTYPE'="E" D ERRLOG^SDESJSON(.ERRORS,288) Q 0
 ;
 I SECSTOP'="",STOP="" D ERRLOG^SDESJSON(.ERRORS,234) Q 0
 I CLINICIEN="",STOP="" D ERRLOG^SDESJSON(.ERRORS,530) Q 0
 I STOP'="",CLINICIEN'="" D ERRLOG^SDESJSON(.ERRORS,202) Q 0
 I SECSTOP'="",CLINICIEN'="" D ERRLOG^SDESJSON(.ERRORS,202) Q 0
 Q 1
 ;
VALIDATEREQBY(ERRORS,REQUESTEDBY) ;
 I REQUESTEDBY="" D ERRLOG^SDESJSON(.ERRORS,62) Q 0
 I REQUESTEDBY'="",REQUESTEDBY'="PATIENT",REQUESTEDBY'="PROVIDER" D ERRLOG^SDESJSON(.ERRORS,198)
 S REQUEST("REQUESTED BY")=$S(REQUESTEDBY="PATIENT":2,REQUESTEDBY="PROVIDER":1,1:"")
 I $D(ERRORS) Q 0
 Q 1