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