Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (14 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

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:17
    2  ;;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 14
     1HLTP3 ;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
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;
    55 Q
    6 NEW(X) ;process new msg. ien in 773^ien in 772
    7  ;HLMTIENS=ien in #773; HLMTIEN=ien in #772
     6NEW(X) ;process new msg. ien in 773^msg. ien in 772
     7 ;HLMTIENS=ien in #773, msg header; HLMTIEN=ien in #772, msg text
    88 ;HLHDRO=original header;  HLHDR=response header
    99 ;set error trap
     
    2121 . ;HLTCP=ien of acknowledgment msg. from ACK^HLTP4
    2222 . D ACK^HLTP4(X,$P(HLRESLT,U,2)) Q:'$G(HLTCP)
    23  . ;write ack back
     23 . ;write ack back over connection
    2424 . S X=$$WRITE^HLCSTCP2(HLTCP)
    2525 . ;update counter to sent
    2626 . D LLCNT^HLCSTCP(HLDP,4)
    27  . ;update status of ack
     27 . ;update status of ack to complete
    2828 . D STATUS^HLTF0(HLTCP,3,,,1)
    2929 ;
    3030 ;check for duplicate msg., use rec. app and msg. id x-ref
    3131 ; 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)
    3233 I $G(HL("MID"))]"",$G(HL("RAP")) S X=$O(^HLMA("AH",HL("RAP"),HL("MID"),0)) D  Q:'$D(HLMTIENS)
    3334 . ;HLASTMSG=last ien received during this connection
     
    4142 .I MSH(HLMTIENS)'=MSH(OIENS) S HLASTMSG=HLMTIENS Q
    4243 .;
    43  . ;msg is duplicate, set status
     44 . ;msg is duplicate, set status as duplicate
    4445 . 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.
    4647 . I HLASTMSG=HLMTIENS K HLMTIENS Q
    4748 . ;find original response and send back
    4849 . S HLASTRSP=$O(^HLMA("AF",OIENS,OIENS))
    4950 ;
    50  ;Quit if this is ack to ack
     51 ;Quit if this is acknowledgment to acknowledgement message
    5152 I $G(HL("ACK")) D  Q
    52  . ;Update status of original ack message
     53 . ;Update status of original acknowledgment message to successfully
    5354 . D STATUS^HLTF0(HL("MTIENS"),3,,,1),STATUS^HLTF0(HLMTIENS,3,,,1)
    5455 . ;unlock record
     
    7677 ; patch HL*1.6*120 start
    7778 ;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"
    7981 I $G(HLASTRSP),$G(HL("ACAT"))'="AL" S HLTCP=HLASTRSP G ACK
    8082 ; quit if duplicate
     
    9092 . ;X=1 if ack ok, 0=reject of error
    9193 . S X=$E(HLMSA,2)="A"
    92  . ;Update status of original message and remove it from the queue
     94 . ;Update status of original subscriber message and remove it from the out-going queue
    9395 . D STATUS^HLTF0(HL("MTIENS"),$S(X:3,1:4),"",$S(X:"",1:$P(HLMSA,HL("FS"),3)),1)
    9496 . D DEQUE^HLCSREP($P($G(^HLMA(HL("MTIENS"),0)),"^",7),"O",HL("MTIENS"))
    9597 . D
    96  .. N HLTCP ;variable to update status in file #772.
     98 .. N HLTCP ;New variable to update status in file #772.
    9799 ..;
    98100 ..;**108**
     
    104106 ..;
    105107 .. D PROCACK^HLTP2(HLMTIEN,HL("EID"),.HLRESLT,.HL)
    106  . ;update status of incoming & unlock
     108 . ;update status of incoming to complete & unlock
    107109 . 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
    108110 ;
     
    123125 ;update status of incoming to complete & unlock
    124126 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 GENACK
     127 ;HLTCPO=link open, HLTCP=ien of acknowledgment msg. from GENACK
    126128ACK I $G(HLTCPO),$G(HLTCP) D  Q
    127129 . D LLCNT^HLCSTCP(HLDP,3)
     
    137139 ;
    138140 ; patch HL*1.6*120 start
    139  ; clean non-Kernel variables
     141 ; clean variables except Kernel related variables
    140142 D
    141143 . ; protect variables defined in STARTIN^HLCSIN
     
    152154 N HLERR     ;patch HL*1.6*109
    153155 Q:'$G(HLDP)!'$G(X)  Q:'$G(^HLMA(X,0))
     156 ;**109 START**
    154157 Q:'$D(^HLMA("AC","I",HLDP,X))
     158 ;**109 END**
    155159 ;
    156160 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
    157162 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")=""""""
    158163 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)
     
    164169 M HLHDRO=^HLMA(HLMTIENS,"MSH")
    165170 ; if no header quit
     171 ;**109**
     172 ;I '$O(HLHDRO(0)) L -^HLMA(HLMTIENS) Q
    166173 Q:'$O(HLHDRO(0))
    167174 ;
    168175 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)
    169176 ;
     177 ; patch HL*1.6*109 start
    170178 ; quit if ien of #772 is not defined
    171179 Q:'HLMTIEN
    172180 ; quit if field separator is not defined
    173181 Q:HL("FS")=""
     182 ; patch HL*1.6*109 end
    174183 ;
    175184 S X=$$P^HLTPCK2(.HLHDRO,1)
     
    187196 . S X=$$P^HLTPCK2(.HLHDRO,9),Z=$E(HL("ECH")),HL("PID")=$P(X,Z,2),HL("VER")=$P(X,Z,4)
    188197 . ;
    189  . ; original code incorrectly treats repetition separator as
     198 . ; original implementation incorrectly treats repetition separator as
    190199 . ; subcomponent separator
    191200 . I $E(HL("ECH"),2)]"",X[$E(HL("ECH"),2) D
     
    206215 . 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)
    207216 ;
     217 ; HL*1.6*108
    208218 ; quit if this is a commit ack
    209219 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 ; **
    210221 ;
    211222 ;**  HL*1.6*117 **
    212223 K HLL("SET FOR APP ACK"),HLL("LINKS")
     224 ;** END HL*1.6*117 **
    213225 ;
    214226 D CONT
     
    217229MSA(Y) ;Y=ien in 772, returns MSA segment
    218230 ;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
    222232 S X=$G(^HL(772,Y,"IN",1,0)),X=$S($E(X,1,3)="MSA":$E(X,5,999),1:"")
    223  Q:X]"" X
    224  ;
    225  S DONE=0
    226  S SUBIEN=1
    227  F  S SUBIEN=$O(^HL(772,Y,"IN",SUBIEN)) Q:'SUBIEN  D  Q:DONE
    228  . S DATA=$G(^HL(772,Y,"IN",SUBIEN,0)) I DATA="" D
    229  .. S DONE=1
    230  .. S SUBIEN=$O(^HL(772,Y,"IN",SUBIEN)) Q:'SUBIEN
    231  .. 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 end
    233  ;
    234233 Q X
    235234 ;
     
    237236 D ^%ZTER
    238237 I $G(HLMTIENS),$D(^HLMA(HLMTIENS,0)) D STATUS^HLTF0(HLMTIENS,4,,,1),EXIT
    239  ; release locks created by inbound filer
     238 ;*109* release all locks created by inbound filer
    240239 L -^HLMA("AC","I",+$G(HLXX))
    241240 G UNWIND^%ZTER
Note: See TracChangeset for help on using the changeset viewer.