BAR50IT2 ; IHS/SD/LSL - CREATE ENTRY IN A/R EDI TRANSPORT FILE (2) ;
;;1.8;IHS ACCOUNTS RECEIVABLE;**21**;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. This routine defines the Segments.
;
; ********************************************************************
Q
; ********************************************************************
SEGMENT ; EP
; Create Segment Multiple in A/R EDI TRANSPORT File
S BARSGCNT=0
F D SEGMENT2 Q:BARSEG="END"
Q
; ********************************************************************
SEGMENT2 ;
; Loop Segments
S BARSGCNT=BARSGCNT+1
S BARSEG=$P($T(@1+BARSGCNT),BARDELIM,2,8)
Q:BARSEG="END"
D SEGMENT3
Q:'+BARSEGDA
D ELEMENT^BAR50IT3
Q
; ********************************************************************
SEGMENT3 ;
; Create Segment multiple entry in A/R EDI TRANSPORT File
K DA,DIC,X,Y
S DA(1)=BAREDITR
S DIC="^BAREDI(""1T"","_DA(1)_",10,"
S DIC(0)="LZ"
S DIC("P")=$P(^DD(90056.01,10,0),U,2)
S X=$P(BARSEG,BARDELIM)
S BARSEGID=$P(BARSEG,BARDELIM,2)
S DIC("DR")=".02///^S X=BARSEGID"
S DIC("DR")=DIC("DR")_";.03///^S X=$P(BARSEG,BARDELIM,3)"
S DIC("DR")=DIC("DR")_";.04///^S X=$P(BARSEG,BARDELIM,4)"
S:$P(BARSEG,BARDELIM,5)]"" DIC("DR")=DIC("DR")_";.05///^S X=$P(BARSEG,BARDELIM,5)"
S:$P(BARSEG,BARDELIM,6)]"" DIC("DR")=DIC("DR")_";.06///^S X=$P(BARSEG,BARDELIM,6)"
K DD,DO
D FILE^DICN
Q:+Y<0
S BARSEGDA=+Y
Q
; ********************************************************************
; Level Mark = a flag signifying loop on that Segment
; Max Use = the number of times segment repeats if >1
; in accordance with the implementation guide.
; If the guide said >1, I used 99, otherwise # in guide
; pst flag = This segment has posting elements
; ********************************************************************
1 ;;Seg name;;Seg ID;;Seg Desc;;Position;;Level Mark;;Max use;;pst flag
;;0-010-ISA;;ISA;;Interchange Control Header;;0-010;;;;;;1
;;1-010-GS;;GS;;Functional Group Header;;1-010;;1;;;;1
;;2-010-ST;;ST;;Transaction Set Header;;2-010;;1
;;2-020-BPR;;BPR;;Beginning Seg for Payment/RA;;2-020
;;2-040-TRN;;TRN;;Reassociation Trace Number;;2-040;;;;;;1
;;2-050-CUR;;CUR;;Foreign Currency Information;;2-050
;;2-060.A-REF;;REF;;Receiver Identification;;2-060.A
;;2-060.B-REF;;REF;;Version Identification;;2-060.B;;;;;;1
;;2-070-DTM;;DTM;;Production Date;;2-070
;;2-080.A-N1;;N1;;Payer Name;;2-080.A;;1;;;;1
;;2-100.A-N3;;N3;;Payer Address;;2-100.A
;;2-110.A-N4;;N4;;Payer City, State, Zip;;2-110.A
;;2-120.A-REF;;REF;;Additional Payer Id;;2-120.A;;;;4
;;2-130-PER;;PER;;Payer Contact Information;;2-130
;;2-080.B-N1;;N1;;Payee Name;;2-080.B;;1;;;;1
;;2-100.B-N3;;N3;;Payee Address;;2-100.B
;;2-110.B-N4;;N4;;Payee City, State, Zip;;2-110.B
;;2-120.B-REF;;REF;;Additional Payee Id;;2-120.B;;;;99
;;3-003-LX;;LX;;Loop Indicator;;3-003;;1
;;3-005-TS3;;TS3;;Provider Summary Information;;3-005;;;;;;1
;;3-007-TS2;;TS2;;Provider Supplimental Summary;;3-007
;;3-010-CLP;;CLP;;Claim Level Payments;;3-010;;1;;;;1
;;3-020-CAS;;CAS;;Claim Level Adjustments;;3-020;;;;99;;1
;;3-030.A-NM1;;NM1;;Patient Name;;3-030.A;;;;;;1
;;3-030.B-NM1;;NM1;;Insured Name;;3-030.B
;;3-030.C-NM1;;NM1;;Corrected Patient/Insured;;3-030.C
;;3-030.D-NM1;;NM1;;Service Provider Name;;3-030.D
;;3-030.E-NM1;;NM1;;Crossover Carrier Name;;3-030.E
;;3-030.F-NM1;;NM1;;Corrected Priority Payer Name;;3-030.F;;;;2
;;3-033-MIA;;MIA;;MCR Inpatient Adjudication;;3-033
;;3-035-MOA;;MOA;;MCR Outpatient Adjudication;;3-035
;;3-040.A-REF;;REF;;Other Claim Related Id;;3-040.A;;;;5;;1
;;3-040.B-REF;;REF;;Rendering Provider Id;;3-040.B;;;;10
;;3-050-DTM;;DTM;;Claim Date;;3-050;;;;4;;1
;;3-060-PER;;PER;;Claim Contact Info;;3-060;;;;3
;;3-062-AMT;;AMT;;Claim Suppl Info ($$);;3-062;;;;14
;;3-064-QTY;;QTY;;Claim Suppl Info (Quantity);;3-064;;;;15
;;3-070-SVC;;SVC;;Service Information;;3-070;;1
;;3-080-DTM;;DTM;;Service Date;;3-080;;;;3;;1
;;3-090-CAS;;CAS;;Line Level Adjustments;;3-090;;;;99;;1
;;3-100.A-REF;;REF;;Service Identification;;3-100.A;;;;7
;;3-100.B-REF;;REF;;Rendering Provider Id;;3-100.B;;;;10
;;3-110-AMT;;AMT;;Service Suppl Amt ($);;3-110;;;;12
;;3-120-QTY;;QTY;;Service Suppl Quantity;;3-120;;;;6
;;3-130-LQ;;LQ;;Line Level Remark Codes;;3-130;;;;99
;;4-010-PLB;;PLB;;Provider Level Adjustments;;4-010;;;;99;;1
;;4-020-SE;;SE;;Transaction Set Trailer;;4-020
;;5-010-GE;;GE;;Functional Group Trailer;;5-010
;;6-010-IEA;;IEA;;Interchange Control Trailer;;6-010
;;END
BAR50IT2 ; IHS/SD/LSL - CREATE ENTRY IN A/R EDI TRANSPORT FILE (2) ;
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**21**;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. This routine defines the Segments.
+6 ;
+7 ; ********************************************************************
+8 QUIT
+9 ; ********************************************************************
SEGMENT ; EP
+1 ; Create Segment Multiple in A/R EDI TRANSPORT File
+2 SET BARSGCNT=0
+3 FOR
DO SEGMENT2
IF BARSEG="END"
QUIT
+4 QUIT
+5 ; ********************************************************************
SEGMENT2 ;
+1 ; Loop Segments
+2 SET BARSGCNT=BARSGCNT+1
+3 SET BARSEG=$PIECE($TEXT(@1+BARSGCNT),BARDELIM,2,8)
+4 IF BARSEG="END"
QUIT
+5 DO SEGMENT3
+6 IF '+BARSEGDA
QUIT
+7 DO ELEMENT^BAR50IT3
+8 QUIT
+9 ; ********************************************************************
SEGMENT3 ;
+1 ; Create Segment multiple entry in A/R EDI TRANSPORT File
+2 KILL DA,DIC,X,Y
+3 SET DA(1)=BAREDITR
+4 SET DIC="^BAREDI(""1T"","_DA(1)_",10,"
+5 SET DIC(0)="LZ"
+6 SET DIC("P")=$PIECE(^DD(90056.01,10,0),U,2)
+7 SET X=$PIECE(BARSEG,BARDELIM)
+8 SET BARSEGID=$PIECE(BARSEG,BARDELIM,2)
+9 SET DIC("DR")=".02///^S X=BARSEGID"
+10 SET DIC("DR")=DIC("DR")_";.03///^S X=$P(BARSEG,BARDELIM,3)"
+11 SET DIC("DR")=DIC("DR")_";.04///^S X=$P(BARSEG,BARDELIM,4)"
+12 IF $PIECE(BARSEG,BARDELIM,5)]""
SET DIC("DR")=DIC("DR")_";.05///^S X=$P(BARSEG,BARDELIM,5)"
+13 IF $PIECE(BARSEG,BARDELIM,6)]""
SET DIC("DR")=DIC("DR")_";.06///^S X=$P(BARSEG,BARDELIM,6)"
+14 KILL DD,DO
+15 DO FILE^DICN
+16 IF +Y<0
QUIT
+17 SET BARSEGDA=+Y
+18 QUIT
+19 ; ********************************************************************
+20 ; Level Mark = a flag signifying loop on that Segment
+21 ; Max Use = the number of times segment repeats if >1
+22 ; in accordance with the implementation guide.
+23 ; If the guide said >1, I used 99, otherwise # in guide
+24 ; pst flag = This segment has posting elements
+25 ; ********************************************************************
1 ;;Seg name;;Seg ID;;Seg Desc;;Position;;Level Mark;;Max use;;pst flag
+1 ;;0-010-ISA;;ISA;;Interchange Control Header;;0-010;;;;;;1
+2 ;;1-010-GS;;GS;;Functional Group Header;;1-010;;1;;;;1
+3 ;;2-010-ST;;ST;;Transaction Set Header;;2-010;;1
+4 ;;2-020-BPR;;BPR;;Beginning Seg for Payment/RA;;2-020
+5 ;;2-040-TRN;;TRN;;Reassociation Trace Number;;2-040;;;;;;1
+6 ;;2-050-CUR;;CUR;;Foreign Currency Information;;2-050
+7 ;;2-060.A-REF;;REF;;Receiver Identification;;2-060.A
+8 ;;2-060.B-REF;;REF;;Version Identification;;2-060.B;;;;;;1
+9 ;;2-070-DTM;;DTM;;Production Date;;2-070
+10 ;;2-080.A-N1;;N1;;Payer Name;;2-080.A;;1;;;;1
+11 ;;2-100.A-N3;;N3;;Payer Address;;2-100.A
+12 ;;2-110.A-N4;;N4;;Payer City, State, Zip;;2-110.A
+13 ;;2-120.A-REF;;REF;;Additional Payer Id;;2-120.A;;;;4
+14 ;;2-130-PER;;PER;;Payer Contact Information;;2-130
+15 ;;2-080.B-N1;;N1;;Payee Name;;2-080.B;;1;;;;1
+16 ;;2-100.B-N3;;N3;;Payee Address;;2-100.B
+17 ;;2-110.B-N4;;N4;;Payee City, State, Zip;;2-110.B
+18 ;;2-120.B-REF;;REF;;Additional Payee Id;;2-120.B;;;;99
+19 ;;3-003-LX;;LX;;Loop Indicator;;3-003;;1
+20 ;;3-005-TS3;;TS3;;Provider Summary Information;;3-005;;;;;;1
+21 ;;3-007-TS2;;TS2;;Provider Supplimental Summary;;3-007
+22 ;;3-010-CLP;;CLP;;Claim Level Payments;;3-010;;1;;;;1
+23 ;;3-020-CAS;;CAS;;Claim Level Adjustments;;3-020;;;;99;;1
+24 ;;3-030.A-NM1;;NM1;;Patient Name;;3-030.A;;;;;;1
+25 ;;3-030.B-NM1;;NM1;;Insured Name;;3-030.B
+26 ;;3-030.C-NM1;;NM1;;Corrected Patient/Insured;;3-030.C
+27 ;;3-030.D-NM1;;NM1;;Service Provider Name;;3-030.D
+28 ;;3-030.E-NM1;;NM1;;Crossover Carrier Name;;3-030.E
+29 ;;3-030.F-NM1;;NM1;;Corrected Priority Payer Name;;3-030.F;;;;2
+30 ;;3-033-MIA;;MIA;;MCR Inpatient Adjudication;;3-033
+31 ;;3-035-MOA;;MOA;;MCR Outpatient Adjudication;;3-035
+32 ;;3-040.A-REF;;REF;;Other Claim Related Id;;3-040.A;;;;5;;1
+33 ;;3-040.B-REF;;REF;;Rendering Provider Id;;3-040.B;;;;10
+34 ;;3-050-DTM;;DTM;;Claim Date;;3-050;;;;4;;1
+35 ;;3-060-PER;;PER;;Claim Contact Info;;3-060;;;;3
+36 ;;3-062-AMT;;AMT;;Claim Suppl Info ($$);;3-062;;;;14
+37 ;;3-064-QTY;;QTY;;Claim Suppl Info (Quantity);;3-064;;;;15
+38 ;;3-070-SVC;;SVC;;Service Information;;3-070;;1
+39 ;;3-080-DTM;;DTM;;Service Date;;3-080;;;;3;;1
+40 ;;3-090-CAS;;CAS;;Line Level Adjustments;;3-090;;;;99;;1
+41 ;;3-100.A-REF;;REF;;Service Identification;;3-100.A;;;;7
+42 ;;3-100.B-REF;;REF;;Rendering Provider Id;;3-100.B;;;;10
+43 ;;3-110-AMT;;AMT;;Service Suppl Amt ($);;3-110;;;;12
+44 ;;3-120-QTY;;QTY;;Service Suppl Quantity;;3-120;;;;6
+45 ;;3-130-LQ;;LQ;;Line Level Remark Codes;;3-130;;;;99
+46 ;;4-010-PLB;;PLB;;Provider Level Adjustments;;4-010;;;;99;;1
+47 ;;4-020-SE;;SE;;Transaction Set Trailer;;4-020
+48 ;;5-010-GE;;GE;;Functional Group Trailer;;5-010
+49 ;;6-010-IEA;;IEA;;Interchange Control Trailer;;6-010
+50 ;;END