Changeset 636 for FOIAVistA/tag/r/HEALTH_LEVEL_SEVEN-HL/HLCSTCP2.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/HLCSTCP2.m
r628 r636 1 HLCSTCP2 ;SFIRMFO/RSD - BI-DIRECTIONAL TCP ; 10/17/2007 09:372 ;;1.6;HEALTH LEVEL SEVEN;**19,43,49,57,63,64,66,67,76,77,87,109,133 ,122**;Oct 13,1995;Build 141 HLCSTCP2 ;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 3 3 ;Per VHA Directive 2004-038, this routine should not be modified. 4 4 ;Sender … … 11 11 S HLTCPO=HLDP,HLMSG="",(HLRETRY,HLRETMG)=0 12 12 ; 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) 19 16 ; 20 17 ;persistent conection, open connection first, HLPORT=open port … … 39 36 ; and then check the link if it open or not 40 37 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") 43 39 ;HLMSG=next msg, set at tag DONE 44 40 I 'HLMSG S HLMSG=+$O(^HLMA("AC","O",HLDP,0)),HLRETRY=0 Q:'HLMSG 45 41 ; 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 ; 46 47 S HLI=+$G(^HLMA(HLMSG,0)),HLJ=$O(^("MSH",0)),HLTCP="" 47 48 ;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 58 50 ;update msg status to 'being transmitted'; if cancelled decrement link and quit 59 51 I '$$CHKMSG(1.5) D LLCNT^HLCSTCP(HLDP,3,1) S HLMSG=0 Q … … 153 145 ; Set up error trap 154 146 N $ETRAP,$ESTACK S $ETRAP="D ERROR^HLCSTCP2" 155 ; patch HL*1.6*122156 N HLTMBUF157 147 ;override ack timeout 158 148 I $G(HLP("ACKTIME")) N HLDBACK S HLDBACK=HLP("ACKTIME") … … 179 169 D STATUS^HLTF0(HLMSG,ST,$G(ERR),$G(ERRMSG),1) 180 170 ; 171 ;**109** 181 172 D DEQUE^HLCSREP(HLDP,"O",HLMSG) 182 173 ; … … 189 180 ;returns 1=msg was updated, 0=msg has been canceled 190 181 N X 182 ; 183 ;**109** 184 ;F L +^HLMA(HLMSG,"P"):1 Q:$T H 1 185 ; 191 186 ; 192 187 ; New HL*1.6*77 code starting here... … … 195 190 . D STATUS^HLTF0(HLMSG,4,$P(HLERROR,U),$P(HLERROR,U,2),1) 196 191 .; 192 .;**109** 197 193 . 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 200 198 ; 201 199 ;get status, quit if msg was cancelled 202 200 ; 201 ;**109** 202 ;S X=+^HLMA(HLMSG,"P") I X=3 L -^HLMA(HLMSG,"P") Q 0 203 203 S X=+^HLMA(HLMSG,"P") Q:X=3 0 204 204 ; 205 205 ;update status if it is different 206 206 I $G(HLI),HLI'=X D STATUS^HLTF0(HLMSG,HLI) 207 ; 208 ;**109** 209 ;L -^HLMA(HLMSG,"P") 207 210 ; 208 211 Q 1 … … 216 219 ; -1 - Unsuccessful 217 220 ; 218 N HLDA2,HLAR,HLI,LINENO,X,CRCOUNT 219 S CRCOUNT=0 221 N HLDA2,HLAR,HLI,LINENO,X 220 222 ;set error trap, used when called from HLTP3 221 223 ; … … 235 237 .. ;first line, need start block char. 236 238 .. 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) 255 242 .. S LINENO=LINENO+1 256 243 ; Sends end block for this message 257 244 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' 262 247 Q 1 263 248 ; … … 271 256 G OPENA^HLCSTCP3 272 257 ; 273 RDERR D RDERR^HLCSTCP4 Q 274 ERROR D ERROR^HLCSTCP4 Q 258 RDERR D RDERR^HLCSTCP4 Q ; Exceeded 10,000 bytes, so split on 12/2/03-LJA 259 ERROR D ERROR^HLCSTCP4 Q ; Exceeded 10,000 bytes, so split on 12/2/03-LJA 275 260 ; 276 261 CC(X) ;cleanup and close
Note:
See TracChangeset
for help on using the changeset viewer.