source: WorldVistAEHR/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUFLLM.m@ 1261

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1TIUFLLM ; SLC/MAM - Library; List Manager Related: RTSCROLL(TIUREC,TYPE), PARSE(INFO), NINFO(LINENO,FILEDA,INFO,PINFO,TENDA), PLUSUP(INFO,TIUREC) ;4/6/95 10:48
2 ;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997
3 ;
4RTSCROLL(TIUREC,TYPE) ; Called by BUFENTRY^TIUFLLM2. For lines being set for
5 ;Templates HACJ only. Copy chars 15-20, 44-49 of entry into chars
6 ;215-220, 244-249. Depending on rt/left scroll position, replace those
7 ;chars w Type.
8 ; Requires TIUREC, TYPE from BUFENTRY.
9 ; TIUFLFT, TIUFIXED are for updating lines in H/A/C/J from Template D or T.
10 S TIUREC=$$SETSTR^VALM1($E(TIUREC,15,20),TIUREC,215,6)
11 S TIUREC=$$SETSTR^VALM1($E(TIUREC,43,48),TIUREC,243,6)
12 I $G(TIUFLFT)>49 D
13 . I TIUFTMPL="J" D Q
14 . . I $G(VALM("FIXED"))=20!($G(TIUFIXED)=20) S TIUREC=$$SETSTR^VALM1(" ",TIUREC,20,1) Q
15 . D
16 . . S TYPE=" "_TYPE_" "
17 . . I $G(VALM("FIXED"))=20!($G(TIUFIXED)=20) S TIUREC=$$SETSTR^VALM1(TYPE,TIUREC,15,6) Q
18 . . S TIUREC=$$SETSTR^VALM1(TYPE,TIUREC,43,6)
19 Q
20 ;
21PARSE(INFO) ; Splits INFO into pieces such as LINENO, XPDLCNT, etc.
22 ;Sets INFO pieces into subscripts.
23 ;Requires INFO, where INFO is either as set in NINFO^TIUFLLM or
24 ;in UPDATE^TIUFLLM1 or = ^TMP("TIUFIDX,$J,LINENO).
25 ; WARNING: +INFO may be set by NINFO or UPDATE to 0!
26 ; Other pieces of INFO may be 0 or ""!
27 N LINENO,FILEDA,XPDLCNT,LEVEL,PLINENO,TENDA,PLINENO
28 S LINENO=+INFO,FILEDA=$P(INFO,U,2),XPDLCNT=$P(INFO,U,3),LEVEL=$P(INFO,U,4),PLINENO=$P(INFO,U,5),TENDA=$P(INFO,U,6)
29 S INFO("LINENO")=LINENO,INFO("FILEDA")=FILEDA
30 S INFO("XPDLCNT")=XPDLCNT,INFO("LEVEL")=LEVEL,INFO("PLINENO")=PLINENO,INFO("TENDA")=TENDA
31PARSX Q
32 ;
33NINFO(LINENO,FILEDA,INFO,PINFO,TENDA) ; Returns INFO for New (anticipated)
34 ;LM Entry, where INFO = LINENO^FILEDA^XPDLCNT^LEVEL^PLINENO^TENDA or
35 ;INFO = Error msg
36 ; Requires LINENO = anticipated List Manager Entry #
37 ; Requires FILEDA = 8925.1 IFN of new entry
38 ; PINFO, TENDA are required IF new Entry has existing parent LM Entry
39 ;on current or parent LM Template H.
40 ; PINFO has form of INFO, above, but for LM parent of new entry.
41 ; TENDA = LINENO's DA in parent item multiple (10 Node).
42 ; XPDLCNT = # of lines entry has been expanded, = 0 for new entry.
43 ; LEVEL = LINENO hierarchy level. Clinical Documents has LEVEL 0. Used
44 ;for right shift for Template H.
45 ; Module sets LEVEL,PLINENO,TENDA = 0 IF new entry has no existing parent.
46 N XPDLCNT,LEVEL,PLINENO
47 S XPDLCNT=0
48 S LEVEL=$S($G(PINFO):$P(PINFO,U,4)+1,1:0),PLINENO=+$G(PINFO),TENDA=+$G(TENDA)
49 S INFO=LINENO_U_FILEDA_U_XPDLCNT_U_LEVEL_U_PLINENO_U_TENDA
50NINFX Q
51 ;
52PLUSUP(INFO,TIUREC) ; Update the plus item indicator in front of LM Entry Name for Template H.
53 ; Assumes Name proper starts at col 8, for level 0. + goes in front of Name.
54 ; Returns TIUREC with + added or deleted.
55 ; Requires INFO array, where INFO is either as set in NINFO^TIUFLLM or
56 ;is = ^TMP("TIUFIDX,$J,LINENO), and where INFO array is as set in
57 ;PARSE^TIUFLLM(INFO).
58 ; Requires TIUREC = LM Entry as in TIUF1 array.
59 ; INFO("XPDLCNT") must anticipate next redisplay of screen - whether
60 ;Entry will/not be expanded.
61 N HASITEMS,LEVEL,NMCOLUMN,COLUMN,PLUS
62 S LEVEL=INFO("LEVEL"),HASITEMS=$$HASITEMS^TIUFLF1(INFO("FILEDA"))
63 S PLUS=" "
64 I HASITEMS,'INFO("XPDLCNT") S PLUS="+"
65 S NMCOLUMN=8,COLUMN=NMCOLUMN+(2*LEVEL)-1
66 S TIUREC=$$SETSTR^VALM1(PLUS,TIUREC,COLUMN,1)
67 Q TIUREC
68 ;
Note: See TracBrowser for help on using the repository browser.