BAREDIT ; IHS/SD/LSL - CREATE ENTRY IN A/R EDI TRANSPORT FILE (1) ;
;;1.8;IHS ACCOUNTS RECEIVABLE;;OCT 26, 2005
;
; IHS/SD/LSL - 08/01/2002 - V1.7 Patch 4
; For HIPAA compliance. Make 835 v4010 entry in A/R EDI
; TRANSPORT FILE.
;
; *********************************************************************
;
; If running this routine for to create new transports, inside the
; code please change the initial values of the following variables:
;
; BARNAME Name of EDI transport adding
; BARSEPCD Line tag|routine containing code to determine
; seperators
; BARTABLE Data Type for table elements
; BARPRVST Provider Beginning segment
; BARPRVEN Provider Ending segment
; BARTRAIL Trailer beginning segment
;
; *********************************************************************
START ; EP
D INIT ; Initialize variables
I $D(^BAREDI("1T","B","HIPAA 835 v4010")) D Q
. W !!,"HIPAA 835 v4010 Transport already exists"
. D XIT
; Create new entry ^BAREDI("1T",
I '$D(^BAREDI("1T","B","HIPAA 835 v4010")) D ENTRY
I '+$G(BAREDITR) D Q ; Entry creation failed
. W !!,"EDI TRANSPORT ENTRY NOT CREATED"
. D XIT
. Q
D SEGMENT^BAREDIT2 ; Create Segment Table (and element)
D VARPROC ; Create Variable Processing Table
D UPDTAB ; Update EDI table entries
D XIT
Q
; *********************************************************************
INIT ;
; Initialize variables
S BARNAME="HIPAA 835 v4010" ; Name of transport
S BARSEPCD="SEP|BAREDPA1(IMPDA)" ; Code identifying seg,etc seperator
S BARTABLE="ID" ; Data Type for table elements
S BARPRVST="LX" ; Provider Beginning segment
S BARPRVEN="CLP" ; Provider Ending segment
S BARTRAIL="SE" ; Trailer beginning segment
S BARDELIM=";;" ; Delimeter (FM doesn't like "" in DR string)
Q
; *********************************************************************
ENTRY ;
; Create entry in A/R EDI TRANSPORT File
S DIC="^BAREDI(""1T"","
S DIC(0)="LZ"
S X=BARNAME
S DIC("DR")=".02///^S X=BARSEPCD"
S DIC("DR")=DIC("DR")_";.03///^S X=BARTABLE"
S DIC("DR")=DIC("DR")_";.04///^S X=BARPRVST"
S DIC("DR")=DIC("DR")_";.05///^S X=BARPRVEN"
S DIC("DR")=DIC("DR")_";.06///^S X=BARTRAIL"
K DD,DO
D FILE^DICN
Q:Y<0
S BAREDITR=+Y
Q
; *********************************************************************
VARPROC ;
; Create entries in VARIABLE PROCESSING multiple of A/R EDI TRANSPORT
S BARVCNT=0
F D VARPROC2 Q:BARVP="END"
Q
; *********************************************************************
VARPROC2 ;
S BARVCNT=BARVCNT+1
S BARVP=$P($T(@1+BARVCNT),";;",2,3)
Q:BARVP="END"
D VARPROC3
Q
; *********************************************************************
VARPROC3 ;
K DA,DIC,X,Y
S DA(1)=BAREDITR
S DIC="^BAREDI(""1T"","_DA(1)_",70,"
S DIC(0)="LZ"
S DIC("P")=$P(^DD(90056.01,70,0),U,2)
S X=$P(BARVP,BARDELIM)
S DIC("DR")=".02///^S X=$P(BARVP,BARDELIM,2)"
K DD,DO
D FILE^DICN
Q
; *********************************************************************
;
UPDTAB ;
; Update processing routine in A/R EDI TABLES
K DIE,DR,DA
S DIE="^BARETBL("
S DA=33
S DR=".03///D CLMADJCD|BAREDP02"
D ^DIE
K DA,DR
S DA=34
S DR=".03///D RMKCODE|BAREDP02"
D ^DIE
K DA,DR,DIE
Q
; ********************************************************************
XIT ;
D ^BARVKL0
Q
; *********************************************************************
1 ;;VARIABLE;;ROUTINE
;;VCLMDATE;;CLMDATE|BAREDPA1
;;VADJAMT;;ADJAMT|BAREDPA1
;;VBILNUM;;BILNUM|BAREDPA1
;;VPRCONBR;;VPRCNTCT|BAREDPA1
;;VCHECK;;HIPAACHK|BAREDPA1
;;VPAYEE;;PAY|BAREDPA1
;;VPATHIC;;PATIENT|BAREDPA1
;;END
BAREDIT ; IHS/SD/LSL - CREATE ENTRY IN A/R EDI TRANSPORT FILE (1) ;
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;;OCT 26, 2005
+2 ;
+3 ; IHS/SD/LSL - 08/01/2002 - V1.7 Patch 4
+4 ; For HIPAA compliance. Make 835 v4010 entry in A/R EDI
+5 ; TRANSPORT FILE.
+6 ;
+7 ; *********************************************************************
+8 ;
+9 ; If running this routine for to create new transports, inside the
+10 ; code please change the initial values of the following variables:
+11 ;
+12 ; BARNAME Name of EDI transport adding
+13 ; BARSEPCD Line tag|routine containing code to determine
+14 ; seperators
+15 ; BARTABLE Data Type for table elements
+16 ; BARPRVST Provider Beginning segment
+17 ; BARPRVEN Provider Ending segment
+18 ; BARTRAIL Trailer beginning segment
+19 ;
+20 ; *********************************************************************
START ; EP
+1 ; Initialize variables
DO INIT
+2 IF $DATA(^BAREDI("1T","B","HIPAA 835 v4010"))
Begin DoDot:1
+3 WRITE !!,"HIPAA 835 v4010 Transport already exists"
+4 DO XIT
End DoDot:1
QUIT
+5 ; Create new entry ^BAREDI("1T",
+6 IF '$DATA(^BAREDI("1T","B","HIPAA 835 v4010"))
DO ENTRY
+7 ; Entry creation failed
IF '+$GET(BAREDITR)
Begin DoDot:1
+8 WRITE !!,"EDI TRANSPORT ENTRY NOT CREATED"
+9 DO XIT
+10 QUIT
End DoDot:1
QUIT
+11 ; Create Segment Table (and element)
DO SEGMENT^BAREDIT2
+12 ; Create Variable Processing Table
DO VARPROC
+13 ; Update EDI table entries
DO UPDTAB
+14 DO XIT
+15 QUIT
+16 ; *********************************************************************
INIT ;
+1 ; Initialize variables
+2 ; Name of transport
SET BARNAME="HIPAA 835 v4010"
+3 ; Code identifying seg,etc seperator
SET BARSEPCD="SEP|BAREDPA1(IMPDA)"
+4 ; Data Type for table elements
SET BARTABLE="ID"
+5 ; Provider Beginning segment
SET BARPRVST="LX"
+6 ; Provider Ending segment
SET BARPRVEN="CLP"
+7 ; Trailer beginning segment
SET BARTRAIL="SE"
+8 ; Delimeter (FM doesn't like "" in DR string)
SET BARDELIM=";;"
+9 QUIT
+10 ; *********************************************************************
ENTRY ;
+1 ; Create entry in A/R EDI TRANSPORT File
+2 SET DIC="^BAREDI(""1T"","
+3 SET DIC(0)="LZ"
+4 SET X=BARNAME
+5 SET DIC("DR")=".02///^S X=BARSEPCD"
+6 SET DIC("DR")=DIC("DR")_";.03///^S X=BARTABLE"
+7 SET DIC("DR")=DIC("DR")_";.04///^S X=BARPRVST"
+8 SET DIC("DR")=DIC("DR")_";.05///^S X=BARPRVEN"
+9 SET DIC("DR")=DIC("DR")_";.06///^S X=BARTRAIL"
+10 KILL DD,DO
+11 DO FILE^DICN
+12 IF Y<0
QUIT
+13 SET BAREDITR=+Y
+14 QUIT
+15 ; *********************************************************************
VARPROC ;
+1 ; Create entries in VARIABLE PROCESSING multiple of A/R EDI TRANSPORT
+2 SET BARVCNT=0
+3 FOR
DO VARPROC2
IF BARVP="END"
QUIT
+4 QUIT
+5 ; *********************************************************************
VARPROC2 ;
+1 SET BARVCNT=BARVCNT+1
+2 SET BARVP=$PIECE($TEXT(@1+BARVCNT),";;",2,3)
+3 IF BARVP="END"
QUIT
+4 DO VARPROC3
+5 QUIT
+6 ; *********************************************************************
VARPROC3 ;
+1 KILL DA,DIC,X,Y
+2 SET DA(1)=BAREDITR
+3 SET DIC="^BAREDI(""1T"","_DA(1)_",70,"
+4 SET DIC(0)="LZ"
+5 SET DIC("P")=$PIECE(^DD(90056.01,70,0),U,2)
+6 SET X=$PIECE(BARVP,BARDELIM)
+7 SET DIC("DR")=".02///^S X=$P(BARVP,BARDELIM,2)"
+8 KILL DD,DO
+9 DO FILE^DICN
+10 QUIT
+11 ; *********************************************************************
+12 ;
UPDTAB ;
+1 ; Update processing routine in A/R EDI TABLES
+2 KILL DIE,DR,DA
+3 SET DIE="^BARETBL("
+4 SET DA=33
+5 SET DR=".03///D CLMADJCD|BAREDP02"
+6 DO ^DIE
+7 KILL DA,DR
+8 SET DA=34
+9 SET DR=".03///D RMKCODE|BAREDP02"
+10 DO ^DIE
+11 KILL DA,DR,DIE
+12 QUIT
+13 ; ********************************************************************
XIT ;
+1 DO ^BARVKL0
+2 QUIT
+3 ; *********************************************************************
1 ;;VARIABLE;;ROUTINE
+1 ;;VCLMDATE;;CLMDATE|BAREDPA1
+2 ;;VADJAMT;;ADJAMT|BAREDPA1
+3 ;;VBILNUM;;BILNUM|BAREDPA1
+4 ;;VPRCONBR;;VPRCNTCT|BAREDPA1
+5 ;;VCHECK;;HIPAACHK|BAREDPA1
+6 ;;VPAYEE;;PAY|BAREDPA1
+7 ;;VPATHIC;;PATIENT|BAREDPA1
+8 ;;END