ABSPECX4 ; IHS/FCS/DRS - JWS ; [ 09/12/2002 10:00 AM ]
;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
;----------------------------------------------------------------------
;----------------------------------------------------------------------
;Function which gets a claim or response record from the ^ABSPECX
;transmission scratch global.
;
;Input Variables: IEN - Internal Entry Number of Claim Record
; MODE - "C" for Claim or "R" for Response
;
;Function Returns: AREC - ASCII formated record
;----------------------------------------------------------------------
; SVEAREC (Save a Record)
; Called from ABSPOSQH from ABSPOSQG from ABSPOSQ2
; GETAREC is apparently obsolete?
;
;GetAREC(IEN,MODE)
;Manage Local variables
;N AREC,NNODES,INDEX
;
;Make sure input variables are defined
;Q:$G(IEN)="" ""
;Q:$G(MODE)="" ""
;
;Assemble ascii record from its 245 character sections
;S AREC=""
;S NNODES=$G(^ABSPECX($J,MODE,IEN,0))
;Q:+NNODES=0
;F INDEX=1:1:NNODES D
;.S AREC=AREC_$G(^ABSPECX($J,MODE,IEN,INDEX))
;
;Q AREC
;----------------------------------------------------------------------
;Routine which creates and breaks apart an ASCII claim or response
;record and stores it in the ^ABSPECX transmission scratch global.
;
;Input Variables: AREC - ASCII formatted record
; IEN - Internal Entry Number of Claim Record
; MODE - "C" for Claim or "R" for Response
;
;Function Returns: AREC - ASCII formated record
;----------------------------------------------------------------------
SVEAREC(AREC,IEN,MODE) ;EP - from ABSPOSQH
;Manage local variables
N NCHARS,NNODES,INDEX,START,END
;
;Make sure input variables are defined
Q:$G(AREC)=""
Q:$G(MODE)=""
Q:$G(IEN)=""
;
;Determine number of nodes need to store AREC
S NCHARS=$L(AREC)
S NNODES=((NCHARS-1)\245)+1
;
K ^ABSPECX($J,MODE,IEN)
S ^ABSPECX($J,MODE,IEN,0)=NNODES
;
;Break AREC into 245 character sections
F INDEX=1:1:NNODES D
.S START=((INDEX-1)*245)+1
.S END=START+245-1
.S:END>NCHARS END=NCHARS
.S ^ABSPECX($J,MODE,IEN,INDEX)=$E(AREC,START,END)
Q
ABSPECX4 ; IHS/FCS/DRS - JWS ; [ 09/12/2002 10:00 AM ]
+1 ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
+2 ;----------------------------------------------------------------------
+3 ;----------------------------------------------------------------------
+4 ;Function which gets a claim or response record from the ^ABSPECX
+5 ;transmission scratch global.
+6 ;
+7 ;Input Variables: IEN - Internal Entry Number of Claim Record
+8 ; MODE - "C" for Claim or "R" for Response
+9 ;
+10 ;Function Returns: AREC - ASCII formated record
+11 ;----------------------------------------------------------------------
+12 ; SVEAREC (Save a Record)
+13 ; Called from ABSPOSQH from ABSPOSQG from ABSPOSQ2
+14 ; GETAREC is apparently obsolete?
+15 ;
+16 ;GetAREC(IEN,MODE)
+17 ;Manage Local variables
+18 ;N AREC,NNODES,INDEX
+19 ;
+20 ;Make sure input variables are defined
+21 ;Q:$G(IEN)="" ""
+22 ;Q:$G(MODE)="" ""
+23 ;
+24 ;Assemble ascii record from its 245 character sections
+25 ;S AREC=""
+26 ;S NNODES=$G(^ABSPECX($J,MODE,IEN,0))
+27 ;Q:+NNODES=0
+28 ;F INDEX=1:1:NNODES D
+29 ;.S AREC=AREC_$G(^ABSPECX($J,MODE,IEN,INDEX))
+30 ;
+31 ;Q AREC
+32 ;----------------------------------------------------------------------
+33 ;Routine which creates and breaks apart an ASCII claim or response
+34 ;record and stores it in the ^ABSPECX transmission scratch global.
+35 ;
+36 ;Input Variables: AREC - ASCII formatted record
+37 ; IEN - Internal Entry Number of Claim Record
+38 ; MODE - "C" for Claim or "R" for Response
+39 ;
+40 ;Function Returns: AREC - ASCII formated record
+41 ;----------------------------------------------------------------------
SVEAREC(AREC,IEN,MODE) ;EP - from ABSPOSQH
+1 ;Manage local variables
+2 NEW NCHARS,NNODES,INDEX,START,END
+3 ;
+4 ;Make sure input variables are defined
+5 IF $GET(AREC)=""
QUIT
+6 IF $GET(MODE)=""
QUIT
+7 IF $GET(IEN)=""
QUIT
+8 ;
+9 ;Determine number of nodes need to store AREC
+10 SET NCHARS=$LENGTH(AREC)
+11 SET NNODES=((NCHARS-1)\245)+1
+12 ;
+13 KILL ^ABSPECX($JOB,MODE,IEN)
+14 SET ^ABSPECX($JOB,MODE,IEN,0)=NNODES
+15 ;
+16 ;Break AREC into 245 character sections
+17 FOR INDEX=1:1:NNODES
Begin DoDot:1
+18 SET START=((INDEX-1)*245)+1
+19 SET END=START+245-1
+20 IF END>NCHARS
SET END=NCHARS
+21 SET ^ABSPECX($JOB,MODE,IEN,INDEX)=$EXTRACT(AREC,START,END)
End DoDot:1
+22 QUIT