1 | GMRADSP8 ;HIRMFO/WAA-DISPLAY ALLERGY ;9/6/95 11:06
|
---|
2 | ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
|
---|
3 | DISPLAY(ARRAY) ;This subroutine will print out the Reactant
|
---|
4 | ; ARRAY is the array that is passed
|
---|
5 | N CNT
|
---|
6 | Q:'$D(ARRAY)
|
---|
7 | D WRITE(1,0,.ARRAY,.GMRAOUT,"HEAD^GMRADSP8")
|
---|
8 | Q
|
---|
9 | HEAD ;Print the top of page for the display
|
---|
10 | W #
|
---|
11 | D WRITE(2,68,"OBS/")
|
---|
12 | D WRITE(1,0,"REACTANT"),WRITE(0,53,"VER."),WRITE(0,59," MECH. "),WRITE(0,68,"HIST"),WRITE(0,74,"TYPE")
|
---|
13 | D WRITE(1,0,"--------"),WRITE(0,53,"----"),WRITE(0,59,"-------"),WRITE(0,68,"----"),WRITE(0,74,"----")
|
---|
14 | Q
|
---|
15 | ;
|
---|
16 | WRITE(NL,TAB,STRING,GMRAOUT,HEAD) ; This will display all the
|
---|
17 | ; text in a given string.
|
---|
18 | ; Requited Variables:
|
---|
19 | ; NL = Numeric repersentation of New lines
|
---|
20 | ; = 0 No new line
|
---|
21 | ; TAB = Number of tab spaces from the las given position
|
---|
22 | ; STRING = The array of text to be printed.
|
---|
23 | ; STRING(X) = Continue of string
|
---|
24 | ; NOTE: This continuation will line feed and tab the same
|
---|
25 | ; as the string itself.
|
---|
26 | ; Optional variables
|
---|
27 | ; GMRAOUT = The status of the Up-arrow out of a system.
|
---|
28 | ; = "" use Page break function
|
---|
29 | ; HEAD = HEADER SUB-ROUTINE
|
---|
30 | ;
|
---|
31 | S GMRAOUT=$G(GMRAOUT),HEAD=$G(HEAD)
|
---|
32 | N GMAI,GMAX
|
---|
33 | I $G(STRING)'="" D Q:GMRAOUT W ?TAB,STRING
|
---|
34 | .I NL F GMAI=1:1:NL S:GMRAOUT'="" GMRAOUT=$$PAGE(HEAD) Q:GMRAOUT W !
|
---|
35 | .Q
|
---|
36 | S GMAX=0 F S GMAX=$O(STRING(GMAX)) Q:GMAX<1 D Q:GMRAOUT W ?TAB,STRING(GMAX)
|
---|
37 | .I NL F GMAI=1:1:NL S:GMRAOUT'="" GMRAOUT=$$PAGE(HEAD) Q:GMRAOUT W !
|
---|
38 | .Q
|
---|
39 | Q
|
---|
40 | PAGE(HEAD) ; Bottom of page program
|
---|
41 | ; Input variable:
|
---|
42 | ; HEAD = Header program to be run
|
---|
43 | ;
|
---|
44 | S GMRAOUT=0
|
---|
45 | D:$Y>(IOSL-3)
|
---|
46 | .N DIR,Y
|
---|
47 | .S DIR(0)="E",DIR("A")="Press RETURN to continue or '^' to stop listing"
|
---|
48 | .S DIR("?")=" Press RETURN to continue, '^' stop reactant listing."
|
---|
49 | .W ! D ^DIR I Y D:HEAD'="" @HEAD Q ;User hit return
|
---|
50 | .I $D(DTOUT)!$D(DIROUT) S GMRAOUT=1
|
---|
51 | .I $D(DUOUT) S GMRAOUT=2
|
---|
52 | .K DIROUT,DTOUT,DIRUT,DUOUT
|
---|
53 | .Q
|
---|
54 | Q GMRAOUT
|
---|