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

SDESGREQSIENS.m

Go to the documentation of this file.
SDESGREQSIENS ;ALB/ANU,LAB - Get Appt Reqs by IEN list ;JUN 21, 2023@15:35
 ;;5.3;Scheduling;**845,847**;Aug 13, 1993;Build 4
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 Q
 ;Cloned from SDESGETREQSIEN
APPTREQSBYIEN(APPTREQSJSON,EASAUDITID,REQIENS,EASNUMS) ;
 N EAS,REQUESTIEN,NODE,REQUEST,SEQUENCE,ERRORS,APPTLIST,SDESCNT
 S (EAS,REQUESTIEN,NODE,REQUEST)=""
 S SEQUENCE=0,EASAUDITID=$G(EASAUDITID)
 ; 
 F  S NODE=$O(REQIENS(NODE)) Q:NODE=""  D
 . N ISREQIENVALID,ISEASVALID,SDESERR
 . S (ISREQIENVALID,ISEASVALID,SDESERR)=""
 . S SEQUENCE=SEQUENCE+1
 . I SEQUENCE>50 D ERRLOG^SDESJSON(.ERRORS,381) S SDESERR="Y" Q
 . S REQUESTIEN=$G(REQIENS(NODE)),EAS=$G(EASNUMS(NODE))
 . S ISREQIENVALID=$$VALIDATEREQIEN^SDESGETAPPTREQ2(.ERRORS,$G(REQUESTIEN))
 . S ISEASVALID=$$VALIDATEEAS^SDESGETAPPTREQ2(.ERRORS,$G(EAS))
 . I (ISREQIENVALID=0)!(ISEASVALID=0)!(SDESERR="Y") D
 . . S SDESCNT=$O(ERRORS("Error",""),-1)
 . . S ERRORS("Error",SDESCNT)=ERRORS("Error",SDESCNT)_" IEN:"_$G(REQUESTIEN)
 . . S SDESERR="Y"
 . I SDESERR'="Y" D GETREQUEST^SDESGETAPPTREQ(.REQUEST,REQUESTIEN)
 I $D(REQUEST) M APPTLIST=REQUEST
 I $D(ERRORS) M APPTLIST=ERRORS
 D BUILDJSON(.APPTREQSJSON,.APPTLIST)
 Q
 ;
BUILDJSON(APPTLISTJSON,APPTLISTARRAY) ;Convert data to JSON
 N JSONERR
 S JSONERR=""
 D ENCODE^SDESJSON(.APPTLISTARRAY,.APPTLISTJSON,.JSONERR)
 Q