source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORWORDG.m@ 1396

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1ORWORDG ; SLC/KCM/JLI - Organize display groups;11:25 AM 11 Mar 1998 3/2/02 4PM
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,141**;Dec 17, 1997
3 ;
4MAPSEQ(Y) ; similar to GRPSEQB, for 32bit
5 N C,I,X
6 D GRPSEQ(.X)
7 S C=0,I=0
8 F S I=$O(X(I)) Q:I="" S C=C+1,Y(C)=I_"="_X(I)_U_$P(^ORD(100.98,I,0),U,2)
9 Q
10GRPSEQB(Y) ;
11 ; Call GRPSEQ, format for broker:
12 ; Y(n)=Ptr to Display Group ^ Sequence ^ Top Level Display Group Name
13 N C,I,X
14 D GRPSEQ(.X)
15 S C=0,I=0
16 F S I=$O(X(I)) Q:I="" S C=C+1,Y(C)=I_U_X(I)
17 Q
18GRPSEQ(BYGRP) ;
19 ; Expanded list of display groups with sequence as value
20 N I,ORY,TOPINFO
21 D GETLST^XPAR(.ORY,"ALL","ORWOR CATEGORY SEQUENCE")
22 S I=0 F S I=$O(ORY(I)) Q:I="" D
23 . S BYGRP($P(ORY(I),U,2))=$P(ORY(I),U,1)_U_$P(^ORD(100.98,$P(ORY(I),U,2),0),U,2)
24 S I=0 F S I=$O(BYGRP(I)) Q:I="" S TOPINFO=BYGRP(I) D EXPAND(I)
25 Q
26EXPAND(GROUP) ;
27 ; (used by GRPSEQ)
28 N I,CHILD
29 S I=0 F S I=$O(^ORD(100.98,GROUP,1,I)) Q:I<1 D
30 . S CHILD=$P(^ORD(100.98,GROUP,1,I,0),"^",1)
31 . I '$D(BYGRP(CHILD)) S BYGRP(CHILD)=TOPINFO D EXPAND(CHILD)
32 Q
33ALLTREE(LST) ; Return the tree for all display groups
34 N ROOT,ILST
35 S ILST=0,ROOT=$O(^ORD(100.98,"B","ALL",0))
36 S ILST=ILST+1,LST(ILST)=ROOT_U_"ALL SERVICES^0^+"
37 D LSTCHLD(ROOT)
38 Q
39LSTCHLD(PARENT) ; list descendends of this node (recursive)
40 N CHILD,I
41 S I=0 F S I=$O(^ORD(100.98,PARENT,1,I)) Q:'I D
42 . S CHILD=+^ORD(100.98,PARENT,1,I,0)
43 . S ILST=ILST+1,LST(ILST)=CHILD_U_$P(^ORD(100.98,CHILD,0),U)_U_PARENT
44 . I $D(^ORD(100.98,CHILD,1))>1 D
45 . . S LST(ILST)=LST(ILST)_"^+"
46 . . D LSTCHLD(CHILD)
47 Q
48REVSTS(LST) ; Return the status flags available for review orders
49 ;N I,X,T S ILST=0
50 ;F I=1:1 S T="ORDSTS+"_I_"^ORCHANG2" S X=$T(@T) Q:$P(X,";",4)="ZZZZ" D
51 ;. S ILST=ILST+1,LST(ILST)=$P(X,";",3)_U_$P(X,";",4)
52 D STSLST^ORCHANG2(.LST)
53 Q
54IEN(VAL,X) ; Return IEN for a display group
55 S VAL=$O(^ORD(100.98,"B",X,0))
56 Q
Note: See TracBrowser for help on using the repository browser.