source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQCON3.m@ 1211

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1VAQCON3 ;ALB/JRP - MESSAGE CONSTRUCTION;12-APR-93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3USER(TRANPTR,MESSNUM,ARRAY,OFFSET) ;CONSTRUCT USER BLOCK
4 ;INPUT : TRANPTR - Pointer to VAQ - TRANSACTION file
5 ; MESSNUM - Message number to place block into
6 ; (if 0, block will be placed in ARRAY)
7 ; ARRAY - Array to store block in (full global reference)
8 ; OFFSET - Where to begin placing information (defaults to 0)
9 ;OUTPUT : N - Number of lines in block
10 ; -1^Error_Text - Error
11 ;NOTES : If MESSNUM=0, then the block will be placed into
12 ; ARRAY(LineNumber)=Line_of_info
13 ; If MESSNUM>0 then the block will be placed into
14 ; ^XMB(3.9,MESSNUM,2,LineNumber,0)=Line_of_info
15 ;
16 ;CHECK INPUT
17 S TRANPTR=+$G(TRANPTR)
18 Q:(('TRANPTR)!('$D(^VAT(394.61,TRANPTR)))) "-1^Did not pass a valid pointer to VAQ - TRANSACTION file"
19 S MESSNUM=+$G(MESSNUM)
20 I (('MESSNUM)&($G(ARRAY)="")) Q "-1^Did not pass message number of reference to array"
21 I (MESSNUM) Q:('$D(^XMB(3.9,MESSNUM))) "-1^Valid message number not passed"
22 S OFFSET=+$G(OFFSET)
23 ;DECLARE VARIABLES
24 N TMP,USER,FACNAME,LINE,X,USERDUZ
25 S LINE=OFFSET
26 ;DETERMINE SENDER
27 S TMP=$$SENDER^VAQCON2(TRANPTR)
28 Q:(+TMP=-1) "-1^Could not determine sender of message"
29 S USER=$P(TMP,"^",1)
30 S USERDUZ=$P(TMP,"^",2)
31 ;DETERMINE FACILITY NAME (IF NOT IN PARAMETER FILE TRY GETTING FROM
32 ; 'STATION NUMBER' FILE)
33 S FACNAME=""
34 S TMP=+$O(^VAT(394.81,0))
35 I (TMP) S X=+$G(^VAT(394.81,TMP,0)) S:(X) FACNAME=$P($G(^DIC(4,X,0)),"^",1)
36 S:(FACNAME="") FACNAME=$P($$SITE^VASITE,"^",2)
37 Q:(FACNAME="") "-1^Could not determine facility name"
38 ;LINE 1
39 S TMP="$USER"
40 S:('MESSNUM) @ARRAY@(LINE)=TMP
41 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
42 S LINE=LINE+1
43 ;LINE 2
44 S TMP=USER
45 S:('MESSNUM) @ARRAY@(LINE)=TMP
46 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
47 S LINE=LINE+1
48 ;LINE 3
49 S TMP=USERDUZ
50 S:('MESSNUM) @ARRAY@(LINE)=TMP
51 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
52 S LINE=LINE+1
53 ;LINE 4
54 S TMP=FACNAME
55 S:('MESSNUM) @ARRAY@(LINE)=TMP
56 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
57 S LINE=LINE+1
58 ;LINE 5
59 S TMP="$$USER"
60 S:('MESSNUM) @ARRAY@(LINE)=TMP
61 S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
62 S LINE=LINE+1
63 Q (LINE-OFFSET)
Note: See TracBrowser for help on using the repository browser.