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

SDESGETCLINSIEN.m

Go to the documentation of this file.
SDESGETCLINSIEN ;ALB/CGP/MGD,BWF - Get Clinic info by IEN list ;Dec 07, 2023@15:49
 ;;5.3;Scheduling;**831,864,875**;Nov 18, 2022;Build 25
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 ;
 Q
 ;
CLINICLISTBYIEN(CLINLISTJSON,CLINICIENS) ;
 N CLINICDATA,NODE,SEQUENCE,IEN,SDEAS,HASHFLG,RETURNDATA,CLINICLIST,ERRORS
 S (CLINICDATA,NODE,IEN,SDEAS,RETURNDATA,CLINICLIST)=""
 S (HASHFLG,SEQUENCE)=0
 ;
 F  S NODE=$O(CLINICIENS(NODE)) Q:NODE=""  D
 . N ERRORS
 . S IEN=$G(CLINICIENS(NODE))
 . I IEN="" D ERRLOG^SDESJSON(.ERRORS,67)
 . I $D(ERRORS) M CLINICLIST("Error","Sequence "_NODE)=ERRORS Q
 . S SEQUENCE=SEQUENCE+1
 . I SEQUENCE>50 D ERRLOG^SDESJSON(.ERRORS,381)
 . I $D(ERRORS) M CLINICLIST("Error","Max")=ERRORS("Error") Q
 . ;
 . K CLINICDATA,RETURNDATA
 . D JSONCLNINFO^SDESRTVCLN2(.RETURNDATA,IEN,SDEAS,HASHFLG)
 . D DECODE^XLFJSON("RETURNDATA","CLINICDATA")
 . I $D(CLINICDATA("Error")) M CLINICLIST("Error","ClinicIEN "_IEN)=CLINICDATA("Error")
 . I '$D(CLINICDATA("Error")) M CLINICLIST("Clinic",SEQUENCE)=CLINICDATA("Clinic")
 . Q
 D BUILDJSON(.CLINLISTJSON,.CLINICLIST)
 Q
BUILDJSON(CLINLISTJSON,CLINICLIST) ;Convert data to JSON
 N JSONERR
 S JSONERR=""
 D BUILDJSON^SDESBUILDJSON(.CLINLISTJSON,.CLINICLIST)
 Q
 ;