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