source: Scheduling/trunk/m/BSDX15.m@ 739

Last change on this file since 739 was 614, checked in by Sam Habiel, 15 years ago

Initial committ of scheduling package

File size: 2.3 KB
Line 
1BSDX15 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ;
2 ;;2.0;IHS WINDOWS SCHEDULING;;NOV 01, 2007
3 ;
4 ;
5GRPTYP(BSDXY) ;EP
6 ;Called by BSDX GET ACCESS GROUP TYPES
7 ;Returns ADO recordset containing ACTIVE Access types ordered alphabetically
8 ;by Access Group
9 ;AccessGroupID, AccessGroup, AccessTypeID, AccessType
10 ;
11 ;Test Code:
12 ;D GRPTYP^BSDX15(.RES) ZW RES
13 ;
14 S BSDXY="^BSDXTMP("_$J_")"
15 N BSDX1
16 S BSDXI=0
17 S X="ETRAP^BSDX15",@^%ZOSF("TRAP")
18 S ^BSDXTMP($J,BSDXI)="I00020ACCESS_GROUP_TYPEID^I00020ACCESS_GROUP_ID^T00030ACCESS_GROUP^I00020ACCESS_TYPE_ID^T00030ACCESS_TYPE"_$C(30)
19 ;
20 ;N BSDX0,BSDX1,BSDXNOD,BSDXGPN,BSDXTN
21 ;$O Through "B" x-ref of BSDX ACCESS GROUP file
22 ;S BSDXGPN=0 F S BSDXGPN=$O(^BSDXAGP("B",BSDXGPN)) Q:BSDXGPN="" D
23 ;. S BSDX0=$O(^BSDXAGP("B",BSDXGPN,0))
24 ;. Q:'+BSDX0
25 ;. Q:'$D(^BSDXAGP(BSDX0,0)) ;INDEX VALIDITY CHECK
26 ;. Q:'$D(^BSDXAGTP("B",BSDX0))
27 ;. ;$O through "B" x-ref of BSDX ACCESS GROUP TYPE
28 ;. S BSDX1=0 F S BSDX1=$O(^BSDXAGTP("B",BSDX0,BSDX1)) Q:'+BSDX1 D
29 ;. . Q:'$D(^BSDXAGTP(BSDX1,0))
30 ;. . S BSDX2=$P(^BSDXAGTP(BSDX1,0),U,2)
31 ;. . Q:'+BSDX2
32 ;. . Q:'$D(^BSDXTYPE(BSDX2,0))
33 ;. . S BSDXNOD=^BSDXTYPE(BSDX2,0)
34 ;. . Q:$P(BSDXNOD,U,2)=1 ;INACTIVE
35 ;. . S BSDXTN=$P(BSDXNOD,U)
36 ;. . S BSDXI=BSDXI+1
37 ;. . S ^BSDXTMP($J,BSDXI)=BSDX1_U_BSDX0_U_BSDXGPN_U_BSDX2_U_BSDXTN_$C(30)
38 ;. . Q
39 ;. Q
40 ;
41 ;$O Through "AC" x-ref of BSDX ACCESS GROUP TYPE file
42 N BSDXAGID,BSDXAGN,BSDXATID,BSDXATN,BSDXAGTID
43 S BSDXAGID=0
44 F S BSDXAGID=$O(^BSDXAGTP("AC",BSDXAGID)) Q:'+BSDXAGID D
45 . I '$D(^BSDXAGP(BSDXAGID,0)) Q
46 . S BSDXAGN=$P(^BSDXAGP(BSDXAGID,0),U)
47 . S BSDXATID=0 F S BSDXATID=$O(^BSDXAGTP("AC",BSDXAGID,BSDXATID)) Q:'+BSDXATID D
48 . . S BSDXNOD=$G(^BSDXTYPE(BSDXATID,0))
49 . . I BSDXNOD="" Q
50 . . I $P(BSDXNOD,U,2)=1 Q ;Inactive
51 . . S BSDXATN=$P(BSDXNOD,U)
52 . . S BSDXAGTID=$O(^BSDXAGTP("AC",BSDXAGID,BSDXATID,0))
53 . . I '+BSDXAGTID Q
54 . . I '$D(^BSDXAGTP(BSDXAGTID,0)) Q
55 . . S BSDXI=BSDXI+1
56 . . S ^BSDXTMP($J,BSDXI)=BSDXAGTID_U_BSDXAGID_U_BSDXAGN_U_BSDXATID_U_BSDXATN_$C(30)
57 . . Q
58 . Q
59 ;
60 S BSDXI=BSDXI+1
61 S ^BSDXTMP($J,BSDXI)=$C(31)
62 Q
63 ;
64ERR(BSDXI,BSDXID,BSDXERR) ;Error processing
65 S BSDXI=BSDXI+1
66 S ^BSDXTMP($J,BSDXI)=BSDXERR_"^^^^"_$C(30)
67 S BSDXI=BSDXI+1
68 S ^BSDXTMP($J,BSDXI)=$C(31)
69 Q
70 ;
71ETRAP ;EP Error trap entry
72 I '$D(BSDXI) N BSDXI S BSDXI=999
73 S BSDXI=BSDXI+1
74 D ERR(BSDXI,99,70)
75 Q
Note: See TracBrowser for help on using the repository browser.