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

SDESGETAPPTSIEN.m

Go to the documentation of this file.
SDESGETAPPTSIEN ;ALB/CGP - Get Appointment info by IEN list ;Feb 17, 2023@09:47
 ;;5.3;Scheduling;**838**;Feb 17, 2023;Build 7
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 ;
 Q
 ;
APPTSLISTBYIEN(APPTSLISTJSON,EASAUDITID,APPTIENS,SDEASARRAY) ;
 N APPTDATA,NODE,SEQUENCE,IEN,RETURNDATA,APPTLIST,ERRORS,SDEAS
 S (APPTDATA,NODE,IEN,RETURNDATA,APPTLIST,SDEAS)=""
 S (SEQUENCE)=0
 ;
 F  S NODE=$O(APPTIENS(NODE)) Q:NODE=""  D
 . N ERRORS
 . S IEN=$G(APPTIENS(NODE))
 . I IEN="" D ERRLOG^SDESJSON(.ERRORS,14)
 . I $D(ERRORS) M APPTLIST("Error","Sequence "_NODE)=ERRORS Q
 . S SEQUENCE=SEQUENCE+1
 . I SEQUENCE>50 D ERRLOG^SDESJSON(.ERRORS,429)
 . I $D(ERRORS) M APPTLIST("Error","Max")=ERRORS Q
 . ;
 . S SDEAS=$G(SDEASARRAY(NODE),"")
 . N APPTDATA
 . D GETAPPTBYIEN^SDESGETAPPTWRAP4(.RETURNDATA,IEN,SDEAS)
 . D DECODE^XLFJSON("RETURNDATA","APPTDATA")
 . I $D(APPTDATA("Error")) M APPTLIST("Error","AppointmentIEN "_IEN)=APPTDATA("Error")
 . I '$D(APPTDATA("Error")) M APPTLIST("Appointment",SEQUENCE)=APPTDATA("Appointment")
 . Q
 D BUILDJSON(.APPTSLISTJSON,.APPTLIST)
 Q
BUILDJSON(APPTSLISTJSON,APPTLIST) ;Convert data to JSON
 N JSONERR
 S JSONERR=""
 D BUILDJSON^SDESBUILDJSON(.APPTSLISTJSON,.APPTLIST)
 Q
 ;