source: FOIAVistA/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQBUL01.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 4.3 KB
Line 
1VAQBUL01 ;ALB/JRP - BULLETINS;10-MAR-93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3ERR2USR ;SEND ERROR MESSAGE TO SENDER IF ALL TRANSMISSIONS WHERE NOT SENT
4 ; DECLARATIONS TAKEN CARE OF IN GENXMIT^VAQADM50
5 S TMP="UNABLE TO SEND MESSAGES"
6 S XMZ=$$MAKESTUB^VAQCON1(TMP,"PDX")
7 Q:(XMZ<1)
8 S LINE=1
9 ;PUT IN ERROR MESSAGE
10 S TMP="The following message(s) could not be transmitted ..."
11 S X=$$ADDLINE^VAQCON1(TMP,XMZ,LINE)
12 S LINE=LINE+1
13 S TRANS=""
14 S ERRNUM=1
15 F S TRANS=$O(@ARRAY3@(TRANS)) Q:('TRANS) D
16 .F TMP=1:1:2 S X=$$ADDLINE^VAQCON1("",XMZ,LINE),LINE=LINE+1
17 .S X=+$G(^VAT(394.61,TRANS,0))
18 .S TMP="("_ERRNUM_") Transaction Number: "_X
19 .S X=$$ADDLINE^VAQCON1(TMP,XMZ,LINE)
20 .S LINE=LINE+1
21 .S TMP=$G(^VAT(394.61,TRANS,"QRY"))
22 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
23 .S X=X_"Name: "_$P(TMP,"^",1)
24 .S X=$$ADDLINE^VAQCON1(X,XMZ,LINE)
25 .S LINE=LINE+1
26 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
27 .S X=X_"PID: "_$P(TMP,"^",4)
28 .S X=$$ADDLINE^VAQCON1(X,XMZ,LINE)
29 .S LINE=LINE+1
30 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
31 .S X=X_"SSN: "_$P(TMP,"^",2)
32 .S X=$$ADDLINE^VAQCON1(X,XMZ,LINE)
33 .S LINE=LINE+1
34 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
35 .S X=X_"DOB: "_$$DOBFMT^VAQUTL99($P(TMP,"^",3))
36 .S X=$$ADDLINE^VAQCON1(X,XMZ,LINE)
37 .S LINE=LINE+1
38 .;GET SENDER
39 .S TMP=$$SENDER^VAQCON2(TRANS)
40 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
41 .S X=X_"Sent By: "_$P(TMP,"^",1)
42 .S X=$$ADDLINE^VAQCON1(X,XMZ,LINE)
43 .S LINE=LINE+1
44 .;PLACE SENDER IN RECIPIENT LIST
45 .S X=+$P(TMP,"^",2)
46 .S TMP=$P(TMP,"^",1)
47 .S X=$S(((X'=.5)&(X'=0)):X,((TMP'="POSTMASTER")&(TMP'="PDX")&(TMP'="Patient Data eXchange")&(TMP'="")):TMP,1:"")
48 .S:(X'="") XMY(X)=""
49 .;GET MESSAGE TYPE
50 .S TMP=$$STATYPE^VAQCON1(TRANS)
51 .S TYPE=$P(TMP,"^",2)
52 .S:($P(TMP,"^",1)="-1") TYPE=-1
53 .S:(TYPE="ACK") TYPE=$P(TMP,"^",1)
54 .;GET DOMAIN & SITE
55 .S TMP="Could not be determined (Contact your PDX ADPAC)^Could not be determined (Contact your PDX ADPAC)"
56 .S:((TYPE="VAQ-UNACK")!(TYPE="REQ")) TMP=$G(^VAT(394.61,TRANS,"ATHR2"))
57 .S:((TYPE="RES")!(TYPE="UNS")!(TYPE="VAQ-RQACK")) TMP=$G(^VAT(394.61,TRANS,"RQST2"))
58 .S SITE=$P(TMP,"^",1)
59 .S DOMAIN=$P(TMP,"^",2)
60 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
61 .S X=X_"Site: "_SITE
62 .S X=$$ADDLINE^VAQCON1(X,XMZ,LINE)
63 .S LINE=LINE+1
64 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
65 .S X=X_"Domain: "_DOMAIN
66 .S X=$$ADDLINE^VAQCON1(X,XMZ,LINE)
67 .S LINE=LINE+1
68 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
69 .S X=X_"Message Type: "
70 .S:(TYPE="-1") X=X_"Could not be determined (Contact your PDX ADPAC)"
71 .S:(TYPE="REQ") X=X_"PDX Request"
72 .S:(TYPE="RES") X=X_"Results from processing an external request"
73 .S:(TYPE="UNS") X=X_"Unsolicited PDX"
74 .S:((TYPE="VAQ-RQACK")!(TYPE="VAQ-UNACK")) X=X_"Acknowledgment (Contact your PDX ADPAC)"
75 .S:(TYPE="RET") X=X_"Re-transmit (Contact your PDX ADPAC)"
76 .S TMP=$$ADDLINE^VAQCON1(X,XMZ,LINE)
77 .S LINE=LINE+1
78 .S ERRNUM=ERRNUM+1
79 ;SET ZERO NODE
80 S X=$$SETZERO^VAQCON1(XMZ,(LINE-1))
81 S XMDUN="Patient Data eXchange"
82 D ENT1^XMD
83 Q
84 ;
85ERR2IRM ;SEND ERROR MESSAGE TO IRM IF ALL TRANSMISSIONS WHERE NOT SENT
86 ; DECLARATIONS TAKEN CARE OF IN GENXMIT^VAQADM50
87 S TMP="UNABLE TO SEND MESSAGES"
88 S XMZ=$$MAKESTUB^VAQCON1(TMP,"PDX")
89 Q:(XMZ<1)
90 S LINE=1
91 ;PUT IN ERROR MESSAGE
92 S TMP="The following error(s) occurred while generating PDX transmissions ..."
93 S X=$$ADDLINE^VAQCON1(TMP,XMZ,LINE)
94 S LINE=LINE+1
95 S TRANS=""
96 S ERRNUM=1
97 F S TRANS=$O(@ARRAY3@(TRANS)) Q:('TRANS) D
98 .F TMP=1:1:2 S X=$$ADDLINE^VAQCON1("",XMZ,LINE),LINE=LINE+1
99 .S X=+$G(^VAT(394.61,TRANS,0))
100 .S TMP="("_ERRNUM_") Transaction Number: "_X
101 .S X=$$ADDLINE^VAQCON1(TMP,XMZ,LINE)
102 .S LINE=LINE+1
103 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
104 .S X=X_"IFN: "_TRANS
105 .S X=$$ADDLINE^VAQCON1(X,XMZ,LINE)
106 .S LINE=LINE+1
107 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
108 .S X=X_"Global Location: ^VAT(394.61,"_TRANS_")"
109 .S X=$$ADDLINE^VAQCON1(X,XMZ,LINE)
110 .S LINE=LINE+1
111 .S TMP=$$SENDER^VAQCON2(TRANS)
112 .S:(TMP="") TMP="Unknown^??"
113 .S X=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
114 .S X=X_"User: "_$P(TMP,"^",1)_" ("_$P(TMP,"^",2)_")"
115 .S TMP=$$ADDLINE^VAQCON1(X,XMZ,LINE)
116 .S LINE=LINE+1
117 .S X=""
118 .F S X=$O(@ARRAY3@(TRANS,X)) Q:(X="") D
119 ..S TMP=$$REPEAT^VAQUTL1(" ",($L(ERRNUM)+6))
120 ..S TMP=TMP_$G(@ARRAY3@(TRANS,X))
121 ..S TMP=$$ADDLINE^VAQCON1(TMP,XMZ,LINE)
122 ..S LINE=LINE+1
123 .S ERRNUM=ERRNUM+1
124 ;SET ZERO NODE
125 S X=$$SETZERO^VAQCON1(XMZ,(LINE-1))
126 ;SEND TO IRM/ERROR GROUP
127 S XMY("G.VAQ PDX ERRORS")=""
128 S XMDUN="Patient Data eXchange"
129 D ENT1^XMD
130 Q
Note: See TracBrowser for help on using the repository browser.