Changeset 636 for FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLTP3.m
- Timestamp:
- Dec 4, 2009, 8:26:01 PM (14 years ago)
- Location:
- FOIAVistA/tag/r
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLTP3.m
r628 r636 1 HLTP3 ;SFIRMFO/RSD - Transaction Processor for TCP ; 10/05/2007 15:172 ;;1.6;HEALTH LEVEL SEVEN;**19,43,57,58,59,66,69,109,115,108,116,117,125,120,133 ,122**;Oct 13, 1995;Build 141 HLTP3 ;SFIRMFO/RSD - Transaction Processor for TCP ;09/13/2006 2 ;;1.6;HEALTH LEVEL SEVEN;**19,43,57,58,59,66,69,109,115,108,116,117,125,120,133**;Oct 13, 1995;Build 13 3 3 ;Per VHA Directive 2004-038, this routine should not be modified. 4 4 ; 5 5 Q 6 NEW(X) ;process new msg. ien in 773^ ien in 7727 ;HLMTIENS=ien in #773 ; HLMTIEN=ien in #7726 NEW(X) ;process new msg. ien in 773^msg. ien in 772 7 ;HLMTIENS=ien in #773, msg header; HLMTIEN=ien in #772, msg text 8 8 ;HLHDRO=original header; HLHDR=response header 9 9 ;set error trap … … 21 21 . ;HLTCP=ien of acknowledgment msg. from ACK^HLTP4 22 22 . D ACK^HLTP4(X,$P(HLRESLT,U,2)) Q:'$G(HLTCP) 23 . ;write ack back 23 . ;write ack back over connection 24 24 . S X=$$WRITE^HLCSTCP2(HLTCP) 25 25 . ;update counter to sent 26 26 . D LLCNT^HLCSTCP(HLDP,4) 27 . ;update status of ack 27 . ;update status of ack to complete 28 28 . D STATUS^HLTF0(HLTCP,3,,,1) 29 29 ; 30 30 ;check for duplicate msg., use rec. app and msg. id x-ref 31 31 ; patch HL*1.6*120 32 ; I $L($G(HL("MID"))),$G(HL("RAP")) S X=$O(^HLMA("AH",HL("RAP"),HL("MID"),0)) D Q:'$D(HLMTIENS) 32 33 I $G(HL("MID"))]"",$G(HL("RAP")) S X=$O(^HLMA("AH",HL("RAP"),HL("MID"),0)) D Q:'$D(HLMTIENS) 33 34 . ;HLASTMSG=last ien received during this connection … … 41 42 .I MSH(HLMTIENS)'=MSH(OIENS) S HLASTMSG=HLMTIENS Q 42 43 .; 43 . ;msg is duplicate, set status 44 . ;msg is duplicate, set status as duplicate 44 45 . D STATUS^HLTF0(HLMTIENS,4,109,"Duplicate with ien "_OIENS,1),EXIT 45 . ;msg was resent , ignore it.46 . ;msg was resent during this connection, ignore it. 46 47 . I HLASTMSG=HLMTIENS K HLMTIENS Q 47 48 . ;find original response and send back 48 49 . S HLASTRSP=$O(^HLMA("AF",OIENS,OIENS)) 49 50 ; 50 ;Quit if this is ack to ack51 ;Quit if this is acknowledgment to acknowledgement message 51 52 I $G(HL("ACK")) D Q 52 . ;Update status of original ack message53 . ;Update status of original acknowledgment message to successfully 53 54 . D STATUS^HLTF0(HL("MTIENS"),3,,,1),STATUS^HLTF0(HLMTIENS,3,,,1) 54 55 . ;unlock record … … 76 77 ; patch HL*1.6*120 start 77 78 ;resending old response, msg is a resend 78 ; do not re-send duplicate when $G(HL("ACAT"))="AL" 79 ; I $G(HLASTRSP) S HLTCP=HLASTRSP G ACK 80 ; do not re-send duplicate message when $G(HL("ACAT"))="AL" 79 81 I $G(HLASTRSP),$G(HL("ACAT"))'="AL" S HLTCP=HLASTRSP G ACK 80 82 ; quit if duplicate … … 90 92 . ;X=1 if ack ok, 0=reject of error 91 93 . S X=$E(HLMSA,2)="A" 92 . ;Update status of original message and remove it from thequeue94 . ;Update status of original subscriber message and remove it from the out-going queue 93 95 . D STATUS^HLTF0(HL("MTIENS"),$S(X:3,1:4),"",$S(X:"",1:$P(HLMSA,HL("FS"),3)),1) 94 96 . D DEQUE^HLCSREP($P($G(^HLMA(HL("MTIENS"),0)),"^",7),"O",HL("MTIENS")) 95 97 . D 96 .. N HLTCP ; variable to update status in file #772.98 .. N HLTCP ;New variable to update status in file #772. 97 99 ..; 98 100 ..;**108** … … 104 106 ..; 105 107 .. D PROCACK^HLTP2(HLMTIEN,HL("EID"),.HLRESLT,.HL) 106 . ;update status of incoming & unlock108 . ;update status of incoming to complete & unlock 107 109 . D STATUS^HLTF0(HLMTIENS,$S($G(HLRESLT):4,1:3),$S($G(HLRESLT):+$G(HLRESLT),1:""),$S($G(HLRESLT):$P(HLRESLT,U,2),1:""),1),EXIT 108 110 ; … … 123 125 ;update status of incoming to complete & unlock 124 126 D STATUS^HLTF0(HLMTIENS,$S(HLRESLT:4,1:3),$S(HLRESLT:+HLRESLT,1:""),$S(HLRESLT:$P(HLRESLT,U,2),1:""),1,$S($G(HLERR("SKIP_EVENT"))=1:1,1:0)),EXIT 125 ;HLTCPO=link open, HLTCP=ien of ack msg. from GENACK127 ;HLTCPO=link open, HLTCP=ien of acknowledgment msg. from GENACK 126 128 ACK I $G(HLTCPO),$G(HLTCP) D Q 127 129 . D LLCNT^HLCSTCP(HLDP,3) … … 137 139 ; 138 140 ; patch HL*1.6*120 start 139 ; clean non-Kernelvariables141 ; clean variables except Kernel related variables 140 142 D 141 143 . ; protect variables defined in STARTIN^HLCSIN … … 152 154 N HLERR ;patch HL*1.6*109 153 155 Q:'$G(HLDP)!'$G(X) Q:'$G(^HLMA(X,0)) 156 ;**109 START** 154 157 Q:'$D(^HLMA("AC","I",HLDP,X)) 158 ;**109 END** 155 159 ; 156 160 N HL,HLA,HLD0,HLEID,HLEIDS,HLHDR,HLHDRO,HLMTIEN,HLMTIENS,HLJ,HLMSA,HLN,HLQUIT,HLNODE,HLNEXT,HLRESLT,HLRESLTA,HLTCP,HLXX,Z,HLDONE1 161 ;setup variables 157 162 S HLMTIENS=X,X=^HLMA(HLMTIENS,0),HLMTIEN=+$P(X,U),HL("MID")=$P(X,U,2),HL("MTIENS")=$P(X,U,10),HL("LL")=$P(X,U,7),HLTCP="",HL("Q")="""""" 158 163 S HL("EIDS")=$P(X,U,8),HL("SAP")=$P(X,U,11),HL("RAP")=$P(X,U,12),HL("MTP")=$P(X,U,13),HL("ETP")=$P(X,U,14) … … 164 169 M HLHDRO=^HLMA(HLMTIENS,"MSH") 165 170 ; if no header quit 171 ;**109** 172 ;I '$O(HLHDRO(0)) L -^HLMA(HLMTIENS) Q 166 173 Q:'$O(HLHDRO(0)) 167 174 ; 168 175 S HL("FS")=$E(HLHDRO(1,0),4),HL("ECH")=$$P^HLTPCK2(.HLHDRO,2),HL("SFN")=$$P^HLTPCK2(.HLHDRO,4),HL("RFN")=$$P^HLTPCK2(.HLHDRO,6),HL("DTM")=$$P^HLTPCK2(.HLHDRO,7) 169 176 ; 177 ; patch HL*1.6*109 start 170 178 ; quit if ien of #772 is not defined 171 179 Q:'HLMTIEN 172 180 ; quit if field separator is not defined 173 181 Q:HL("FS")="" 182 ; patch HL*1.6*109 end 174 183 ; 175 184 S X=$$P^HLTPCK2(.HLHDRO,1) … … 187 196 . S X=$$P^HLTPCK2(.HLHDRO,9),Z=$E(HL("ECH")),HL("PID")=$P(X,Z,2),HL("VER")=$P(X,Z,4) 188 197 . ; 189 . ; original codeincorrectly treats repetition separator as198 . ; original implementation incorrectly treats repetition separator as 190 199 . ; subcomponent separator 191 200 . I $E(HL("ECH"),2)]"",X[$E(HL("ECH"),2) D … … 206 215 . S HLMSA=$P($$P^HLTPCK2(.HLHDRO,10),$E(HL("ECH")),1),$P(HLMSA,HL("FS"),2)=$$P^HLTPCK2(.HLHDRO,12),$P(HLMSA,HL("FS"),3)=$P($$P^HLTPCK2(.HLHDRO,10),$E(HL("ECH")),2),HL("MSAID")=$P(HLMSA,HL("FS"),2) 207 216 ; 217 ; HL*1.6*108 208 218 ; quit if this is a commit ack 209 219 I $P($G(^HL(772,HLMTIEN,"IN",1,0)),HL("FS"),1)="MSA",$E($P($G(^HL(772,HLMTIEN,"IN",1,0)),HL("FS"),2))="C" Q 220 ; ** 210 221 ; 211 222 ;** HL*1.6*117 ** 212 223 K HLL("SET FOR APP ACK"),HLL("LINKS") 224 ;** END HL*1.6*117 ** 213 225 ; 214 226 D CONT … … 217 229 MSA(Y) ;Y=ien in 772, returns MSA segment 218 230 ;ack code^msg being ack id^text 219 ; patch HL*1.6*122 220 ; for HL7 v2.5 and beyond with MSA as 3rd segment 221 N X,SUBIEN,DATA,DONE 231 N X 222 232 S X=$G(^HL(772,Y,"IN",1,0)),X=$S($E(X,1,3)="MSA":$E(X,5,999),1:"") 223 Q:X]"" X224 ;225 S DONE=0226 S SUBIEN=1227 F S SUBIEN=$O(^HL(772,Y,"IN",SUBIEN)) Q:'SUBIEN D Q:DONE228 . S DATA=$G(^HL(772,Y,"IN",SUBIEN,0)) I DATA="" D229 .. S DONE=1230 .. S SUBIEN=$O(^HL(772,Y,"IN",SUBIEN)) Q:'SUBIEN231 .. S X=$G(^HL(772,Y,"IN",SUBIEN,0)),X=$S($E(X,1,3)="MSA":$E(X,5,999),1:"")232 ; patch HL*1.6*122 end233 ;234 233 Q X 235 234 ; … … 237 236 D ^%ZTER 238 237 I $G(HLMTIENS),$D(^HLMA(HLMTIENS,0)) D STATUS^HLTF0(HLMTIENS,4,,,1),EXIT 239 ; releaselocks created by inbound filer238 ;*109* release all locks created by inbound filer 240 239 L -^HLMA("AC","I",+$G(HLXX)) 241 240 G UNWIND^%ZTER
Note:
See TracChangeset
for help on using the changeset viewer.