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

SDESGETDEVICES.m

Go to the documentation of this file.
SDESGETDEVICES ;ALB/BWF,MGD - VISTA SCHEDULING RPCS - DEVICE RETRIEVAL ; June 28, 2024
 ;;5.3;Scheduling;**825,881**;Aug 13, 1993;Build 10
 ;;Per VHA Directive 6402, this routine should not be modified
 ;
 Q
DEVICES(SDRES,LOOKUP) ;
 N ERRORS,DEVICES,DEVLIST,DEV,DEVDAT,CNT,LOOKUPSHORT
 S LOOKUP=$G(LOOKUP),CNT=80
 D VALLOOKUP(.ERRORS,LOOKUP)
 S LOOKUPSHORT=$E(LOOKUP,1,$L(LOOKUP)-1)
 I $D(ERRORS) S ERRORS("Device",1)="" D BUILDJSON^SDESBUILDJSON(.SDRES,.ERRORS) Q
 D DEVICE^XUDHGUI(.DEVICES,LOOKUPSHORT,1)
 I '$D(DEVICES) S DEVLIST("Device",1)="" D BUILDJSON^SDESBUILDJSON(.SDRES,.DEVLIST) Q
 S DEV=0 F  S DEV=$O(DEVICES(DEV)) Q:'DEV  D
 .S DEVDAT=$G(DEVICES(DEV))
 .I ($P(DEVDAT,U,2)'[LOOKUP),($P(DEVDAT,U,3)'[LOOKUP) Q
 .S DEVLIST("Device",DEV,"ID")=$P(DEVDAT,U)
 .S DEVLIST("Device",DEV,"Name")=$P(DEVDAT,U,2)
 .S DEVLIST("Device",DEV,"DisplayName")=$P(DEVDAT,U,3)
 .S DEVLIST("Device",DEV,"Location")=$P(DEVDAT,U,4)
 .S DEVLIST("Device",DEV,"RightMargin")=$P(DEVDAT,U,5)
 .S DEVLIST("Device",DEV,"PageLength")=$P(DEVDAT,U,6)
 D BUILDJSON^SDESBUILDJSON(.SDRES,.DEVLIST)
 Q
VALLOOKUP(ERRORS,LOOKUP) ;
 I LOOKUP["*" D ERRLOG^SDESJSON(.ERRORS,52,"Search string cannot contain an *") Q
 I LOOKUP="" D ERRLOG^SDESJSON(.ERRORS,277) Q
 I $L(LOOKUP)>15 D ERRLOG^SDESJSON(.ERRORS,278)
 Q