source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPFLMT5.m@ 1578

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1DGPFLMT5 ;ALB/RBS - PRF TRANSMIT REJECT MESSAGE PROCESSING ; 7/12/06 09:30am
2 ;;5.3;Registration;**650**;Aug 13, 1993;Build 3
3 ;
4 ;no direct entry
5 QUIT
6 ;
7 ;
8EN(DGVALMY) ;Entry point to retransmit rejected messages
9 ;This function will retransmit all user selected "RJ" Rejected status
10 ;entries of the PRF HL7 TRANSMISSION LOG (#26.17) file to the
11 ;Treating Facility that rejected it.
12 ;
13 ; Input:
14 ; DGVALMY - VALMY array of user selections, pass by reference
15 ;
16 ; Output:
17 ; Function value - 1 on success, 0 on failure
18 ;
19 ;- Use the 0 node sort file for all retransmission processing:
20 ; ^TMP("DGPFSORT",$J,0,<assignment ien>,<site ien>,<HL7 log ien>)=""
21 ; Each patient's PRF Assignment record is grouped with all of the
22 ; Treating Facilities that logged a rejected HL7 transmission entry.
23 ;
24 N DGAIEN ;assignment ien
25 N DGFAC ;destination station number
26 N DGHLIEN ;loop var
27 N DGNODE ;"IDX" data string
28 N DGRSLT ;function value
29 N DGSEL ;user selection
30 N DGSITE ;site transmitted to ien
31 ;
32 ;set screen to full scroll region
33 D FULL^VALM1
34 W !
35 ;
36 ;- Use the "IDX" selection entry to get the assignment info
37 ; <assignment ien>^<site ien>^<HL7 log ien>^<patient dfn>^<patient name>^<site name>
38 ;
39 S DGRSLT=0
40 I $O(DGVALMY(""))'="" D
41 . S DGSEL=0
42 . F S DGSEL=$O(DGVALMY(DGSEL)) Q:'DGSEL D
43 . . S DGNODE=$G(^TMP("DGPFLMT",$J,"IDX",DGSEL,DGSEL))
44 . . Q:'DGNODE
45 . . S DGAIEN=$P(DGNODE,U,1)
46 . . Q:'DGAIEN
47 . . S DGSITE=$P(DGNODE,U,2)
48 . . Q:'DGSITE
49 . . ;
50 . . ;- retransmit assignment -
51 . . ; display patient name and site transmitted to failure & success
52 . . ;
53 . . I '$$XMIT(DGAIEN,DGSITE) D Q
54 . . . W !,">>>",?5,DGSEL,". ",$P(DGNODE,U,5),"...failed to retransmit to...",$P(DGNODE,U,6)
55 . . E W !?5,DGSEL,". ",$P(DGNODE,U,5),"...was retransmitted to...",$P(DGNODE,U,6)
56 . . ;
57 . . ;- Now set all of the Assignment's HL7 transmission log entry's
58 . . ; to "RT" RE-TRANSMITTED status.
59 . . ;- loop ^TMP("DGPFSORT",$J,0,DGAIEN,DGSITE,n) nodes
60 . . S DGHLIEN=0
61 . . F S DGHLIEN=$O(^TMP("DGPFSORT",$J,0,DGAIEN,DGSITE,DGHLIEN)) Q:'DGHLIEN D
62 . . . ;- update HL7 transmission log entry status
63 . . . ;
64 . . . D STOSTAT^DGPFHLL(26.17,DGHLIEN,"RT")
65 . . ;
66 . . S DGRSLT=1
67 ;
68 Q DGRSLT
69 ;
70XMIT(DGAIEN,DGSITE) ;call out to retransmit
71 ;This function is used to call the PRF (ORU~R01) function to transmit
72 ;a patient's Assignment record and all History records to a single
73 ;Treating Facility.
74 ;
75 ; Supported DBIA #2171: $$STA^XUAF4
76 ; This supported DBIA is used to access the Kernel API to convert
77 ; a station number to an INSTITUTION (#4) file IEN.
78 ;
79 ; Input: (required)
80 ; DGAIEN - assignment ien
81 ; DGSITE - site transmitted to ien
82 ;
83 ; Output:
84 ; Function value - 1 on success, 0 on failure
85 ;
86 N DGFAC ;destination station number array
87 N DGHIENS ;array of assignment history ien's
88 N DGRSLT ;function value
89 S DGRSLT=0
90 ;
91 I +$G(DGAIEN)>0 D
92 . K DGFAC,DGHIENS
93 . ;
94 . ;convert institution# to station#
95 . S DGFAC(1)=$$STA^XUAF4(DGSITE)
96 . Q:'DGFAC(1)
97 . ;
98 . ;get all assignment history ien's
99 . Q:'$$GETALLDT^DGPFAAH(DGAIEN,.DGHIENS)
100 . ;
101 . ;build and transmit the new message
102 . Q:'$$SNDORU^DGPFHLS(DGAIEN,.DGHIENS,.DGFAC)
103 . ;
104 . S DGRSLT=1
105 ;
106 Q DGRSLT
Note: See TracBrowser for help on using the repository browser.