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/HLCSTCP2.m

    r628 r636  
    1 HLCSTCP2 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ;10/17/2007  09:37
    2  ;;1.6;HEALTH LEVEL SEVEN;**19,43,49,57,63,64,66,67,76,77,87,109,133,122**;Oct 13,1995;Build 14
     1HLCSTCP2 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ;09/13/2006
     2 ;;1.6;HEALTH LEVEL SEVEN;**19,43,49,57,63,64,66,67,76,77,87,109,133**;Oct 13,1995;Build 13
    33 ;Per VHA Directive 2004-038, this routine should not be modified.
    44 ;Sender
     
    1111 S HLTCPO=HLDP,HLMSG="",(HLRETRY,HLRETMG)=0
    1212 ;
    13  ; patch 122
    14  ; patch 133
    15  ; set IO(0) to the null device
    16  I $G(^%ZOSF("OS"))]"",^%ZOSF("OS")'["GT.M" D
    17  . S IO(0)=$S(^%ZOSF("OS")["OpenM":$S($$OS^%ZOSV()["VMS":"_NLA0:",$$OS^%ZOSV()["UNIX":"/dev/null",1:$P),^%ZOSF("OS")["DSM":"_NLA0:",1:$P)
    18  . O IO(0) U IO(0)
     13 ;set IO(0) to the null device
     14 S IO(0)=$S(^%ZOSF("OS")["OpenM":$S($$OS^%ZOSV()["VMS":"_NLA0:",$$OS^%ZOSV()["UNIX":"/dev/null",1:$P),^%ZOSF("OS")["DSM":"_NLA0:",1:$P)
     15 O IO(0) U IO(0)
    1916 ;
    2017 ;persistent conection, open connection first, HLPORT=open port
     
    3936 ; and then check the link if it open or not
    4037 N HL,HLN,HLARR,HLHDR,HLI,HLJ,HLMSA,HLRESP,HLRESLT,HLRETRM,HLTCP,HLTCPI,X,Z,HLREREAD
    41  N HLTMBUF
    42  D MON^HLCSTCP("CheckOut")
     38 D MON^HLCSTCP("Check out")
    4339 ;HLMSG=next msg, set at tag DONE
    4440 I 'HLMSG S HLMSG=+$O(^HLMA("AC","O",HLDP,0)),HLRETRY=0 Q:'HLMSG
    4541 ;
     42 ;**109**
     43 ;Temporarily lock ^HLMA to flush buffer and ensure edits are complete
     44 ;L +^HLMA(HLMSG):1 I '$T S HLMSG=0 Q
     45 ;L -^HLMA(HLMSG)
     46 ;
    4647 S HLI=+$G(^HLMA(HLMSG,0)),HLJ=$O(^("MSH",0)),HLTCP=""
    4748 ;don't have message text or MSH, kill x-ref and decrement 'to send'
    48  ;
    49  ; patch HL*1.6*122: MPI-client/server
    50  ; I 'HLI!'HLJ K ^HLMA("AC","O",HLDP,HLMSG) D LLCNT^HLCSTCP(HLDP,3,1) S HLMSG=0 Q
    51  I 'HLI!'HLJ D  Q
    52  . F  L +^HLMA("AC","O",HLDP,HLMSG):10 Q:$T  H 1
    53  . K ^HLMA("AC","O",HLDP,HLMSG)
    54  . L -^HLMA("AC","O",HLDP,HLMSG)
    55  . D LLCNT^HLCSTCP(HLDP,3,1)
    56  . S HLMSG=0
    57  ;
     49 I 'HLI!'HLJ K ^HLMA("AC","O",HLDP,HLMSG) D LLCNT^HLCSTCP(HLDP,3,1) S HLMSG=0 Q
    5850 ;update msg status to 'being transmitted'; if cancelled decrement link and quit
    5951 I '$$CHKMSG(1.5) D LLCNT^HLCSTCP(HLDP,3,1) S HLMSG=0 Q
     
    153145 ; Set up error trap
    154146 N $ETRAP,$ESTACK S $ETRAP="D ERROR^HLCSTCP2"
    155  ; patch HL*1.6*122
    156  N HLTMBUF
    157147 ;override ack timeout
    158148 I $G(HLP("ACKTIME")) N HLDBACK S HLDBACK=HLP("ACKTIME")
     
    179169 D STATUS^HLTF0(HLMSG,ST,$G(ERR),$G(ERRMSG),1)
    180170 ;
     171 ;**109**
    181172 D DEQUE^HLCSREP(HLDP,"O",HLMSG)
    182173 ;
     
    189180 ;returns 1=msg was updated, 0=msg has been canceled
    190181 N X
     182 ;
     183 ;**109**
     184 ;F  L +^HLMA(HLMSG,"P"):1 Q:$T  H 1
     185 ;
    191186 ;
    192187 ; New HL*1.6*77 code starting here...
     
    195190 .  D STATUS^HLTF0(HLMSG,4,$P(HLERROR,U),$P(HLERROR,U,2),1)
    196191 .;
     192 .;**109**
    197193 . D DEQUE^HLCSREP(HLDP,"O",HLMSG)
    198  ;
    199  ; End of HL*1.6*77
     194 .;L -^HLMA(HLMSG,"P")
     195 ;**end 109**
     196 ;
     197 ; End of HL*1.6*77 modifications
    200198 ;
    201199 ;get status, quit if msg was cancelled
    202200 ;
     201 ;**109**
     202 ;S X=+^HLMA(HLMSG,"P") I X=3 L -^HLMA(HLMSG,"P") Q 0
    203203 S X=+^HLMA(HLMSG,"P") Q:X=3 0
    204204 ;
    205205 ;update status if it is different
    206206 I $G(HLI),HLI'=X D STATUS^HLTF0(HLMSG,HLI)
     207 ;
     208 ;**109**
     209 ;L -^HLMA(HLMSG,"P")
    207210 ;
    208211 Q 1
     
    216219 ;           -1 - Unsuccessful
    217220 ;
    218  N HLDA2,HLAR,HLI,LINENO,X,CRCOUNT
    219  S CRCOUNT=0
     221 N HLDA2,HLAR,HLI,LINENO,X
    220222 ;set error trap, used when called from HLTP3
    221223 ;
     
    235237 .. ;first line, need start block char.
    236238 .. S:LINENO=1 X=$C(11)_X
    237  .. ; HL*1.6*122
    238  .. ; I X]"" W X,!
    239  .. N LENGTH
    240  .. S LENGTH=$L(X)
    241  .. ; buffer should be limited to 512
    242  .. I LENGTH>512 D
    243  ... N X1
    244  ... F  Q:LENGTH<512  D
    245  .... S X1=$E(X,1,512),X=$E(X,513,999999)
    246  .... S LENGTH=$L(X)
    247  .... W X1,@IOF
    248  .. ;
    249  .. ; @IOF (! or #) for flush character
    250  .. I X]"" W X,@IOF S CRCOUNT=0
    251  .. ;send CR
    252  .. I X="" W $C(13) S CRCOUNT=CRCOUNT+1
    253  .. ; prevent from maxstring error
    254  .. I CRCOUNT>200 W @IOF S CRCOUNT=0
     239 .. I X]"" W X,!
     240 .. ;send CR for blank lines
     241 .. I X="" W $C(13)
    255242 .. S LINENO=LINENO+1
    256243 ; Sends end block for this message
    257244 S X=$C(28)_$C(13)
    258  ; U IO W X,!
    259  U IO W X,@IOF
    260  ;switch to null device
    261  I $G(IO(0))'="",$G(IO(0))'=IO U IO(0)
     245 U IO W X,!
     246 I $G(IO(0))'="",$G(IO(0))'=IO U IO(0) ;switch to null device if opened to prevent 'leakage'
    262247 Q 1
    263248 ;
     
    271256 G OPENA^HLCSTCP3
    272257 ;
    273 RDERR D RDERR^HLCSTCP4 Q
    274 ERROR D ERROR^HLCSTCP4 Q
     258RDERR D RDERR^HLCSTCP4 Q  ; Exceeded 10,000 bytes, so split on 12/2/03-LJA
     259ERROR D ERROR^HLCSTCP4 Q  ; Exceeded 10,000 bytes, so split on 12/2/03-LJA
    275260 ;
    276261CC(X) ;cleanup and close
Note: See TracChangeset for help on using the changeset viewer.