source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCUTBK1.m@ 1203

Last change on this file since 1203 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1SCUTBK1 ;ALB/MJK - Scheduling Broker Utilities ;[ 03/08/95 3:41 PM ]
2 ;;5.3;Scheduling;**41,297,498**;AUG 13, 1993;Build 23
3 ;
4 Q
5 ;
6DIKC(SCOK,SC) ; -- broker callback to kill a file entry
7 ;
8 N DIK,DA
9 D CHK^SCUTBK
10 ;
11 ; -- array parsing
12 S DIK=$G(SC("ROOT"))
13 S DA=+$G(SC("IEN"))
14 ;
15 IF DIK]"",$D(@(DIK_DA_",0)")) D
16 . D ^DIK
17 . S SCOK=1
18 ELSE D
19 . S SCOK=0
20 Q
21 ;
22LOCKC(SCOK,SC) ; -- broker callback to lock/unlock a node
23 ;
24 N SCNODE
25 D CHK^SCUTBK
26 ;
27 ; -- array parsing
28 S SCNODE=$G(SC("NODE"))
29 I SCNODE[",)" S SCOK=1 Q
30 ;
31 IF SCNODE]"" D
32 . IF $G(SC("LOCKMODE")) D
33 . . L @("+"_SCNODE_":"_$G(SC("TIMEOUT"),5))
34 . . S SCOK=$T
35 . ELSE D
36 . . L @("-"_SCNODE)
37 . . S SCOK=1
38 ELSE D
39 . S SCOK=0
40 Q
41 ;
42FILENOC(SCFLNO,SCNAME) ; -- broker callback to get File #
43 ;
44 D CHK^SCUTBK
45 S SCFLNO=+$O(^DIC("B",SCNAME,""))
46 Q
47 ;
48NODEC(SCNODE,SCROOT) ; -- broker callback to get global node value
49 ;
50 D CHK^SCUTBK
51 ;S SCNODE=$G(@SCROOT)
52 IF $D(@SCROOT)=0!($D(@SCROOT)=10) D
53 . S SCNODE="{{"_$D(@SCROOT)_"}}"
54 IF $D(@SCROOT)=1!($D(@SCROOT)=11) D
55 . S SCNODE=$G(@SCROOT)
56 Q
57 ;
58GLCNT(SCOK,SC) ; -- extrinsic call to invoke broker to return number of
59 ; global nodes found at cross reference
60 N SCNODE,SCTEAM,SCXREF,SCFRST
61 D CHK^SCUTBK
62 ;
63 S (SCFRST,SCOK)=""
64 S SCNODE=$G(SC("ROOT"))
65 S SCXREF=$G(SC("XREF"))
66 S SCVAL=$G(SC("VALUE"))
67 ;
68 S:SCXREF="" SCXREF="B"
69 S I="",X=0
70 F S I=$O(@SCNODE@(SCXREF,SCVAL,I)) Q:I="" D
71 . S X=X+1
72 S SCOK=$G(X)
73 Q
74 ;
75IFNODE(SCNODE,SCROOT) ; -- extrinsic call to check if node exists.
76 ; passes in full node reference.
77 N X
78 D CHK^SCUTBK
79 ;
80 IF $D(@SCROOT)=0!($D(@SCROOT)=10) D
81 . S SCNODE="{{"_$D(@SCROOT)_"}}"
82 IF $D(@SCROOT)=1!($D(@SCROOT)=11) D
83 . S SCNODE=$G(@SCROOT)
84 Q
85 ;
86PRTP(SCACTV,SC) ;
87 ;
88 N SCRTN,SCERRX,SCOK,SCIEN,SCKDT
89 D TMP^SCUTBK
90 D CHK^SCUTBK
91 ;
92 I $G(SC("IEN"))=0 D G PRTPQ
93 . S SCACTV=0
94 S SCIEN=SC("IEN")
95 ;
96 S SCKDT=""
97 S SCKDT("BEGIN")=$G(SC("BEGIN"),DT)
98 S SCKDT("END")=$G(SC("END"),DT)
99 S SCKDT("INCL")=$G(SC("INCL"),0)
100 ;
101 S SCOK=$$PRTP^SCAPMC8(SCIEN,"SCKDT","SCRTN","SCERRX")
102 S SCACTV=$S(SCOK:$G(SCRTN(1),"0"),1:"0")
103PRTPQ Q
Note: See TracBrowser for help on using the repository browser.