source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SCRPBK5.m@ 1147

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1SCRPBK5 ;MJK/ALB - RPC Broker Utilities ; 27 FEB 96
2 ;;5.3;Scheduling;**41**;AUG 13, 1993
3 ;
4PARSE(SCQDEF,SCQREC) ; -- parse incoming raw broker array
5 ; -- return formatted query record
6 ;
7 ; -- SEE BOTTOM OF SCRPBK FOR VARIABLE DEFINITIONS
8 ;
9 N SCINC,X
10 ;
11 ; -- build internal formatted variables
12 S SCINC=1,X=SCQDEF(SCINC)
13 S SCQREC("NAME")=$P(X,U)
14 S SCQREC("CREATORID")=+$P(X,U,2)
15 S SCQREC("ACCESSID")=+$P(X,U,3)
16 S SCQREC("REPORTID")=+$P(X,U,4)
17 ;
18 ; -- build external formatted variables
19 S SCINC=2,X=SCQDEF(SCINC)
20 S SCQREC("QUERYID")=$P(X,U)
21 S SCQREC("CREATOR")=$P(X,U,2)
22 S SCQREC("ACCESS")=$P(X,U,3)
23 S SCQREC("REPORT")=$P(X,U,4)
24 ;
25 F S SCINC=$O(SCQDEF(SCINC)) Q:'SCINC S X=$G(SCQDEF(SCINC)) D
26 . IF X="[Description]" D DESC(.SCINC,.SCQDEF,.SCQREC)
27 . ; -- get fields
28 . IF X="[Fields]" D FIELDS(.SCINC,.SCQDEF,.SCQREC)
29 . ; -- get files
30 . IF X="[Selections]" D SELECT(.SCINC,.SCQDEF,.SCQREC)
31 Q
32 ;
33DESC(SCINC,SCQDEF,SCQREC) ; -- build query description
34 N I,X
35 S I=0
36 F S SCINC=$O(SCQDEF(SCINC)) Q:'SCINC S X=$G(SCQDEF(+SCINC)) Q:X="$$END" D
37 . S I=I+1,SCQREC("DESCRIPTION",I,0)=X
38 Q
39 ;
40FIELDS(SCINC,SCQRY,SCQREC) ; -- build field answeredk
41 N X
42 F S SCINC=$O(SCQDEF(SCINC)) Q:'SCINC S X=$G(SCQDEF(+SCINC)) Q:X="$$END" D
43 . S SCQREC("FIELDS",$P(X,U))=$P(X,U,2)
44 Q
45 ;
46SELECT(SCINC,SCQRY,SCQREC) ; -- build file entries selected
47 N X
48 F S SCINC=$O(SCQDEF(SCINC)) Q:'SCINC S X=$G(SCQDEF(+SCINC)) Q:X="$$END" D
49 . S SCQREC("SELECTIONS",$P(X,U,2),$$SEL(X))=""
50 Q
51 ;
52SEL(SEL) ; -- set vp for selection
53 N Y,IEN,SCTYPE
54 S SCTYPE=$P(SEL,U,2),IEN=+$P(SEL,U,3),Y="NOT VALID: "_SCTYPE
55 IF SCTYPE="DIVISION" S Y="DIC(4," G SELQ
56 IF SCTYPE="TEAM" S Y="SCTM(404.51," G SELQ
57 IF SCTYPE="PRACTITIONER" S Y="VA(200," G SELQ
58 IF SCTYPE="ROLE" S Y="SD(403.46," G SELQ
59 IF SCTYPE="CLINIC" S Y="SC(" G SELQ
60 IF SCTYPE="USERCLASS" S Y="USR(8930," G SELQ
61SELQ Q IEN_";"_Y
62 ;
Note: See TracBrowser for help on using the repository browser.