source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQBUL03.m@ 1693

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

initial load of WorldVistAEHR

File size: 3.9 KB
RevLine 
[613]1VAQBUL03 ;ALB/JRP - BULLETINS;25-MAY-93
2 ;;1.5;PATIENT DATA EXCHANGE;**9**;NOV 17, 1993
3RESULTS(TRANPTR) ;SEND RESULTS RECEIVED BULLETIN
4 ;INPUT : TRANPTR - Pointer to VAQ - TRANSACTION file
5 ;OUTPUT : 0 - Bulletin sent
6 ; -1^Error_Text - Bulletin not sent
7 ;
8 ;CHECK INPUT
9 S TRANPTR=+$G(TRANPTR)
10 Q:(('TRANPTR)!('$D(^VAT(394.61,TRANPTR)))) "-1^Did not pass valid transaction"
11 ;DECLARE VARIABLES
12 N TRANNUM,NAME,PID,DOB,RQSTBY,RQSTON,ATHRBY,SITE,DOMAIN
13 N STATUS,TMP,TMPARR,LINE,OFFSET,SPACE,COMMENT,X,DIWL,DIWR,DIWF
14 N SENSITVE,DFN,XMY,Y,TMPROOT,ERROR
15 S TMPARR="^TMP(""VAQ-BUL"","_$J_")"
16 K @TMPARR,^UTILITY($J,"W")
17 S SPACE=" "
18 ;DETERMINE RESULT OF REQUEST
19 S TMP=$$STATYPE^VAQCON1(TRANPTR,1)
20 Q:($P(TMP,"^",1)="-1") TMP
21 Q:($P(TMP,"^",2)'="RES") "-1^Transaction did not contain results of a request"
22 S STATUS=$P(TMP,"^",1)
23 ;GET TRANSACTION NUMBER
24 S TMP=$G(^VAT(394.61,TRANPTR,0))
25 S TRANNUM=+TMP
26 Q:('TRANNUM) "-1^Transaction did not contain a transaction number"
27 ;GET PATIENT POINTER
28 S DFN=+$P(TMP,"^",3)
29 ;CHECK REMOTE SENSITIVITY (SET TO 1 IF SENSITIVE)
30 S SENSITVE=+$P(TMP,"^",4)
31 ;CHECK LOCAL SENSITIVITY (SET TO 2 IF SENSITIVE)
32 I (('SENSITVE)&(DFN)) D
33 .S SENSITVE=+$$GETSEN^VAQUTL97(DFN)
34 .;ON ERROR ASSUME SENSITIVE
35 .S:(SENSITVE) SENSITVE=2
36 ;RETURN SUCCESS IF NOTIFICATION WAS NOT REQUESTED AND PATIENT
37 ; IS NOT SENSITIVE AT LOCAL AND REMOTE FACILITY
38 I ('(+$O(^VAT(394.61,TRANPTR,"NTFY2",0)))) Q:('SENSITVE) 0
39 ;GET PATIENT INFORMATION
40 S TMP=$G(^VAT(394.61,TRANPTR,"QRY"))
41 S NAME=$P(TMP,"^",1)
42 S:(NAME="") NAME="Not listed"
43 S DOB=$$DOBFMT^VAQUTL99($P(TMP,"^",3),0)
44 S:(DOB="") DOB="Not listed"
45 S PID=$P(TMP,"^",4)
46 I (PID="") D
47 .;GET PID FROM SSN
48 .S PID=$P(TMP,"^",2)
49 .I (PID="") S PID="Not listed" Q
50 .S PID=$$DASHSSN^VAQUTL99(PID)
51 ;GET REQUEST INFORMATION
52 S TMP=$G(^VAT(394.61,TRANPTR,"RQST1"))
53 S RQSTON=$$DOBFMT^VAQUTL99($P(TMP,"^",1),1)
54 S:(RQSTON="") RQSTON="Could not be determined"
55 S RQSTBY=$P(TMP,"^",2)
56 S:(RQSTBY="") RQSTBY="Unknown"
57 ;GET REMOTE INFORMATION
58 S TMP=$G(^VAT(394.61,TRANPTR,"ATHR1"))
59 S ATHRBY=$P(TMP,"^",2)
60 S:(ATHRBY="") ATHBY="Uknown"
61 S:(ATHRBY="POSTMASTER") ATHBY="PDX Server"
62 S TMP=$G(^VAT(394.61,TRANPTR,"ATHR2"))
63 S SITE=$P(TMP,"^",1)
64 S:(SITE="") SITE="Could not be determined"
65 S DOMAIN=$P(TMP,"^",2)
66 S:(DOMAIN="") DOMAIN="Could not be determined"
67 ;BUILD MESSAGE
68 S LINE=1
69 S TMP="Your request for information has been "
70 S TMP=TMP_$S((STATUS="VAQ-RSLT"):"processed and returned",1:"rejected")_" ..."
71 S @TMPARR@("DISPLAY",LINE,0)=TMP
72 S LINE=LINE+1
73 S TMP=""
74 S @TMPARR@("DISPLAY",LINE,0)=TMP
75 S LINE=LINE+1
76 ;PUT IN TRANSACTION INFO
77 S TMP=SPACE_"Transaction number: "_TRANNUM
78 S @TMPARR@("DISPLAY",LINE,0)=TMP
79 S LINE=LINE+1
80 S TMP=SPACE_"Name: "_NAME
81 S @TMPARR@("DISPLAY",LINE,0)=TMP
82 S LINE=LINE+1
83 S TMP=SPACE_"PID: "_PID
84 S @TMPARR@("DISPLAY",LINE,0)=TMP
85 S LINE=LINE+1
86 S TMP=SPACE_"DOB: "_DOB
87 S @TMPARR@("DISPLAY",LINE,0)=TMP
88 S LINE=LINE+1
89 S TMP=""
90 S @TMPARR@("DISPLAY",LINE,0)=TMP
91 S LINE=LINE+1
92 ;PRINT SENSITIVITY
93 I (SENSITVE) D
94 .S TMP="*** PATIENT WAS LISTED AS SENSITIVE AT THE REMOTE FACILITY ***"
95 .S:(SENSITVE=2) TMP="*** PATIENT IS LISTED AS SENSITIVE IN YOUR FACILITY ***"
96 .S TMP=SPACE_TMP
97 .S @TMPARR@("DISPLAY",LINE,0)=TMP
98 .S LINE=LINE+1
99 .S TMP=""
100 .S @TMPARR@("DISPLAY",LINE,0)=TMP
101 .S LINE=LINE+1
102 ;PUT IN REQUESTING INFO
103 S TMP=SPACE_"Requested by: "_RQSTBY
104 S @TMPARR@("DISPLAY",LINE,0)=TMP
105 S LINE=LINE+1
106 S TMP=SPACE_"Requested on: "_RQSTON
107 S @TMPARR@("DISPLAY",LINE,0)=TMP
108 S LINE=LINE+1
109 S TMP=""
110 S @TMPARR@("DISPLAY",LINE,0)=TMP
111 S LINE=LINE+1
112 ;PUT IN AUTHORIZING INFO
113 S TMP=SPACE_"Processed by: "_ATHRBY
114 S @TMPARR@("DISPLAY",LINE,0)=TMP
115 S LINE=LINE+1
116 S TMP=SPACE_"Site: "_SITE
117 S @TMPARR@("DISPLAY",LINE,0)=TMP
118 S LINE=LINE+1
119 S TMP=SPACE_"Domain: "_DOMAIN
120 S @TMPARR@("DISPLAY",LINE,0)=TMP
121 S LINE=LINE+1
122 S TMP=""
123 S @TMPARR@("DISPLAY",LINE,0)=TMP
124 S LINE=LINE+1
125 ;CONTINUATION
126 S ERROR=0
127 D RESULTS^VAQBUL04
128 ;DONE (CLEAN UP)
129 K @TMPARR,^UTILITY($J,"W")
130 Q ERROR
Note: See TracBrowser for help on using the repository browser.