source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SCMCHLR5.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: 5.3 KB
RevLine 
[613]1SCMCHLR5 ;ALB/KCL - PCMM HL7 Reject Processing - Protocols con't ; 10-JAN-2000
2 ;;5.3;Scheduling;**210,272**;AUG 13, 1993
3 ;
4 ;This routine contains the PCMM Transmission Error processing protocols.
5 ;See EN^SCMCHLR2 for additional documentation on 'system wide' variables
6 ;used in this routine.
7 ;
8UE ; Description: Entry point for SCMC LE UNCHECK ERROR protocol.
9 ;
10 ; Input: None
11 ;
12 ; Output:
13 ; VALMBCK - 'R'=Refresh screen
14 ;
15 N NODE,SCLINE,SCNUM,SCTLIEN,SCERIEN,VALMY
16 ;
17 ;Ask user to select transmission errors to uncheck on the list
18 D EN^VALM2(XQORNOD(0))
19 D FULL^VALM1
20 ;
21 ;Process user selection
22 S SCNUM=0
23 F S SCNUM=$O(VALMY(SCNUM)) Q:'SCNUM D
24 .;invoke call to mark error as new on list
25 .I $D(^TMP(SCARY_"IDX",$J,SCNUM)) D
26 ..S NODE=$G(^TMP(SCARY_"IDX",$J,SCNUM))
27 ..S SCLINE=+NODE,SCTLIEN=+$P(NODE,"^",2),SCERIEN=+$P(NODE,"^",3)
28 ..D UNCHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN)
29 ;
30 ;
31 ;Place custom msg in msg window
32 ;S VALMSG=$$MRKMSG^SCMCHLR1
33 ;
34 ;Refresh screen when returning from action
35 S VALMBCK="R"
36 Q
37 ;
38 ;
39DP ; Description: Entry point for SCMC LE DESELECT PATIENT RETRANSMIT protocol.
40 ;
41 ; Input: None
42 ;
43 ; Output:
44 ; VALMBCK - 'R'=Refresh screen
45 ;
46 N NODE,SCLINE,SCNUM,SCTLIEN,SCTLOG,VALMY
47 ;
48 ;Ask user to select transmission errors to deselect
49 D EN^VALM2(XQORNOD(0))
50 ;
51 ;set screen to full scrolling region
52 D FULL^VALM1
53 ;
54 ;Process user selections
55 S SCNUM=0
56 F S SCNUM=$O(VALMY(SCNUM)) Q:'SCNUM D
57 .;
58 .I $D(^TMP(SCARY_"IDX",$J,SCNUM)) D
59 ..S NODE=$G(^TMP(SCARY_"IDX",$J,SCNUM))
60 ..S SCLINE=+NODE,SCTLIEN=+$P(NODE,"^",2),SCERIEN=+$P(NODE,"^",3)
61 ..;get information for PCMM HL7 Transmission Log entry and invoke code
62 ..;to set patient to 'retransmit'.
63 ..I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D DESLPAT(SCARY,SCLINE,.SCTLOG)
64 ;
65 ;Place custom msg in msg window
66 ;S VALMSG=$$MRKMSG^SCMCHLR1
67 ;
68 ;Refresh screen when returning from action
69 S VALMBCK="R"
70 Q
71 ;
72 ;
73DA ; Description: Entry point for SCMC LE DESELECT ALL protocol.
74 ;
75 ; Input: None
76 ;
77 ; Output:
78 ; VALMBCK - 'R'=Refresh screen
79 ;
80 N DIR,DTOUT,DUOUT,Y
81 ;
82 ;Set screen to full scrolling region
83 D FULL^VALM1
84 ;
85 ;Ask user if they want to deselect all patients for retransmit
86 S DIR(0)="Y"
87 S DIR("A")="Deselect all patients"
88 S DIR("A",1)="This action will allow all patients that are currently"
89 S DIR("A",2)="marked for re-transmission to be deselected."
90 S DIR("B")="NO"
91 D ^DIR
92 ;
93 ;Process user response
94 I '$D(DIRUT) D
95 .I +Y D
96 ..;set all patients status to rejected
97 ..D UPDALL
98 ;
99 ;Place custom msg in msg window
100 ;S VALMSG=$$MRKMSG^SCMCHLR1
101 ;
102 ;Refresh screen when returning from action
103 S VALMBCK="R"
104 Q
105 ;
106 ;
107UNCHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN) ;
108 ; Description: Used to uncheck an error on the list.
109 ;
110 ; Input:
111 ; SCARY - Global array subscript
112 ; SCLINE - Line number
113 ; SCTLIEN - PCMM HL7 Transmission Log IEN
114 ; SCERIEN - IEN of record in Error Code (#404.47142) multiple
115 ;
116 ; Output: None
117 ;
118 N SCERMSG
119 ;
120 ;if status is marked for retransmit error can not be marked as new
121 I $$STATUS^SCMCHLA(SCTLIEN)="M" D
122 .W !,^TMP(SCARY,$J,SCLINE,0)
123 .W:$G(SCERMSG)'="" !,"...",$$LOWER^VALM1(SCERMSG)
124 .W !,"...Unable to update error processing status"
125 .W !,"...Patient already marked for re-transmission"
126 .D PAUSE^VALM1
127 E D
128 .I $$UPDEPS^SCMCHLA(SCTLIEN,SCERIEN,1,.SCERMSG) D
129 ..D FLDTEXT^VALM10(SCLINE,"STATUS","New")
130 ..D FLDCTRL^VALM10(SCLINE,"STATUS",IOINHI,IOINORM)
131 Q
132 ;
133 ;
134DESLPAT(SCARY,SCLINE,SCTLOG) ; Description: Used to set patient to rejected.
135 ;
136 ; Input:
137 ; SCARY - Global array subscript
138 ; SCLINE - Line number
139 ; SCTLOG - Transmission log entry array
140 ;
141 ; Output: None
142 ;
143 N SCERROR
144 ;
145 ;Set patient to rejected
146 I $$UPDSTAT^SCMCHLA(SCTLIEN,"RJ",.SCERROR) D
147 .D UPDPAT(SCARY,$S($G(SCTLOG("DFN")):SCTLOG("DFN"),1:"W"),$S('$G(SCTLOG("DFN")):SCLINE,1:""))
148 E D
149 .W !,^TMP(SCARY,$J,SCLINE,0)
150 .W:$G(SCERMSG)'="" !,"...",$$LOWER^VALM1(SCERROR)
151 .W !,"...Unable to deselect patient for re-transmit"
152 .D PAUSE^VALM1
153 Q
154 ;
155 ;
156UPDPAT(SCARY,SCDFN,LINE) ; Description: Update all PCMM HL7 Transmssion Log
157 ; entries in the list for the patient as 'rejected'.
158 ;
159 ; Input:
160 ; SCARY - Global array subscript
161 ; SCDFN - Patient IEN
162 ;
163 ; Output: None
164 ;
165 S:'$G(LINE) LINE=999999
166 N SCLINE,SCTLIEN
167 ;
168 ;Loop thru entries in the list for the patient
169 S SCLINE=0
170 I SCDFN="W",LINE'=999999 S SCLINE=LINE-.01
171 F S SCLINE=$O(^TMP(SCARY_"IDX",$J,"PT",SCDFN,SCLINE)) Q:(('SCLINE)!(SCLINE>LINE)) S SCTLIEN=+^(SCLINE) D
172 .;update entry that was marked for re-transmit to null
173 .D FLDTEXT^VALM10(SCLINE,"RETRANS"," ")
174 Q
175 ;
176 ;
177UPDALL ; Description: Update all PCMM HL7 Transmssion Log
178 ; entries in the list as 'marked for re-transmit'.
179 ;
180 ; Input: None
181 ; Output: None
182 ;
183 N SCLINE,SCTLIEN,SCDFN
184 ;
185 ;Loop thru entries in the list for all patients
186 S SCDFN=""
187 F S SCDFN=$O(^TMP(SCARY_"IDX",$J,"PT",SCDFN)) Q:'SCDFN D
188 .;Loop thru entries in the list for the patient
189 .S SCLINE=0
190 .F S SCLINE=$O(^TMP(SCARY_"IDX",$J,"PT",SCDFN,SCLINE)) Q:'SCLINE D
191 ..S NODE=^TMP(SCARY_"IDX",$J,"PT",SCDFN,SCLINE)
192 ..S SCTLIEN=+NODE,SCERIEN=+$P(NODE,"^",2)
193 ..;
194 ..;get information for PCMM HL7 Transmission Log entry and invoke code
195 ..;to set patient to 'rejected'.
196 ..I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D DESLPAT(SCARY,SCLINE,.SCTLOG)
197 ..;
198 ..;update entry that was marked for re-transmit to null
199 ..D FLDTEXT^VALM10(SCLINE,"RETRANS"," ")
200 ;
201 Q
Note: See TracBrowser for help on using the repository browser.