source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQFIL11.m@ 1000

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

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1VAQFIL11 ;ALB/JRP - MESSAGE FILING;12-MAY-93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3HEADER ;CONTINUATION FOR VAQFIL10
4 ; DECLARATIONS DONE IN $$HEADER^VAQFIL10
5 ;FILE RECEIVING MESSAGE STATUS
6 S ERR=0
7 S ERR=$$FILEINFO^VAQFILE(394.61,TRANPTR,.02,"VAQ-RCVE")
8 I (ERR) S:(NEWTRAN) TMP=$$DELTRAN^VAQFILE(TRANPTR) S ERR="-1^Unable to mark transaction as a transmission that is being received" Q
9 ;DONE IF ACK
10 Q:(TYPE="ACK")
11 ;FILE REMOTE VERSION NUMBER
12 S ERR=$$FILEINFO^VAQFILE(394.61,TRANPTR,.07,VERSION)
13 I (ERR) S:(NEWTRAN) TMP=$$DELTRAN^VAQFILE(TRANPTR) S ERR="-1^Unable to file remote version number ("_VERSION_")" Q
14 ;DONE IF RETRANSMIT
15 Q:(TYPE="RET")
16 ;FILE DATE & TIME OF TRANSMISSION
17 S TMP=$S((TYPE="REQ"):20,1:50)
18 S ERR=$$FILEINFO^VAQFILE(394.61,TRANPTR,TMP,DATETIME)
19 I (ERR) S:(NEWTRAN) TMP=$$DELTRAN^VAQFILE(TRANPTR) S ERR="-1^Unable to file date & time ("_DATETIME_")" Q
20 ;FILE DATE & TIME UNSOLICITED RECEIVED
21 I (STATUS="VAQ-UNSOL") D Q:(ERR)
22 .S ERR=$$FILEINFO^VAQFILE(394.61,TRANPTR,20,"NOW")
23 .I (ERR) S:(NEWTRAN) TMP=$$DELTRAN^VAQFILE(TRANPTR) S ERR="-1^Unable to file date & time Unsolicited was received"
24 ;FILE REMOTE TRANSACTION NUMBER
25 S:(TYPE'="RES") ERR=$$FILEINFO^VAQFILE(394.61,TRANPTR,.06,TRANSNUM)
26 I (ERR) S:(NEWTRAN) TMP=$$DELTRAN^VAQFILE(TRANPTR) S ERR="-1^Unable to file remote transaction number ("_TRANSNUM_")" Q
27 ;FILE ENCRYPTION FLAG
28 S TMP=$S((ENCMTHD=""):"NO",1:"YES")
29 S ERR=$$FILEINFO^VAQFILE(394.61,TRANPTR,40,TMP)
30 I (ERR) S:(NEWTRAN) TMP=$$DELTRAN^VAQFILE(TRANPTR) S ERR="-1^Unable to file encryption flag ("_$S((ENCMTHD=""):"NO",1:"YES")_")" Q
31 ;FILE ENCRYPTION METHOD
32 S:(ENCMTHD'="") ERR=$$FILEINFO^VAQFILE(394.61,TRANPTR,41,ENCMTHD)
33 I (ERR) S:(NEWTRAN) TMP=$$DELTRAN^VAQFILE(TRANPTR) S ERR="-1^Unable to file encryption method ("_ENCMTHD_")" Q
34 S ERR=0
35 Q
36 ;
37STATYPE(MESSNUM,PARSARR) ;RETURN STATUS & TYPE FOR A PARSED MESSAGE
38 ;INPUT : MESSNUM - Message number in transmission (not XMZ)
39 ; (defaults to 1)
40 ; PARSARR - Parsing array (full global reference)
41 ;OUTPUT : Status^Type - Success
42 ; -1^Error_Text - Error
43 ;
44 ;CHECK INPUT
45 S:($G(MESSNUM)="") MESSNUM=1
46 Q:($G(PARSARR)="") "-1^Did not pass reference to parsing array"
47 Q:('$D(@PARSARR@(MESSNUM))) "-1^Did not pass valid message number"
48 Q:('$D(@PARSARR@(MESSNUM,"HEADER",1))) "-1^Message did not contain a header block"
49 ;DECLARE VARIABLES
50 N STATUS,TYPE
51 S TYPE=$G(@PARSARR@(MESSNUM,"HEADER",1,2))
52 S:(TYPE=" ") TYPE=""
53 Q:(TYPE="") "-1^Could not determine message type"
54 S STATUS=$G(@PARSARR@(MESSNUM,"HEADER",1,3))
55 S:(STATUS=" ") STATUS=""
56 Q:(STATUS="") "-1^Could not determine message status"
57 Q STATUS_"^"_TYPE
58 ;
59DECMTHD(MESSNUM,PARSARR,RET) ;RETURN DECRYPTION METHOD FOR A PARSED MESSAGE
60 ;INPUT : MESSNUM - Message number in transmission (not XMZ)
61 ; (defaults to 1)
62 ; PARSARR - Parsing array (full global reference)
63 ; RET - Flag indicating what to return
64 ; 1 = Return pointer to VAQ - ENCRYPTION file (default)
65 ; Return 0 if no encryption listed
66 ; 2 = Return decryption method
67 ; Return "" if no encryption listed
68 ; 3 = Return type of encryption used
69 ; Return "" if no encryption listed
70 ;OUTPUT : See definition of RET
71 ;
72 ;CHECK INPUT
73 S:($G(MESSNUM)="") MESSNUM=1
74 Q:($G(PARSARR)="") ""
75 Q:('$D(@PARSARR@(MESSNUM))) ""
76 Q:('$D(@PARSARR@(MESSNUM,"HEADER",1))) ""
77 S RET=+$G(RET)
78 S:('RET) RET=1
79 ;DECLARE VARIABLES
80 N PTR,TYPE
81 ;GET TYPE OF ENCRYPTION USED
82 S TYPE=$G(@PARSARR@(MESSNUM,"HEADER",1,8))
83 S:(TYPE=" ") TYPE=""
84 ;NONE LISTED
85 Q:(TYPE="") $S((RET=1):0,1:"")
86 ;RETURN TYPE
87 Q:(RET=3) TYPE
88 ;GET POINTER
89 S PTR=+$O(^VAT(394.72,"B",TYPE,""))
90 Q:(RET=1) PTR
91 Q:('PTR) ""
92 ;GET METHOD
93 Q $G(^VAT(394.72,PTR,"DCR"))
Note: See TracBrowser for help on using the repository browser.