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

SDESEDITAPPTREQ2.m

Go to the documentation of this file.
SDESEDITAPPTREQ2 ;ALB/BLB,MGD - VISTA SCHEDULING RPCS; Oct 03, 2022@10:29
 ;;5.3;Scheduling;**823,826**;Aug 13, 1993;Build 18
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 ; SDES EDIT APPT REQ
 ;
VALIDATEDATEPREF(ERRORS,REQUEST) ;
 N ARYIEN,ARYIEN2,DATE,ERR,STARTDATE,ENDDATE
 S ARYIEN=0,ERR=0
 F  S ARYIEN=$O(REQUEST("PATIENT PREFERRED START DATE",ARYIEN)) Q:'ARYIEN!($G(ERR))  D
 .S STARTDATE=$G(REQUEST("PATIENT PREFERRED START DATE",ARYIEN))
 .S STARTDATE=$$ISOTFM^SDAMUTDT(STARTDATE)
 .I STARTDATE=-1!($L(STARTDATE,".")=1) S ERR=1 D ERRLOG^SDESJSON(.ERRORS,206) Q
 .S ARYIEN2=0
 .F  S ARYIEN2=$O(REQUEST("PATIENT PREFERRED END DATE",ARYIEN2)) Q:'ARYIEN2  D
 ..S ENDDATE=$G(REQUEST("PATIENT PREFERRED END DATE",ARYIEN2))
 ..S ENDDATE=$$ISOTFM^SDAMUTDT(ENDDATE)
 ..I ENDDATE=-1!($L(ENDDATE,".")=1) S ERR=1 D ERRLOG^SDESJSON(.ERRORS,206) Q
 I $G(REQUEST("PATIENT PREFERRED START DATE",1)),'$G(REQUEST("PATIENT PREFERRED END DATE",1)) D ERRLOG^SDESJSON(.ERRORS,195) Q 0
 I $G(REQUEST("PATIENT PREFERRED START DATE",2)),'$G(REQUEST("PATIENT PREFERRED END DATE",2)) D ERRLOG^SDESJSON(.ERRORS,195) Q 0
 I $G(REQUEST("PATIENT PREFERRED START DATE",3)),'$G(REQUEST("PATIENT PREFERRED END DATE",3)) D ERRLOG^SDESJSON(.ERRORS,195) Q 0
 Q
 ;
VALIDATEAPPTTYPE(ERRORS,APPTTYPEIEN,APPTTYPENAME) ;
 ;I APPTTYPEIEN="",APPTTYPENAME="" D ERRLOG^SDESJSON(.ERRORS,306) Q 0
 N APPTTYPIEN
 S APPTTYPIEN=0
 I $G(APPTTYPENAME)'="" D  I 'APPTTYPIEN Q 0
 . S APPTTYPIEN=$$FIND1^DIC(409.1,"","X",APPTTYPENAME,"B")
 . I 'APPTTYPIEN D ERRLOG^SDESJSON(.ERRORS,180)
 I APPTTYPIEN S APPTTYPEIEN=APPTTYPIEN Q 1
 I APPTTYPEIEN'="",'$D(^SD(409.1,APPTTYPEIEN,0)) D ERRLOG^SDESJSON(.ERRORS,180)
 Q 0