source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQBUL04.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.9 KB
RevLine 
[613]1VAQBUL04 ;ALB/JRP - BULLETINS;25-MAY-93
2 ;;1.5;PATIENT DATA EXCHANGE;**9**;NOV 17, 1993
3RESULTS ;CONTINUATION OF VAQBUL03
4 ; DECLARATIONS DONE IN $$RESULTS^VAQBUL03
5 ;PUT IN COMMENT/REASON
6 I (STATUS="VAQ-NTFND") D
7 .S TMP=SPACE_"Reason: Patient not found"
8 .S @TMPARR@("DISPLAY",LINE,0)=TMP
9 .S LINE=LINE+1
10 I (STATUS="VAQ-AMBIG") D
11 .S TMP=SPACE_"Reason: Requested patient could not be uniquely identified"
12 .S @TMPARR@("DISPLAY",LINE,0)=TMP
13 I ((STATUS="VAQ-RSLT")!(STATUS="VAQ-REJ")) D
14 .;DETERMINE IF COMMENT EXIST
15 .S COMMENT=0
16 .S COMMENT=$D(^VAT(394.61,TRANPTR,"CMNT"))
17 .S:(COMMENT) COMMENT=+$O(^VAT(394.61,TRANPTR,"CMNT",0))
18 .;NO COMMENT/REASON
19 .I ('COMMENT) D
20 ..S TMP=SPACE_$S((STATUS="VAQ-RSLT"):"Comments: ",1:"Reason: ")_"None listed"
21 ..S @TMPARR@("DISPLAY",LINE,0)=TMP
22 ..S LINE=LINE+1
23 .;COMMENT/REASON
24 .I (COMMENT) D
25 ..S TMP=SPACE_$S((STATUS="VAQ-RSLT"):"Comments:",1:"Reason:")
26 ..S @TMPARR@("DISPLAY",LINE,0)=TMP
27 ..S LINE=LINE+1
28 ..;FORMAT TEXT
29 ..K ^UTILITY($J,"W")
30 ..S OFFSET=0
31 ..F S OFFSET=+$O(^VAT(394.61,TRANPTR,"CMNT",OFFSET)) Q:('OFFSET) D
32 ...S X=$G(^VAT(394.61,TRANPTR,"CMNT",OFFSET,0))
33 ...S DIWL=0
34 ...S DIWR=0
35 ...S DIWF="I"_$L(SPACE)_"C75"
36 ...D ^DIWP
37 ..;PUT COMMENT/REASON INTO MESSAGE
38 ..S OFFSET=""
39 ..F S OFFSET=$O(^UTILITY($J,"W",0,OFFSET)) Q:(OFFSET="") D
40 ...S TMP=$G(^UTILITY($J,"W",0,OFFSET,0))
41 ...S @TMPARR@("DISPLAY",LINE,0)=TMP
42 ...S LINE=LINE+1
43 ..K ^UTILITY($J,"W")
44 ;PUT IN DATA
45 I ('SENSITVE) I (STATUS="VAQ-RSLT") I (+$G(^VAT(394.61,TRANPTR,"NTFY1"))) D
46 .F X=1:1:3 S @TMPARR@("DISPLAY",LINE,0)="",LINE=LINE+1
47 .S TMP=SPACE_"Requested information:"
48 .S @TMPARR@("DISPLAY",LINE,0)=TMP
49 .S LINE=LINE+1
50 .F X=1:1:3 S @TMPARR@("DISPLAY",LINE,0)="",LINE=LINE+1
51 .S X=$$TRNDSP^VAQUPD2(TRANPTR,TMPARR,LINE)
52 .;SUCCESS
53 .I (X>0) S LINE=LINE+X Q
54 .;NO DATA
55 .S LINE=LINE-4
56 .S TMP=SPACE_"Requested data could not be included in notification"
57 .S @TMPARR@("DISPLAY",LINE,0)=TMP
58 .S LINE=LINE+1
59 .I ('X) D Q
60 ..S TMP=SPACE_"Transaction did not contain any information"
61 ..S @TMPARR@("DISPLAY",LINE,0)=TMP
62 ..S LINE=LINE+1
63 .;ERROR
64 .I (X<0) D Q
65 ..S @TMPARR@("DISPLAY",LINE,0)=SPACE_"Error occurred while getting information from PDX files"
66 ..S LINE=LINE+1
67 ..S @TMPARR@("DISPLAY",LINE,0)=SPACE_$P(X,"^",2)
68 ..S LINE=LINE+1
69 .F X=1:1:2 S @TMPARR@("DISPLAY",LINE,0)="",LINE=LINE+1
70 ;PLACE "DISPLAY" INTO ROOT
71 S TMP=$P(TMPARR,"(",1)
72 S X=$P(TMPARR,"(",2)
73 S Y=$P(X,")",1)
74 S:(Y="") TMPROOT=TMP_"("_$C(34)_"DISPLAY"_$C(34)_")"
75 S:(Y'="") TMPROOT=TMP_"("_Y_","_$C(34)_"DISPLAY"_$C(34)_")"
76 S:(TMPARR="") TMPROOT=""
77 ;BUILD DISTRIBUTION LIST
78 S X=""
79 F S X=+$O(^VAT(394.61,TRANPTR,"NTFY2","B",X)) Q:('X) S XMY(X)=""
80 ;INCLUDE SECURITY OFFICER IF PATIENT IS SENSITIVE AT REMOTE FACILITY
81 S:(SENSITVE) X=$$LOADXMY^DGSEC()
82 ;SEND BULLETIN
83 S TMP="PDX Rejection for "_NAME
84 S:(STATUS="VAQ-RSLT") TMP="PDX Results for "_NAME
85 S X="PDX"
86 S Y="Patient Data eXchange"
87 S ERROR=$$SENDBULL^VAQBUL(TMP,X,Y,TMPROOT)
88 Q:(ERROR<0)
89 S ERROR=0
90 Q
Note: See TracBrowser for help on using the repository browser.