source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDF2D3.m@ 1006

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

initial load of WorldVistAEHR

File size: 4.6 KB
Line 
1IBDF2D3 ;ALB/CJM - ENCOUNTER FORM - WRITE SELECTION LIST (cont'd) ;NOV 16,1992
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;**38**;APR 24, 1997
3 ;
4DISPLAY(SLCTN,COL,HEADER,SUBHDR) ;writes the selection to the list
5 N J,K,DA,ENTRY,VALUE,TYPE,UNDRLINE,OFFSET,LEN,FIRST,IBROW,IBCOL,BBBLS,ID,DISPLAY,NODE,SUB,WRAP,QTY,ND2
6 S UNDRLINE=$S(IBLIST("ULSLCTNS"):"U",1:"")
7 S FIRST=1,(ID,HEADER,DISPLAY,NODE)=""
8 ;
9 ;get the 0 node of the selection & the selection identifier
10 I SLCTN S:IBLIST("DYNAMIC") NODE=$G(@LOCATION@(SLCTN)) S:'IBLIST("DYNAMIC") NODE=$G(^IBE(357.3,SLCTN,0)),ND2=$G(^IBE(357.3,SLCTN,2)) S ID=$P(NODE,"^")
11 ;
12 ;if a place holder, determine its use as a subheader - dynamic lists don't have place holders
13 I 'IBLIST("DYNAMIC") D
14 .S QTY=$P(NODE,"^",9)
15 .I $P(NODE,"^",2) D
16 ..;turn of the use of any prior subhdr if it was used
17 ..I $P(NODE,"^",8) S SUBHDR=""
18 ..;determine if this is to be used as a subheader
19 ..S $P(NODE,"^",6)=$P(NODE,"^",6)
20 ..I $P(NODE,"^",7),$P(NODE,"^",6)]"" S SUBHDR=SUBHDR_" "_$$STRIP^IBDFU($P(NODE,"^",6))
21 ;
22 ;if place holder with text,just print the text and quit
23 I 'IBLIST("DYNAMIC"),$P(NODE,"^",2),$P(NODE,"^",6)]"" D Q
24 .I IBLIST("ULSLCTNS") D
25 ..D DRWSTR^IBDFU($$Y^IBDF2D,($$X^IBDF2D)+LINE,$P(IBLIST("SEP"),"|",2)_$P(NODE,"^",6),"U",CWIDTH-(2*LINE))
26 ..I NEEDUPR D DRWSTR^IBDFU(($$Y^IBDF2D)-1,($$X^IBDF2D)+LINE,"","U",CWIDTH-(2*LINE)) S NEEDUPR=0
27 .E D DRWSTR^IBDFU($$Y^IBDF2D,($$X^IBDF2D)+$L(IBLIST("SEP2"))+LINE,$P(NODE,"^",6))
28 .D DECREASE^IBDF2D(.COL)
29 ;
30 ;don't draw bubbles for place holders
31 I 'IBLIST("DYNAMIC"),$P(NODE,"^",2) N DRWBBL S DRWBBL=0
32 ;
33 I SLCTN,(IBLIST("DYNAMIC")!('$P(NODE,"^",2))) S CNT=CNT+1
34 ;
35 I 'IBFORM("COMPILED") I 'SLCTN,IBLIST("DYNAMIC") D
36 .S CNT=CNT+1
37 .S DISPLAY="#"_CNT
38 .S ID=""
39 ;
40 F K=1:1:(+IBLIST("BTWN")+1) D Q:COL("ROWSLEFT")<1
41 .S ENTRY=""
42 .S OFFSET=LINE
43 .F J=1-IBLIST("SC0"):1:8 S TYPE=IBLIST("SCTYPE",J) D:TYPE'=""
44 ..;S VALUE=""
45 ..S VALUE=$S(K=2:$G(WRAP(J)),1:"")
46 ..I TYPE=1,K'>1,SLCTN D S:(ID]"")&IBLIST("SCPIECE",J) DISPLAY=DISPLAY_$S(DISPLAY="":"",1:" :: ")_$E(VALUE,1,IBLIST("SCW",J)*(1+$S(IBLIST("BTWN"):1,1:0))) I IBLIST("BTWN"),$L(VALUE)>IBLIST("SCW",J) D WRAP
47 ...I IBLIST("SCPIECE",J)=0 S:SLCTN&(IBLIST("DYNAMIC")!('$P(NODE,"^",2))) VALUE="#"_CNT Q
48 ...I 'IBLIST("DYNAMIC") S DA=$O(^IBE(357.3,SLCTN,1,"B",J,"")) S:DA VALUE=$P($G(^IBE(357.3,SLCTN,1,DA,0)),"^",2) Q
49 ...;dynamic lists
50 ...S SUB=$$DATANODE^IBDFU1B(IBLIST("RTN"),IBLIST("SCPIECE",J))
51 ...I SUB]"" S VALUE=$P($G(@IBLIST("DATA_LOCATION")@(SUB,SLCTN)),"^",IBLIST("SCPIECE",J))
52 ...E S VALUE=$P(NODE,"^",IBLIST("SCPIECE",J))
53 ...;
54 ..S:TYPE=2 VALUE=$S(K'>1:IBLIST("SCSYMBOL",J),1:$J("",IBLIST("SCW",J)))
55 ..;I TYPE=1 I SLCTN,ID]"",K'>1,IBLIST("SCPIECE",J) S DISPLAY=DISPLAY_$S(DISPLAY="":"",1:" :: ")_$E(VALUE,1,(IBLIST("SCW",J))
56 ..S:TYPE=1 VALUE=$$PADRIGHT^IBDFU(VALUE,IBLIST("SCW",J))
57 ..I TYPE=2 I IBLIST("ROUTINE",J)]"",K'>1,DRWBBL S IBCOL=($$X^IBDF2D)+OFFSET+$L(IBLIST("SEP2"))+$L(ENTRY)+((IBLIST("SCW",J)-3)\2),IBROW=$$Y^IBDF2D+$S(IBLIST("BTWN"):.5,1:0),BBBLS(IBCOL)=J
58 ..I (TYPE=1)!('IBLIST("NOUL",J))!(K'=(+IBLIST("BTWN")+1))!(UNDRLINE'="U") D
59 ...S ENTRY=ENTRY_IBLIST("SEP2")_VALUE_IBLIST("SEP1")
60 ...S FIRST=0
61 ..E D
62 ...S NEEDUPR=1
63 ...S LEN=$S(FIRST:0,1:$L(ENTRY)-LINE)
64 ...S ENTRY=ENTRY_IBLIST("SEP2")_VALUE_IBLIST("SEP1")
65 ...I OFFSET+$L(ENTRY)=CWIDTH S ENTRY=$E(ENTRY,1,$L(ENTRY)-LINE)
66 ...D DRWSTR^IBDFU($$Y^IBDF2D,($$X^IBDF2D)+OFFSET,ENTRY,"U",LEN)
67 ...S OFFSET=OFFSET+$L(ENTRY),ENTRY="",FIRST=1
68 .I ENTRY'="" S ENTRY=$E(ENTRY,1,$L(ENTRY)-$L(IBLIST("SEP1"))) D DRWSTR^IBDFU($$Y^IBDF2D,($$X^IBDF2D)+OFFSET,ENTRY,$S(K'=(+IBLIST("BTWN")+1):"",1:UNDRLINE),$L(ENTRY)+$L(IBLIST("SEP2")))
69 .D DECREASE^IBDF2D(.COL)
70 ;
71 ;Writting bubbles to form tracking? Is the form NOT yet compiled? Otherwise, don't need to do anything with the bubbles
72 I (TRACKBBL)!('IBFORM("COMPILED")) S IBCOL="" F S IBCOL=$O(BBBLS(IBCOL)) Q:IBCOL="" S J=BBBLS(IBCOL) I IBLIST("ROUTINE",J)="BUBBLE" D
73 .;
74 .D:'TRACKBBL DRWBBL^IBDFM1(IBROW,IBCOL,IBLIST("INPUT_RTN"),ID,IBLIST("NAME"),"S"_IBLIST_"("_J,IBLIST("RULE",J),DISPLAY,HEADER,IBLIST("QLFR",J),IBLIST("DYNAMIC"),CNT,SUBHDR,$G(QTY),$G(ND2),$G(SLCTN))
75 .D:TRACKBBL TRACKBBL^IBDFM1("S"_IBLIST_"("_J,CNT,IBLIST("QLFR",J),IBLIST("INPUT_RTN"),DISPLAY,ID)
76 Q
77 ;
78WRAP ;
79 Q:IBLIST("SCW",J)<8
80 N FOUND,AT,I,CHAR S FOUND=0
81 S AT=IBLIST("SCW",J)+2
82 F I=0:1:IBLIST("SCW",J)\4 S AT=AT-1,CHAR=$E(VALUE,AT) I " /\-:;"[CHAR S FOUND=1 Q
83 I FOUND D
84 .S WRAP(J)=$E(VALUE,AT+$S(" -"[CHAR:1,1:0),AT+IBLIST("SCW",J))
85 .F I=1:1:IBLIST("SCW",J) I $E(WRAP(J),I)'=" " D Q
86 ..I I>1 S WRAP(J)=$E(WRAP(J),I,$L(WRAP(J)))
87 .S VALUE=$E(VALUE,1,AT-1)
88 E S WRAP(J)=$E(VALUE,IBLIST("SCW",J),2*IBLIST("SCW",J)-1),VALUE=$E(VALUE,1,IBLIST("SCW",J)-1)_"-"
89 Q
Note: See TracBrowser for help on using the repository browser.