ABSPOSAS ; IHS/FCS/DRS - Low-level SEND claim ; [ 08/21/2002 9:13 AM ]
;;1.0;PHARMACY POINT OF SALE;**2**;JUN 21, 2001;Build 38
Q
;
; Modem - low-level message send
; SENDREQ is main
;
;IHS/SD/lwj 6/7/02 need to add a line feed when the system is
; Cache.
;
;IHS/SD/lwj 8/19/02 we were getting "invalid version" and
;"corrupted" response messages after the switch to Cache and
; only at the Cache sites. From the research, it appeared that
; the buffer was not being cleared all the way. David Slauenwhite,
; Hoarce Whitt, and Intersystems, determined that rather than a
; "!" (cr/lf) we needed to W *-3 after each send. The code
; has been changed, and it appears has solved the problems.
;
;
SENDREQ(DIALOUT,MSG) ;EP -
; (Don't modify MSG; caller may have called with .MSG)
N IO S IO=$$IO^ABSPOSA(DIALOUT) U IO
I $$T1DIRECT^ABSPOSA(DIALOUT) D
. W $TR($J($L(MSG),4)," ","0"),MSG ; write message length, then msg
. ;I ^%ZOSF("OS")["OpenM" W ! ;IHS/SD/lwj 6/7/02 LF for Cache
. I ^%ZOSF("OS")["OpenM" W *-3 ;IHS/SD/lwj 8/19/02 for Cache
. D LOG^ABSPOSL($T(+0)_" - T1 LINE - SEND - "_$L(MSG)_"+4 characters")
E D
. N STX,ETX S STX=$C(2),ETX=$C(3)
. N X S X="SENDZE^"_$T(+0),@^%ZOSF("TRAP")
. W STX,MSG,ETX,$$LRC^ABSPOSAD(MSG_ETX)
. D LOG^ABSPOSL($T(+0)_" - MODEM - SEND - "_$L(MSG)_"+3 characters")
; SAVECOPY - uncomment for development debugging
;D SAVECOPY^ABSPOSAY(MSG,"C")
Q:$Q 0 Q
SENDZE D LOGZE("SENDREQ") Q
SENDCHAR(DIALOUT,CHAR) N IO S IO=$$IO^ABSPOSA(DIALOUT) U IO W CHAR Q
SENDACK(DIALOUT) ;EP -
D SENDCHAR(DIALOUT,$C(6)) Q
SENDNAK(DIALOUT) ;EP -
D SENDCHAR(DIALOUT,$C(21)) Q
SENDEOT(DIALOUT) D SENDCHAR(DIALOUT,$C(4)) Q
SENDETB(DIALOUT) ;EP -
D SENDCHAR(DIALOUT,$C(23)) Q
LOGZE(WHERE) D LOG^ABSPOSL($T(+0)_" - MODEM - "_WHERE_" - $ZE="_$$ZE^ABSPOS) Q
ABSPOSAS ; IHS/FCS/DRS - Low-level SEND claim ; [ 08/21/2002 9:13 AM ]
+1 ;;1.0;PHARMACY POINT OF SALE;**2**;JUN 21, 2001;Build 38
+2 QUIT
+3 ;
+4 ; Modem - low-level message send
+5 ; SENDREQ is main
+6 ;
+7 ;IHS/SD/lwj 6/7/02 need to add a line feed when the system is
+8 ; Cache.
+9 ;
+10 ;IHS/SD/lwj 8/19/02 we were getting "invalid version" and
+11 ;"corrupted" response messages after the switch to Cache and
+12 ; only at the Cache sites. From the research, it appeared that
+13 ; the buffer was not being cleared all the way. David Slauenwhite,
+14 ; Hoarce Whitt, and Intersystems, determined that rather than a
+15 ; "!" (cr/lf) we needed to W *-3 after each send. The code
+16 ; has been changed, and it appears has solved the problems.
+17 ;
+18 ;
SENDREQ(DIALOUT,MSG) ;EP -
+1 ; (Don't modify MSG; caller may have called with .MSG)
+2 NEW IO
SET IO=$$IO^ABSPOSA(DIALOUT)
USE IO
+3 IF $$T1DIRECT^ABSPOSA(DIALOUT)
Begin DoDot:1
+4 ; write message length, then msg
WRITE $TRANSLATE($JUSTIFY($LENGTH(MSG),4)," ","0"),MSG
+5 ;I ^%ZOSF("OS")["OpenM" W ! ;IHS/SD/lwj 6/7/02 LF for Cache
+6 ;IHS/SD/lwj 8/19/02 for Cache
IF ^%ZOSF("OS")["OpenM"
WRITE *-3
+7 DO LOG^ABSPOSL($TEXT(+0)_" - T1 LINE - SEND - "_$LENGTH(MSG)_"+4 characters")
End DoDot:1
+8 IF '$TEST
Begin DoDot:1
+9 NEW STX,ETX
SET STX=$CHAR(2)
SET ETX=$CHAR(3)
+10 NEW X
SET X="SENDZE^"_$TEXT(+0)
SET @^%ZOSF("TRAP")
+11 WRITE STX,MSG,ETX,$$LRC^ABSPOSAD(MSG_ETX)
+12 DO LOG^ABSPOSL($TEXT(+0)_" - MODEM - SEND - "_$LENGTH(MSG)_"+3 characters")
End DoDot:1
+13 ; SAVECOPY - uncomment for development debugging
+14 ;D SAVECOPY^ABSPOSAY(MSG,"C")
+15 IF $QUIT
QUIT 0
QUIT
SENDZE DO LOGZE("SENDREQ")
QUIT
SENDCHAR(DIALOUT,CHAR) NEW IO
SET IO=$$IO^ABSPOSA(DIALOUT)
USE IO
WRITE CHAR
QUIT
SENDACK(DIALOUT) ;EP -
+1 DO SENDCHAR(DIALOUT,$CHAR(6))
QUIT
SENDNAK(DIALOUT) ;EP -
+1 DO SENDCHAR(DIALOUT,$CHAR(21))
QUIT
SENDEOT(DIALOUT) DO SENDCHAR(DIALOUT,$CHAR(4))
QUIT
SENDETB(DIALOUT) ;EP -
+1 DO SENDCHAR(DIALOUT,$CHAR(23))
QUIT
LOGZE(WHERE) DO LOG^ABSPOSL($TEXT(+0)_" - MODEM - "_WHERE_" - $ZE="_$$ZE^ABSPOS)
QUIT