source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQCON.m@ 1710

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

initial load of WorldVistAEHR

File size: 2.5 KB
RevLine 
[613]1VAQCON ;ALB/JRP - MESSAGE CONSTRUCTION;14-APR-93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3XMIT(TRANARR,ROOT,MESSNUM,ARRAY,OFFSET) ;BUILD MESSAGE FOR TRANSACTION
4 ;INPUT : TRANARR - Array whose subscripts are pointers to
5 ; VAQ - TRANSACTION file (full global reference)
6 ; ROOT - Location of Extraction Arrays (full global reference)
7 ; MESSNUM - Message number to place transmisison into
8 ; (if 0, transmission will be placed in ARRAY)
9 ; ARRAY - Array to store transmission in (full global reference)
10 ; OFFSET - Where to begin placing information (defaults to 0)
11 ;OUTPUT : N - Number of lines in transmission
12 ; -1^Error_Text - Error
13 ;NOTES : Transactions pointed to by TRANARR will be placed in the
14 ; same transmission and therefore should have the same domain
15 ; as their destination.
16 ; : If MESSNUM=0, then the transmission will be placed into
17 ; ARRAY(LineNumber)=Line_of_info
18 ; If MESSNUM>0 then the transmission will be placed into
19 ; ^XMB(3.9,MESSNUM,2,LineNumber,0)=Line_of_info
20 ; : The first subscript in ROOT must be a pointer to the
21 ; transaction. The second subscript in ROOT must be the
22 ; segment abbreviation. This is required to identify the
23 ; segments for each transaction contained in a DATA or DISPLAY
24 ; block. ( ROOT(TransactionPointer,SegmentAbbreviation) )
25 ;
26 ;CHECK INPUT
27 Q:($G(TRANARR)="") "-1^Did not pass reference to array of transaction pointers"
28 S ROOT=$G(ROOT)
29 S MESSNUM=+$G(MESSNUM)
30 I (('MESSNUM)&($G(ARRAY)="")) Q "-1^Did not pass message number or reference to output array"
31 I (MESSNUM) Q:('$D(^XMB(3.9,MESSNUM))) "-1^Valid message number not passed"
32 S OFFSET=+$G(OFFSET)
33 ;DECLARE VARIABLES
34 N TMP,X,LINE,TRANPTR,Y,TMPROOT
35 S LINE=OFFSET
36 ;START PDX TRANSMISSION
37 S TMP="$TRANSMIT"
38 S:('MESSNUM) @ARRAY@(LINE)=TMP
39 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
40 S LINE=LINE+1
41 ;LOOP THROUGH EACH TRANSACTION
42 S TRANPTR=""
43 F S TRANPTR=$O(@TRANARR@(TRANPTR)) Q:('TRANPTR) D Q:(TMP<0)
44 .;PLACE TRANSACTION POINTER INTO ROOT
45 .S TMP=$P(ROOT,"(",1)
46 .S X=$P(ROOT,"(",2)
47 .S Y=$P(X,")",1)
48 .S:(Y="") TMPROOT=TMP_"("_TRANPTR_")"
49 .S:(Y'="") TMPROOT=TMP_"("_Y_","_TRANPTR_")"
50 .S:(ROOT="") TMPROOT=""
51 .;PUT IN MESSAGE
52 .S TMP=$$MESSAGE^VAQCON0(TRANPTR,TMPROOT,MESSNUM,ARRAY,LINE)
53 .Q:(TMP<0)
54 .S LINE=LINE+TMP
55 Q:(TMP<0) TMP
56 ;END PDX TRANSMISSION
57 S TMP="$$TRANSMIT"
58 S:('MESSNUM) @ARRAY@(LINE)=TMP
59 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
60 S LINE=LINE+1
61 Q (LINE-OFFSET)
Note: See TracBrowser for help on using the repository browser.