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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESGETREQSIEN 1051 printed Dec 13, 2024@02:57:05 Page 2
SDESGETREQSIEN ;ALB/JAS - Get Appt Reqs by IEN list ;Feb 17, 2023@9:00
+1 ;;5.3;Scheduling;**838**;Aug 13, 1993;Build 7
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 QUIT
+5 ;
APPTREQSBYIEN(APPTREQSJSON,EASAUDITID,REQIENS,EASNUMS) ;
+1 NEW APPTLIST,APPTREQDATA,EAS,IEN,NODE,RETURNDATA,RIEN,SEQUENCE
+2 SET (APPTLIST,APPTREQDATA,EAS,IEN,NODE,RETURNDATA,RIEN)=""
+3 SET SEQUENCE=0
SET EASAUDITID=$GET(EASAUDITID)
+4 ;
+5 FOR
SET NODE=$ORDER(REQIENS(NODE))
if NODE=""
QUIT
Begin DoDot:1
+6 NEW ERRORS
+7 SET SEQUENCE=SEQUENCE+1
+8 IF SEQUENCE>50
DO ERRLOG^SDESJSON(.ERRORS,381)
+9 IF $DATA(ERRORS)
MERGE APPTLIST("Error","Max")=ERRORS
QUIT
+10 ;
+11 SET IEN=$GET(REQIENS(NODE))
SET RIEN=IEN
SET EAS=$GET(EASNUMS(NODE))
+12 NEW APPTREQDATA
+13 DO GETREQBYREQIEN^SDESGETAPPTREQ(.RETURNDATA,IEN,EAS)
+14 DO DECODE^XLFJSON("RETURNDATA","APPTREQDATA")
+15 IF $DATA(APPTREQDATA("Error"))
Begin DoDot:2
+16 MERGE APPTLIST("Error","Request not found: "_RIEN)=APPTREQDATA("Error")
End DoDot:2
QUIT
+17 ;
+18 MERGE APPTLIST("Request","RequestIEN:"_RIEN)=APPTREQDATA("Request")
+19 QUIT
End DoDot:1
+20 ;
+21 ;JSON format
+22 DO ENCODE^SDESJSON(.APPTLIST,.APPTREQSJSON)
+23 QUIT