source: FOIAVistA/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUU.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1TIUU ; SLC/JER - Utility subroutines for Discharge Summary ;9/7/94 16:37
2 ;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997;
3TITLE(X) ; Pads titles
4 ; Recieves: X=title to be padded
5 N I,TITLE
6 S TITLE="" F I=1:1:$L(X) S TITLE=TITLE_" "_$E(X,I)
7 Q TITLE
8JUSTIFY(X,JUST) ; Justifies Text
9 ; Receives: X=text to be justified
10 ; JUST="L" --> left, "C" --> center, "R" --> right,
11 ; "J" --> justified to WIDTH
12 ; WIDTH=justification width (when JUST="j"
13 I "Cc"[JUST W ?((80-$L(X))/2),X
14 I "Ll"[JUST W X,!!
15 I "Rr"[JUST W ?(80-$L(X)),X
16 Q
17STOP(PROMPT,SCROLL) ; Call DIR at bottom of screen
18 N DIR,X,Y
19 I $E(IOST)'="C" S Y="" G STOPX
20 I +$G(SCROLL),(IOSL>($Y+5)) F W ! Q:IOSL<($Y+6)
21 S DIR(0)="FO^1:1",DIR("A")=$S($G(PROMPT)]"":PROMPT,1:"Press RETURN to continue or '^' to exit")
22 S DIR("?")="Enter '^' to quit present action or '^^' to quit to menu"
23 D ^DIR I $D(DIRUT),(Y="") K DIRUT
24 S Y=$S(Y="^":0,Y="^^":0,$D(DTOUT):"",Y="":1,1:1_U_Y)
25STOPX Q Y
26READ(TYPE,PROMPT,DEFAULT,HELP,SCREEN) ; Calls reader, returns response
27 N DIR,X,Y
28 S DIR(0)=TYPE
29 I $D(SCREEN) S DIR("S")=SCREEN
30 I $G(PROMPT)]"" S DIR("A")=PROMPT
31 I $G(DEFAULT)]"" S DIR("B")=DEFAULT
32 I $D(HELP) S DIR("?")=HELP
33 D ^DIR
34 I $G(X)="@" S Y="@" G READX
35 I Y]"",($L($G(Y),U)'=2) S Y=Y_U_$G(Y(0),Y)
36READX Q Y
37UPDATE ; Updates fields in review screen
38 ; Receives: X=new value of field
39 ; FLD=name of field to be modified
40 I $D(^TMP("TIUVIEW",$J,3,0)),+$G(TIUDA) D
41 . S ^TMP("TIUVIEW",$J,3,0)=$$SETSTR^VALM1("SIG STATUS: "_$P($$STATUS^TIULC(TIUDA),U,2),$G(^TMP("TIUVIEW",$J,3,0)),38,41)
42 Q
43LISTREAD(TIULIST,ANSTYPE) ; Present list to user for selection of item(s)
44 N TIUI,TIUL,TIUY S (TIUI,TIUY)=0
45 S ANSTYPE=$S($G(ANSTYPE)]"":$G(ANSTYPE),1:"N")
46 F S TIUI=$O(TIULIST(TIUI)) Q:+TIUI'>0 D
47 . W !,TIUI,?5,$P(TIULIST(TIUI),U,2) S TIUL=TIUI
48 I +$G(TIUL) D
49 . W !
50 . S TIUY=$$READ(ANSTYPE_"A^1:"_TIUL,"Select "_$P(TIULIST,U)_": ")
51 . I +TIUY S TIUY=$G(TIULIST(+TIUY))
52 Q TIUY
Note: See TracBrowser for help on using the repository browser.