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

SDESGETREQSIEN.m

Go to the documentation of this file.
SDESGETREQSIEN ;ALB/JAS - Get Appt Reqs by IEN list ;Feb 17, 2023@9:00
 ;;5.3;Scheduling;**838**;Aug 13, 1993;Build 7
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 Q
 ;
APPTREQSBYIEN(APPTREQSJSON,EASAUDITID,REQIENS,EASNUMS) ;
 N APPTLIST,APPTREQDATA,EAS,IEN,NODE,RETURNDATA,RIEN,SEQUENCE
 S (APPTLIST,APPTREQDATA,EAS,IEN,NODE,RETURNDATA,RIEN)=""
 S SEQUENCE=0,EASAUDITID=$G(EASAUDITID)
 ;
 F  S NODE=$O(REQIENS(NODE)) Q:NODE=""  D
 . N ERRORS
 . S SEQUENCE=SEQUENCE+1
 . I SEQUENCE>50 D ERRLOG^SDESJSON(.ERRORS,381)
 . I $D(ERRORS) M APPTLIST("Error","Max")=ERRORS Q
 . ;
 . S IEN=$G(REQIENS(NODE)),RIEN=IEN,EAS=$G(EASNUMS(NODE))
 . N APPTREQDATA
 . D GETREQBYREQIEN^SDESGETAPPTREQ(.RETURNDATA,IEN,EAS)
 . D DECODE^XLFJSON("RETURNDATA","APPTREQDATA")
 . I $D(APPTREQDATA("Error")) D  Q
 . . M APPTLIST("Error","Request not found: "_RIEN)=APPTREQDATA("Error")
 . ;
 . M APPTLIST("Request","RequestIEN:"_RIEN)=APPTREQDATA("Request")
 . Q
 ;
 ;JSON format
 D ENCODE^SDESJSON(.APPTLIST,.APPTREQSJSON)
 Q