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

SDEC15.m

Go to the documentation of this file.
SDEC15 ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
 ;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
 ;
 Q
 ;
 ;
ACCGPTYG(SDECY) ;Get access group types
 ;ACCGPTYG(SDECY)  external parameter tag is in SDEC
 ;Returns ADO recordset containing ACTIVE Access types ordered alphabetically
 ;by Access Group
 ;AccessGroupID, AccessGroup, AccessTypeID, AccessType
 ;
 N SDEC0,SDEC1,SDEC2,SDECGPN,SDECI,SDECNOD,SDECTN
 S SDECY="^TMP(""SDEC"","_$J_")"
 K @SDECY
 S SDECI=0
 S ^TMP("SDEC",$J,SDECI)="I00020ACCESS_GROUP_TYPEID^I00020ACCESS_GROUP_ID^T00030ACCESS_GROUP^I00020ACCESS_TYPE_ID^T00030ACCESS_TYPE"_$C(30)
 ;
 ;$O Through "B" x-ref of SDEC ACCESS GROUP file
 S SDECGPN=0 F  S SDECGPN=$O(^SDEC(409.822,"B",SDECGPN)) Q:SDECGPN=""  D
 . S SDEC0=$O(^SDEC(409.822,"B",SDECGPN,0))
 . Q:'+SDEC0
 . Q:'$D(^SDEC(409.822,SDEC0,0))  ;INDEX VALIDITY CHECK
 . Q:'$D(^SDEC(409.824,"B",SDEC0))
 . ;$O through "B" x-ref of SDEC ACCESS GROUP TYPE
 . S SDEC1=0 F  S SDEC1=$O(^SDEC(409.824,"B",SDEC0,SDEC1)) Q:'+SDEC1  D
 . . Q:'$D(^SDEC(409.824,SDEC1,0))
 . . S SDEC2=$P(^SDEC(409.824,SDEC1,0),U,2)
 . . Q:'+SDEC2
 . . Q:'$D(^SDEC(409.823,SDEC2,0))
 . . S SDECNOD=^SDEC(409.823,SDEC2,0)
 . . Q:$P(SDECNOD,U,2)=1  ;INACTIVE
 . . S SDECTN=$P(SDECNOD,U)
 . . S SDECI=SDECI+1
 . . S ^TMP("SDEC",$J,SDECI)=SDEC1_U_SDEC0_U_SDECGPN_U_SDEC2_U_SDECTN_$C(30)
 . . Q
 . Q
 S ^TMP("SDEC",$J,SDECI)=^TMP("SDEC",$J,SDECI)_$C(31)
 Q
 ;
ERR(SDECI,SDECID,SDECERR) ;Error processing
 S SDECI=SDECI+1
 S ^TMP("SDEC",$J,SDECI)=SDECERR_"^^^^"_$C(30)
 S SDECI=SDECI+1
 S ^TMP("SDEC",$J,SDECI)=$C(31)
 Q
 ;
ETRAP ;EP Error trap entry
 I '$D(SDECI) N SDECI S SDECI=999
 S SDECI=SDECI+1
 D ERR(SDECI,99,70)
 Q