source: FOIAVistA/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQCON8.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1VAQCON8 ;ALB/JRP - MESSAGE CONSTRUCTION;2-SEP-93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3DISPLAY(TRANPTR,SEGABB,DSPARR,STARTOFF,DSPSIZE,MESSNUM,ARRAY,OFFSET) ;CONSTRUCT DISPLAY BLOCK
4 ;INPUT : TRANPTR - Pointer to VAQ - TRANSACTION file
5 ; SEGABB - Segment abbreviation for segment
6 ; DSPARR - Location of displayable Extraction Array
7 ; (full global reference)
8 ; STARTOFF - Where information in DSPARR begins (defaults to 0)
9 ; DSPSIZE - Number of lines in DSPARR to move (defaults to all)
10 ; MESSNUM - Message number to place block into
11 ; (if 0, block will be placed in ARRAY)
12 ; ARRAY - Array to store block in (full global reference)
13 ; OFFSET - Where to begin placing information (defaults to 0)
14 ;OUTPUT : N - Number of lines in block
15 ; -1^Error_Text - Error
16 ;NOTES : If MESSNUM=0, then the block will be placed into
17 ; ARRAY(LineNumber)=Line_of_info
18 ; If MESSNUM>0 then the block will be placed into
19 ; ^XMB(3.9,MESSNUM,2,LineNumber,0)=Line_of_info
20 ;
21 ;CHECK INPUT
22 S TRANPTR=+$G(TRANPTR)
23 Q:(('TRANPTR)!('$D(^VAT(394.61,TRANPTR)))) "-1^Did not pass a valid pointer to VAQ - TRANSACTION file"
24 Q:($G(SEGABB)="") "-1^Did not pass segment abbreviation"
25 Q:($G(DSPARR)="") "-1^Did not pass location of Extraction Array"
26 S STARTOFF=+$G(STARTOFF)
27 S DSPSIZE=$G(DSPSIZE)
28 S MESSNUM=+$G(MESSNUM)
29 I (('MESSNUM)&($G(ARRAY)="")) Q "-1^Did not pass message number of reference to array"
30 I (MESSNUM) Q:('$D(^XMB(3.9,MESSNUM))) "-1^Valid message number not passed"
31 S OFFSET=+$G(OFFSET)
32 ;DECLARE VARIABLES
33 N TMP,LINE,STOP,NCRYPTON,START,X
34 S LINE=OFFSET
35 ;DETERMINE IF ENCRYPTION WAS TURNED ON
36 S NCRYPTON=$$TRANENC^VAQUTL3(TRANPTR,0)
37 ;DETERMINE NUMBER OF LINES IN DISPLAY (IF NOT PASSED)
38 I (DSPSIZE="") D
39 .S DSPSIZE=0
40 .S START=STARTOFF-.999999999
41 .F S START=$O(@DSPARR@("DISPLAY",START)) Q:(START="") S DSPSIZE=DSPSIZE+1
42 ;LINE 1
43 S TMP="$DISPLAY"
44 S:('MESSNUM) @ARRAY@(LINE)=TMP
45 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
46 S LINE=LINE+1
47 ;LINE 2
48 S TMP=SEGABB
49 S:('MESSNUM) @ARRAY@(LINE)=TMP
50 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
51 S LINE=LINE+1
52 ;LINE 3
53 S TMP=NCRYPTON_"^"_DSPSIZE
54 S:('MESSNUM) @ARRAY@(LINE)=TMP
55 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
56 S LINE=LINE+1
57 ;LINES IN SEGMENT
58 S STOP=0
59 I (DSPSIZE) D
60 .S START=STARTOFF-.999999999
61 .F S START=$O(@DSPARR@("DISPLAY",START)) Q:((START="")!(STOP>(DSPSIZE-1))) D
62 ..S TMP=$G(@DSPARR@("DISPLAY",START,0))
63 ..S:('MESSNUM) @ARRAY@(LINE)=TMP
64 ..S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
65 ..S LINE=LINE+1
66 ..S STOP=STOP+1
67 ;ADJUST DISPLAY SIZE IN LINE 3 (IF NEEDED)
68 I (STOP<DSPSIZE) D
69 .S TMP=NCRYPTON_"^"_STOP
70 .S:('MESSNUM) @ARRAY@(OFFSET+2)=TMP
71 .S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,(OFFSET+2))
72 ;LINE Z
73 S TMP="$$DISPLAY"
74 S:('MESSNUM) @ARRAY@(LINE)=TMP
75 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
76 S LINE=LINE+1
77 Q (LINE-OFFSET)
Note: See TracBrowser for help on using the repository browser.