BAREDIT3 ; IHS/SD/LSL - CREATE AN ENTRY IN A/R EDI TRANSPORT FILE (3) ;
;;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. This routine defines the Elements.
;
; ********************************************************************
Q
; ********************************************************************
ELEMENT ; EP
; Create Element Multiple w/in Segment Multiple in A/R EDI TRANSPORT
S BARELCNT=0
F D ELEMENT2 Q:BARELEM="END"
Q
; ********************************************************************
ELEMENT2 ;
; Loop Elements
S BARELCNT=BARELCNT+1
S BARELEM=$P($T(@BARSEGID+BARELCNT),BARDELIM,2,9)
Q:BARELEM="END"
D ELEMENT3
Q:'+BARELDA
D:$P($P(BARELEM,BARDELIM,2)," ")="Composite" SUBELM^BAREDIT4
Q
; ********************************************************************
ELEMENT3 ;
; Create Segment multiple entry in A/R EDI TRANSPORT File
K DA,DIC,X,Y
S DA(2)=BAREDITR
S DA(1)=BARSEGDA
S DIC="^BAREDI(""1T"","_DA(2)_",10,"_DA(1)_",10,"
S DIC(0)="LZ"
S DIC("P")=$P(^DD(90056.0101,10,0),U,2)
S X=$P(BARELEM,BARDELIM)
S BARELID=X
S BARPSTEL=$P(BARELEM,BARDELIM,8)
I $P(BARSEG,BARDELIM)="2-060.B-REF",BARELID="REF02" S BARPSTEL="VVERMOD"
I $P(BARSEG,BARDELIM)="3-040.B-REF",BARELID="REF02" S BARPSTEL="VPATHRN"
I $P(BARSEG,BARDELIM)="2-080.A-N1",BARELID="N102" S BARPSTEL="VPAYER"
I $P(BARSEG,BARDELIM)="2-100.A-N3" D
. I BARELID="N301" S BARPSTEL="VPRADR"
. I BARELID="N302" S BARPSTEL="VPRADR2"
I $P(BARSEG,BARDELIM)="2-110.A-N4" D
. I BARELID="N401" S BARPSTEL="VPRCITY"
. I BARELID="N402" S BARPSTEL="VPRSTATE"
. I BARELID="N403" S BARPSTEL="VPRZIP"
I $P(BARSEG,BARDELIM)="2-080.B-N1",BARELID="N102" S BARPSTEL="VPAYEE"
S DIC("DR")=".02///^S X=$P(BARELEM,BARDELIM,2)"
S DIC("DR")=DIC("DR")_";.03///^S X=$P(BARELEM,BARDELIM,3)"
S:$P(BARELEM,BARDELIM,4)]"" DIC("DR")=DIC("DR")_";.04///^S X=$P(BARELEM,BARDELIM,4)"
S:$P(BARELEM,BARDELIM,5)]"" DIC("DR")=DIC("DR")_";.05///^S X=$P(BARELEM,BARDELIM,5)"
S:$P(BARELEM,BARDELIM,6)]"" DIC("DR")=DIC("DR")_";.06///^S X=$P(BARELEM,BARDELIM,6)"
S:$P(BARELEM,BARDELIM,7)]"" DIC("DR")=DIC("DR")_";.09///^S X=$P(BARELEM,BARDELIM,7)"
S:BARPSTEL]"" DIC("DR")=DIC("DR")_";.08///^S X=BARPSTEL"
K DD,DO
D FILE^DICN
Q:+Y<0
S BARELDA=+Y
Q
; ********************************************************************
; The following is a table of elements per Segment as the segments are
; ordered in 1^BAREDIT2
; ********************************************************************
;;ELEM;;DESC;;SEQ;;DATA TYPE;;MIN;;MAX;;EDI TBL PTR;;PST EL
; ********************************************************************
ISA ;;
;;ISA01;;Authorization Info Qualifier;;1;;ID;;2;;2;;1
;;ISA02;;Authorization Information;;2;;AN;;10;;10
;;ISA03;;Security Information Qualifier;;3;;ID;;2;;2;;2
;;ISA04;;Security Information;;4;;AN;;10;;10
;;ISA05;;Interchange ID Qualifier;;5;;ID;;2;;2;;3
;;ISA06;;Interchange Sender ID;;6;;AN;;15;;15
;;ISA07;;Interchange ID Qualifier;;7;;ID;;2;;2;;3
;;ISA08;;Interchange Receiver ID;;8;;AN;;15;;15
;;ISA09;;Interchange Date;;9;;DT;;6;;6
;;ISA10;;Interchange Time;;10;;TM;;4;;4
;;ISA11;;Control Standards Identifier;;11;;ID;;1;;1;;4
;;ISA12;;Control Version Number;;12;;ID;;5;;5;;5;;VVERNUM
;;ISA13;;Interchange Control Number;;13;;NO;;9;;9;;;;VCTRLNUM
;;ISA14;;Acknowlegment Requested;;14;;ID;;1;;1;;6;;VTEST
;;ISA15;;Usage Indicator;;15;;ID;;1;;1;;7
;;ISA16;;Component Element Seperator;;16;;AN;;1;;1
;;END
GS ;;
;;GS01;;Functional Identifier Code;;1;;ID;;2;;2;;8
;;GS02;;Application Sender's Code;;2;;AN;;2;;15
;;GS03;;Application Receiver's Code;;3;;AN;;2;;15
;;GS04;;Functional Group Creation Date;;4;;DT;;8;;8
;;GS05;;Functional Group Creation Time;;5;;TM;;4;;8
;;GS06;;Group Control Number;;6;;NO;;1;;9
;;GS07;;Responsible Agency Code;;7;;ID;;1;;2;;9
;;GS08;;Vers/Release/Industry ID Code;;8;;AN;;1;;12;;;;VVERSION
;;END
ST ;;
;;ST01;;Transaction Set Identify Code;;1;;ID;;3;;3;;10
;;ST02;;Transaction Set Control Number;;2;;AN;;4;;9
;;END
BPR ;;
;;BPR01;;Transaction Handling Code;;1;;ID;;1;;2;;11
;;BPR02;;Total Provider Payment;;2;;R;;1;;18
;;BPR03;;Credit/Debit Flag Code;;3;;ID;;1;;1;;12
;;BPR04;;Payment Method Code;;4;;ID;;3;;3;;13
;;BPR05;;Payment Format Code;;5;;ID;;1;;10;;14
;;BPR06;;DFI ID # Qualifier (sender);;6;;ID;;2;;2;;15
;;BPR07;;DFI ID # (sender);;7;;AN;;3;;12
;;BPR08;;Account # Qualifier (sender);;8;;ID;;1;;3;;16
;;BPR09;;Bank Account Number (sender);;9;;AN;;1;;35
;;BPR10;;Payer Identifier;;10;;AN;;10;;10
;;BPR11;;Payer Co. Supplimental Code;;11;;9;;9
;;BPR12;;DFI ID # Qualifier (receiver);;12;;ID;;2;;2;;15
;;BPR13;;DFI ID # (receiver);;13;;AN;;3;;12
;;BPR14;;Account # Qualifier (receiver);;14;;ID;;1;;3;;16
;;BPR15;;Bank Account Number (receiver);;15;;AN;;1;;35
;;BPR16;;Check Issue/EFT Effective Date;;16;;DT;;8;;8
;;END
TRN ;;
;;TRN01;;Trace Type Code;;1;;ID;;1;;2;;17
;;TRN02;;Check or EFT Trace NUmber;;2;;AN;;1;;30;;;;VCHECK
;;TRN03;;Payer Identifier;;3;;AN;;10;;10
;;TRN04;;Payer Supplimental Code;;4;;AN;;1;;30
;;END
CUR ;;
;;CUR01;;Entity Identifier Code;;1;;ID;;2;;3;;18
;;CUR02;;Currency Code;;2;;AN;;3;;3
;;CUR03;;Exchange Rate;;3;;R;;4;;10
;;END
REF ;;
;;REF01;;Reference ID Qualifier;;1;;ID;;2;;3;;19
;;REF02;;Reference Identification;;2;;AN;;1;;30;;;;VREFID
;;END
DTM ;;
;;DTM01;;Date/Time Qualifier;;1;;ID;;3;;3;;20
;;DTM02;;Date;;2;;DT;;8;;8;;;;VCLMDATE
;;END
N1 ;;
;;N101;;Entity Identifier Code;;1;;ID;;2;;3;;18
;;N102;;Payer/Payee Name;;2;;AN;;1;;60;;;;VPAYNAME
;;N103;;Identification Code Qualifier;;3;;ID;;1;;2;;21
;;N104;;Identification Code;;4;;AN;;2;;80
;;END
N3 ;;
;;N301;;Payer/Payee Address;;1;;AN;;1;;55
;;N302;;Payer/Payee Address;;2;;AN;;1;;55
;;END
N4 ;;
;;N401;;Payer/Payee City;;1;;AN;;2;;30
;;N402;;Payer/Payee State or Province;;2;;AN;;2;;2
;;N403;;Payer/Payee Postal Code;;3;;Nn;;3;;15
;;N404;;Payee Country Code;;4;;Nn;;2;;3
;;END
PER ;;
;;PER01;;Contact Function Code;;1;;ID;;2;;2;;22
;;PER02;;Contact Name;;2;;AN;;1;;60;;;;VPRCONAM
;;PER03;;Communication Number Qualifier;;3;;ID;;2;;2;;23;;VPRCONCD
;;PER04;;Contact Communication #;;4;;AN;;1;;80;;;;VPRCONBR
;;PER05;;Communication Number Qualifier;;5;;ID;;2;;2;;23;;VPRCONCD
;;PER06;;Contact Communication #;;6;;AN;;1;;80;;;;VPRCONBR
;;PER07;;Communication Number Qualifier;;5;;ID;;2;;2;;23;;VPRCONCD
;;PER08;;Contact Communication #;;6;;AN;;1;;80;;;;VPRCONBR
;;END
;;
LX ;;
;;LX01;;Assigned Loop Number;;1;;NO;;1;;6
;;END
TS3 ;;
;;TS301;;Provider Identifier;;1;;AN;;1;;30;;;;VNEWPRV
;;TS302;;Facility Type Code;;2;;AN;;1;;2
;;TS303;;Fiscal Period Date;;3;;DT;;8;;8
;;TS304;;Total Claim Count;;4;;R;;1;;15
;;TS305;;Total Submitted Charges ($);;5;;R;;1;;18
;;TS306;;Total Covered Charges ($);;6;;R;;1;;18
;;TS307;;Total Non-Covered Charges ($);;7;;R;;1;;18
;;TS308;;Total Denied Charges ($);;8;;R;;1;;18
;;TS309;;Total Provider Payment ($);;9;;R;;1;;18
;;TS310;;Total Interest ($);;10;;R;;1;;18
;;TS311;;Total Contractual Adjust ($);;11;;R;;1;;18
;;TS312;;Total Gramm-Rudman Reduct ($);;12;;R;;1;;18
;;TS313;;Total MSP Payer Amount ($);;13;;R;;1;;18
;;TS314;;Total Blood Deductable ($);;14;;R;;1;;18
;;TS315;;Total Non-Lab Charge ($);;15;;R;;1;;18
;;TS316;;Total Coinsurance Amount ($);;16;;R;;1;;18
;;TS317;;Total HCPCS Submitted Charges;;17;;R;;1;;18
;;TS318;;Total HCPCS Payable Amount ($);;18;;R;;1;;18
;;TS319;;Total Deductible Amount ($);;19;;R;;1;;18
;;TS320;;Total Prof Comp Amount ($);;20;;R;;1;;18
;;TS321;;Total MSP Pat Liability Met($);;21;;R;;1;;18
;;TS322;;Total Pat Reimbursement ($);;22;;R;;1;;18
;;TS323;;Total PIP Claim Count;;23;;R;;1;;18
;;TS324;;Total PIP Adjustment ($);;24;;R;;1;;18
;;END
TS2 ;;
;;TS201;;Total DRG Amount;;1;;R;;1;;18
;;TS202;;Total Federal Specific Amount;;2;;R;;1;;18
;;TS203;;Total Hospital Specific Amount;;3;;R;;1;;18
;;TS204;;Total Disproportionate Share;;4;;R;;1;;18
;;TS205;;Total Capital Amount;;5;;R;;1;;18
;;TS206;;Total Indirect Medical Edu Amt;;6;;R;;1;;18
;;TS207;;Total Outlier Day Count;;7;;R;;1;;15
;;TS208;;Total Day Outlier Amount;;8;;R;;1;;18
;;TS209;;Total Cost Outlier Amount;;9;;R;;1;;18
;;TS210;;Average DRG Length of Stay;;10;;R;;1;;15
;;TS211;;Total Discharge Count;;11;;R;;1;;15
;;TS212;;Total Cost Report Day Count;;12;;R;;1;;15
;;TS213;;Total Covered Day Count;;13;;R;;1;;15
;;TS214;;Total Non-Covered Day Count;;14;;R;;1;;15
;;TS215;;Total MSP Pass-Through Amt;;15;;R;;1;;18
;;TS216;;Average DRG Weight;;16;;R;;1;;15
;;TS217;;Total PPS Capital FSP DRG Amt;;17;;R;;1;;18
;;TS218;;Total PPS Capital HSP DRG Amt;;18;;R;;1;;18
;;TS219;;Total PPS DSH DRG Amount;;19;;R;;1;;18
;;END
CLP ;;
;;CLP01;;Patient Control Number;;1;;AN;;1;;38;;;;VNEWBILL
;;CLP02;;Claim Status Code;;2;;ID;;1;;2;;24
;;CLP03;;Total Submitted Charges ($);;3;;R;;1;;18;;;;VCLMCHG
;;CLP04;;Claim Payment Amount ($);;4;;R;;1;;18;;;;VCLMPAY
;;CLP05;;Patient Responsibility Amt ($);;5;;R;;1;;18
;;CLP06;;Claim Filing Indicator Code;;6;;ID;;1;;2;;25
;;CLP07;;Payer Claim Control Number;;7;;AN;;1;;30;;;;VBILNUM
;;CLP08;;Facility Type Code;;8;;AN;;1;;2
;;CLP09;;Claim Frequency Code;;9;;AN;;1;;1
;;CLP10;;Patient Status Cod (blank);;10;;AN;;1;;2
;;CLP11;;DRG Code;;11;;AN;;1;;4
;;CLP12;;DRG Weight;;12;;R;;1;;15
;;CLP13;;Discharge Fraction (%);;13;;R;;1;;10
;;END
CAS ;;
;;CAS01;;Claim Adjustment Group Code;;1;;ID;;1;;2;;26
;;CAS02;;Adjustment Reason Code;;2;;ID;;1;;5;;33;;VADJREA
;;CAS03;;Adjustment Amount;;3;;R;;1;;18;;;;VADJAMT
;;CAS04;;Adjustment Quantity;;4;;R;;1;;15
;;CAS05;;Adjustment Reason Code;;5;;ID;;1;;5;;33;;VADJREA
;;CAS06;;Adjustment Amount;;6;;R;;1;;18;;;;VADJAMT
;;CAS07;;Adjustment Quantity;;7;;R;;1;;15
;;CAS08;;Adjustment Reason Code;;8;;ID;;1;;5;;33;;VADJREA
;;CAS09;;Adjustment Amount;;9;;R;;1;;18;;;;VADJAMT
;;CAS10;;Adjustment Quantity;;10;;R;;1;;15
;;CAS11;;Adjustment Reason Code;;11;;ID;;1;;5;;33;;VADJREA
;;CAS12;;Adjustment Amount;;12;;R;;1;;18;;;;VADJAMT
;;CAS13;;Adjustment Quantity;;13;;R;;1;;15
;;CAS14;;Adjustment Reason Code;;14;;ID;;1;;5;;33;;VADJREA
;;CAS15;;Adjustment Amount;;15;;R;;1;;18;;;;VADJAMT
;;CAS16;;Adjustment Quantity;;16;;R;;1;;15
;;CAS17;;Adjustment Reason Code;;17;;ID;;1;;5;;33;;VADJREA
;;CAS18;;Adjustment Amount;;18;;R;;1;;18;;;;VADJAMT
;;CAS19;;Adjustment Quantity;;19;;R;;1;;15
;;END
NM1 ;;
;;NM101;;Entity Identifier Code;;1;;ID;;2;;3;;18
;;NM102;;Entity Type Qualifier;;2;;ID;;1;;1;;27
;;NM103;;Last / Organization Name;;3;;AN;;1;;35;;;;VPATLN
;;NM104;;First Name;;4;;AN;;1;;23;;;;VPATFN
;;NM105;;Middle Name;;5;;AN;;1;;25;;;;VPATMID
;;NM106;;Name Prefix (blank);;6;;AN;;1;;10
;;NM107;;Name Suffix;;7;;AN;;1;;10
;;NM108;;Identification Code Qualifier;;8;;ID;;1;;2;;21
;;NM109;;Identification Code;;9;;AN;;2;;80;;;;VPATHIC
;;END
MIA ;;
;;MIA01;;Covered Days;;1;;R;;1;;15
;;MIA02;;PPS Operating Outlier Amt;;2;;R;;1;;15
;;MIA03;;Lifetime Psychiatric Days;;3;;R;;1;;15
;;MIA04;;Claim DRG Amount ($);;4;;R;;1;;18
;;MIA05;;Remark Code;;5;;ID;;1;;30;;34
;;MIA06;;Disproportionate Share Amt;;6;;R;;1;;18
;;MIA07;;MSP Pass-through Amt ($);;7;;R;;1;;18
;;MIA08;;PPS-Capital Amount ($);;8;;R;;1;;18
;;MIA09;;PPS-Capital FSP DRG Amt ($);;9;;R;;1;;18
;;MIA10;;PPS-Capital HSP DRG Amt ($);;10;;R;;1;;18
;;MIA11;;PPS-Capital DSH DRG Amt ($);;11;;R;;1;;18
;;MIA12;;Old Capital Amount ($);;12;;R;;1;;18
;;MIA13;;PPS-Capital IME Amt ($);;13;;R;;1;;18
;;MIA14;;PPS/Hosp Specific DRG Amt ($);;14;;R;;1;;18
;;MIA15;;Cost Report Day Count;;15;;R;;1;;15
;;MIA16;;PPS/Operating Fed Spec DRG Amt;;16;;R;;1;;18
;;MIA17;;PPS-Capital Outlier Amt ($);;17;;R;;1;;18
;;MIA18;;Indirect Teaching Amount ($);;18;;R;;1;;18
;;MIA19;;Nonpayable Prof Comp Amt ($);;19;;R;;1;;18
;;MIA20;;Remark Code;;20;;ID;;1;;30;;34
;;MIA21;;Remark Code;;21;;ID;;1;;30;;34
;;MIA22;;Remark Code;;22;;ID;;1;;30;;34
;;MIA23;;Remark Code;;23;;ID;;1;;30;;34
;;MIA24;;PPS-Capital Exception Amt ($);;24;;R;;1;;18
;;END
MOA ;;
;;MOA01;;Reimbursement Rate (%);;1;;R;;1;;10
;;MOA02;;Claim HCPCS Payable Amt ($);;2;;R;;1;;18
;;MOA03;;Remark Code;;3;;ID;;1;;30;;34
;;MOA04;;Remark Code;;4;;ID;;1;;30;;34
;;MOA05;;Remark Code;;5;;ID;;1;;30;;34
;;MOA06;;Remark Code;;6;;ID;;1;;30;;34
;;MOA07;;Remark Code;;7;;ID;;1;;30;;34
;;MOA08;;Claim ESRD Payment Amt ($);;8;;R;;1;;18
;;MOA09;;Nonpayable Prof Comp Amt ($);;9;;R;;1;;18
;;END
AMT ;;
;;AMT01;;Amount Qualifier Code;;1;;ID;;1;;3;;28
;;AMT02;;Amount;;2;;R;;1;;18
;;END
QTY ;;
;;QTY01;;Quantity Qualifier;;1;;ID;;2;;2;;29
;;QTY02;;Quantity;;2;;R;;1;;15
;;END
SVC ;;
;;SVC01;;Composite Medical Procedure Id;;1;;AN;;2;;100
;;SVC02;;Line Item Charge Amt ($);;2;;R;;1;;18
;;SVC03;;Line Item Prov Paid Amt ($);;3;;R;;1;;18
;;SVC04;;Revenue Code;;4;;AN;;1;;48
;;SVC05;;Units of Service Paid (cnt);;5;;R;;1;;15
;;SVC06;;Composite Medical Procedure Id;;6;;AN;;2;;100
;;SVC07;;Orig Units of Service (cnt);;7;;R;;1;;15
;;END
LQ ;;
;;LQ01;;Remark Code List Qualifier;;1;;ID;;1;;3;;30
;;LQ02;;Remark Code (Line Level);;2;;AN;;1;;30
;;END
PLB ;;
;;PLB01;;Provider Identifier;;1;;AN;;1;;30;;;;VPRVNUM
;;PLB02;;Fiscal Period Date;;2;;DT;;8;;8
;;PLB03;;Composite Adjustment Id;;3;;AN;;2;;33
;;PLB04;;Provider Adjustment Amt;;4;;R;;1;;18
;;PLB05;;Composite Adjustment Id;;5;;AN;;2;;33
;;PLB06;;Provider Adjustment Amt;;6;;R;;1;;18
;;PLB07;;Composite Adjustment Id;;7;;AN;;2;;33
;;PLB08;;Provider Adjustment Amt;;8;;R;;1;;18
;;PLB09;;Composite Adjustment Id;;9;;AN;;2;;33
;;PLB10;;Provider Adjustment Amt;;10;;R;;1;;18
;;PLB11;;Composite Adjustment Id;;11;;AN;;2;;33
;;PLB12;;Provider Adjustment Amt;;12;;R;;1;;18
;;PLB13;;Composite Adjustment Id;;13;;AN;2;33
;;PLB14;;Provider Adjustment Amt;;14;;R;;1;;18
;;END
SE ;;
;;SE01;;Transaction Segment Count;;1;;NO;;1;;10
;;SE02;;Transaction Set Control Number;;2;;AN;;4;;9
;;END
GE ;;
;;GE01;;Functional Group Set Count;;1;;NO;;1;;6
;;GE02;;Group Control Number;;2;;NO;;1;;9
;;END
IEA ;;
;;IEA01;;Interchange Group Count;;1;;NO;;1;;5
;;IEA02;;Interchange Control Number;;2;;NO;;9;;9
;;END
BAREDIT3 ; IHS/SD/LSL - CREATE AN ENTRY IN A/R EDI TRANSPORT FILE (3) ;
+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. This routine defines the Elements.
+6 ;
+7 ; ********************************************************************
+8 QUIT
+9 ; ********************************************************************
ELEMENT ; EP
+1 ; Create Element Multiple w/in Segment Multiple in A/R EDI TRANSPORT
+2 SET BARELCNT=0
+3 FOR
DO ELEMENT2
IF BARELEM="END"
QUIT
+4 QUIT
+5 ; ********************************************************************
ELEMENT2 ;
+1 ; Loop Elements
+2 SET BARELCNT=BARELCNT+1
+3 SET BARELEM=$PIECE($TEXT(@BARSEGID+BARELCNT),BARDELIM,2,9)
+4 IF BARELEM="END"
QUIT
+5 DO ELEMENT3
+6 IF '+BARELDA
QUIT
+7 IF $PIECE($PIECE(BARELEM,BARDELIM,2)," ")="Composite"
DO SUBELM^BAREDIT4
+8 QUIT
+9 ; ********************************************************************
ELEMENT3 ;
+1 ; Create Segment multiple entry in A/R EDI TRANSPORT File
+2 KILL DA,DIC,X,Y
+3 SET DA(2)=BAREDITR
+4 SET DA(1)=BARSEGDA
+5 SET DIC="^BAREDI(""1T"","_DA(2)_",10,"_DA(1)_",10,"
+6 SET DIC(0)="LZ"
+7 SET DIC("P")=$PIECE(^DD(90056.0101,10,0),U,2)
+8 SET X=$PIECE(BARELEM,BARDELIM)
+9 SET BARELID=X
+10 SET BARPSTEL=$PIECE(BARELEM,BARDELIM,8)
+11 IF $PIECE(BARSEG,BARDELIM)="2-060.B-REF"
IF BARELID="REF02"
SET BARPSTEL="VVERMOD"
+12 IF $PIECE(BARSEG,BARDELIM)="3-040.B-REF"
IF BARELID="REF02"
SET BARPSTEL="VPATHRN"
+13 IF $PIECE(BARSEG,BARDELIM)="2-080.A-N1"
IF BARELID="N102"
SET BARPSTEL="VPAYER"
+14 IF $PIECE(BARSEG,BARDELIM)="2-100.A-N3"
Begin DoDot:1
+15 IF BARELID="N301"
SET BARPSTEL="VPRADR"
+16 IF BARELID="N302"
SET BARPSTEL="VPRADR2"
End DoDot:1
+17 IF $PIECE(BARSEG,BARDELIM)="2-110.A-N4"
Begin DoDot:1
+18 IF BARELID="N401"
SET BARPSTEL="VPRCITY"
+19 IF BARELID="N402"
SET BARPSTEL="VPRSTATE"
+20 IF BARELID="N403"
SET BARPSTEL="VPRZIP"
End DoDot:1
+21 IF $PIECE(BARSEG,BARDELIM)="2-080.B-N1"
IF BARELID="N102"
SET BARPSTEL="VPAYEE"
+22 SET DIC("DR")=".02///^S X=$P(BARELEM,BARDELIM,2)"
+23 SET DIC("DR")=DIC("DR")_";.03///^S X=$P(BARELEM,BARDELIM,3)"
+24 IF $PIECE(BARELEM,BARDELIM,4)]""
SET DIC("DR")=DIC("DR")_";.04///^S X=$P(BARELEM,BARDELIM,4)"
+25 IF $PIECE(BARELEM,BARDELIM,5)]""
SET DIC("DR")=DIC("DR")_";.05///^S X=$P(BARELEM,BARDELIM,5)"
+26 IF $PIECE(BARELEM,BARDELIM,6)]""
SET DIC("DR")=DIC("DR")_";.06///^S X=$P(BARELEM,BARDELIM,6)"
+27 IF $PIECE(BARELEM,BARDELIM,7)]""
SET DIC("DR")=DIC("DR")_";.09///^S X=$P(BARELEM,BARDELIM,7)"
+28 IF BARPSTEL]""
SET DIC("DR")=DIC("DR")_";.08///^S X=BARPSTEL"
+29 KILL DD,DO
+30 DO FILE^DICN
+31 IF +Y<0
QUIT
+32 SET BARELDA=+Y
+33 QUIT
+34 ; ********************************************************************
+35 ; The following is a table of elements per Segment as the segments are
+36 ; ordered in 1^BAREDIT2
+37 ; ********************************************************************
+38 ;;ELEM;;DESC;;SEQ;;DATA TYPE;;MIN;;MAX;;EDI TBL PTR;;PST EL
+39 ; ********************************************************************
ISA ;;
+1 ;;ISA01;;Authorization Info Qualifier;;1;;ID;;2;;2;;1
+2 ;;ISA02;;Authorization Information;;2;;AN;;10;;10
+3 ;;ISA03;;Security Information Qualifier;;3;;ID;;2;;2;;2
+4 ;;ISA04;;Security Information;;4;;AN;;10;;10
+5 ;;ISA05;;Interchange ID Qualifier;;5;;ID;;2;;2;;3
+6 ;;ISA06;;Interchange Sender ID;;6;;AN;;15;;15
+7 ;;ISA07;;Interchange ID Qualifier;;7;;ID;;2;;2;;3
+8 ;;ISA08;;Interchange Receiver ID;;8;;AN;;15;;15
+9 ;;ISA09;;Interchange Date;;9;;DT;;6;;6
+10 ;;ISA10;;Interchange Time;;10;;TM;;4;;4
+11 ;;ISA11;;Control Standards Identifier;;11;;ID;;1;;1;;4
+12 ;;ISA12;;Control Version Number;;12;;ID;;5;;5;;5;;VVERNUM
+13 ;;ISA13;;Interchange Control Number;;13;;NO;;9;;9;;;;VCTRLNUM
+14 ;;ISA14;;Acknowlegment Requested;;14;;ID;;1;;1;;6;;VTEST
+15 ;;ISA15;;Usage Indicator;;15;;ID;;1;;1;;7
+16 ;;ISA16;;Component Element Seperator;;16;;AN;;1;;1
+17 ;;END
GS ;;
+1 ;;GS01;;Functional Identifier Code;;1;;ID;;2;;2;;8
+2 ;;GS02;;Application Sender's Code;;2;;AN;;2;;15
+3 ;;GS03;;Application Receiver's Code;;3;;AN;;2;;15
+4 ;;GS04;;Functional Group Creation Date;;4;;DT;;8;;8
+5 ;;GS05;;Functional Group Creation Time;;5;;TM;;4;;8
+6 ;;GS06;;Group Control Number;;6;;NO;;1;;9
+7 ;;GS07;;Responsible Agency Code;;7;;ID;;1;;2;;9
+8 ;;GS08;;Vers/Release/Industry ID Code;;8;;AN;;1;;12;;;;VVERSION
+9 ;;END
ST ;;
+1 ;;ST01;;Transaction Set Identify Code;;1;;ID;;3;;3;;10
+2 ;;ST02;;Transaction Set Control Number;;2;;AN;;4;;9
+3 ;;END
BPR ;;
+1 ;;BPR01;;Transaction Handling Code;;1;;ID;;1;;2;;11
+2 ;;BPR02;;Total Provider Payment;;2;;R;;1;;18
+3 ;;BPR03;;Credit/Debit Flag Code;;3;;ID;;1;;1;;12
+4 ;;BPR04;;Payment Method Code;;4;;ID;;3;;3;;13
+5 ;;BPR05;;Payment Format Code;;5;;ID;;1;;10;;14
+6 ;;BPR06;;DFI ID # Qualifier (sender);;6;;ID;;2;;2;;15
+7 ;;BPR07;;DFI ID # (sender);;7;;AN;;3;;12
+8 ;;BPR08;;Account # Qualifier (sender);;8;;ID;;1;;3;;16
+9 ;;BPR09;;Bank Account Number (sender);;9;;AN;;1;;35
+10 ;;BPR10;;Payer Identifier;;10;;AN;;10;;10
+11 ;;BPR11;;Payer Co. Supplimental Code;;11;;9;;9
+12 ;;BPR12;;DFI ID # Qualifier (receiver);;12;;ID;;2;;2;;15
+13 ;;BPR13;;DFI ID # (receiver);;13;;AN;;3;;12
+14 ;;BPR14;;Account # Qualifier (receiver);;14;;ID;;1;;3;;16
+15 ;;BPR15;;Bank Account Number (receiver);;15;;AN;;1;;35
+16 ;;BPR16;;Check Issue/EFT Effective Date;;16;;DT;;8;;8
+17 ;;END
TRN ;;
+1 ;;TRN01;;Trace Type Code;;1;;ID;;1;;2;;17
+2 ;;TRN02;;Check or EFT Trace NUmber;;2;;AN;;1;;30;;;;VCHECK
+3 ;;TRN03;;Payer Identifier;;3;;AN;;10;;10
+4 ;;TRN04;;Payer Supplimental Code;;4;;AN;;1;;30
+5 ;;END
CUR ;;
+1 ;;CUR01;;Entity Identifier Code;;1;;ID;;2;;3;;18
+2 ;;CUR02;;Currency Code;;2;;AN;;3;;3
+3 ;;CUR03;;Exchange Rate;;3;;R;;4;;10
+4 ;;END
REF ;;
+1 ;;REF01;;Reference ID Qualifier;;1;;ID;;2;;3;;19
+2 ;;REF02;;Reference Identification;;2;;AN;;1;;30;;;;VREFID
+3 ;;END
DTM ;;
+1 ;;DTM01;;Date/Time Qualifier;;1;;ID;;3;;3;;20
+2 ;;DTM02;;Date;;2;;DT;;8;;8;;;;VCLMDATE
+3 ;;END
N1 ;;
+1 ;;N101;;Entity Identifier Code;;1;;ID;;2;;3;;18
+2 ;;N102;;Payer/Payee Name;;2;;AN;;1;;60;;;;VPAYNAME
+3 ;;N103;;Identification Code Qualifier;;3;;ID;;1;;2;;21
+4 ;;N104;;Identification Code;;4;;AN;;2;;80
+5 ;;END
N3 ;;
+1 ;;N301;;Payer/Payee Address;;1;;AN;;1;;55
+2 ;;N302;;Payer/Payee Address;;2;;AN;;1;;55
+3 ;;END
N4 ;;
+1 ;;N401;;Payer/Payee City;;1;;AN;;2;;30
+2 ;;N402;;Payer/Payee State or Province;;2;;AN;;2;;2
+3 ;;N403;;Payer/Payee Postal Code;;3;;Nn;;3;;15
+4 ;;N404;;Payee Country Code;;4;;Nn;;2;;3
+5 ;;END
PER ;;
+1 ;;PER01;;Contact Function Code;;1;;ID;;2;;2;;22
+2 ;;PER02;;Contact Name;;2;;AN;;1;;60;;;;VPRCONAM
+3 ;;PER03;;Communication Number Qualifier;;3;;ID;;2;;2;;23;;VPRCONCD
+4 ;;PER04;;Contact Communication #;;4;;AN;;1;;80;;;;VPRCONBR
+5 ;;PER05;;Communication Number Qualifier;;5;;ID;;2;;2;;23;;VPRCONCD
+6 ;;PER06;;Contact Communication #;;6;;AN;;1;;80;;;;VPRCONBR
+7 ;;PER07;;Communication Number Qualifier;;5;;ID;;2;;2;;23;;VPRCONCD
+8 ;;PER08;;Contact Communication #;;6;;AN;;1;;80;;;;VPRCONBR
+9 ;;END
+10 ;;
LX ;;
+1 ;;LX01;;Assigned Loop Number;;1;;NO;;1;;6
+2 ;;END
TS3 ;;
+1 ;;TS301;;Provider Identifier;;1;;AN;;1;;30;;;;VNEWPRV
+2 ;;TS302;;Facility Type Code;;2;;AN;;1;;2
+3 ;;TS303;;Fiscal Period Date;;3;;DT;;8;;8
+4 ;;TS304;;Total Claim Count;;4;;R;;1;;15
+5 ;;TS305;;Total Submitted Charges ($);;5;;R;;1;;18
+6 ;;TS306;;Total Covered Charges ($);;6;;R;;1;;18
+7 ;;TS307;;Total Non-Covered Charges ($);;7;;R;;1;;18
+8 ;;TS308;;Total Denied Charges ($);;8;;R;;1;;18
+9 ;;TS309;;Total Provider Payment ($);;9;;R;;1;;18
+10 ;;TS310;;Total Interest ($);;10;;R;;1;;18
+11 ;;TS311;;Total Contractual Adjust ($);;11;;R;;1;;18
+12 ;;TS312;;Total Gramm-Rudman Reduct ($);;12;;R;;1;;18
+13 ;;TS313;;Total MSP Payer Amount ($);;13;;R;;1;;18
+14 ;;TS314;;Total Blood Deductable ($);;14;;R;;1;;18
+15 ;;TS315;;Total Non-Lab Charge ($);;15;;R;;1;;18
+16 ;;TS316;;Total Coinsurance Amount ($);;16;;R;;1;;18
+17 ;;TS317;;Total HCPCS Submitted Charges;;17;;R;;1;;18
+18 ;;TS318;;Total HCPCS Payable Amount ($);;18;;R;;1;;18
+19 ;;TS319;;Total Deductible Amount ($);;19;;R;;1;;18
+20 ;;TS320;;Total Prof Comp Amount ($);;20;;R;;1;;18
+21 ;;TS321;;Total MSP Pat Liability Met($);;21;;R;;1;;18
+22 ;;TS322;;Total Pat Reimbursement ($);;22;;R;;1;;18
+23 ;;TS323;;Total PIP Claim Count;;23;;R;;1;;18
+24 ;;TS324;;Total PIP Adjustment ($);;24;;R;;1;;18
+25 ;;END
TS2 ;;
+1 ;;TS201;;Total DRG Amount;;1;;R;;1;;18
+2 ;;TS202;;Total Federal Specific Amount;;2;;R;;1;;18
+3 ;;TS203;;Total Hospital Specific Amount;;3;;R;;1;;18
+4 ;;TS204;;Total Disproportionate Share;;4;;R;;1;;18
+5 ;;TS205;;Total Capital Amount;;5;;R;;1;;18
+6 ;;TS206;;Total Indirect Medical Edu Amt;;6;;R;;1;;18
+7 ;;TS207;;Total Outlier Day Count;;7;;R;;1;;15
+8 ;;TS208;;Total Day Outlier Amount;;8;;R;;1;;18
+9 ;;TS209;;Total Cost Outlier Amount;;9;;R;;1;;18
+10 ;;TS210;;Average DRG Length of Stay;;10;;R;;1;;15
+11 ;;TS211;;Total Discharge Count;;11;;R;;1;;15
+12 ;;TS212;;Total Cost Report Day Count;;12;;R;;1;;15
+13 ;;TS213;;Total Covered Day Count;;13;;R;;1;;15
+14 ;;TS214;;Total Non-Covered Day Count;;14;;R;;1;;15
+15 ;;TS215;;Total MSP Pass-Through Amt;;15;;R;;1;;18
+16 ;;TS216;;Average DRG Weight;;16;;R;;1;;15
+17 ;;TS217;;Total PPS Capital FSP DRG Amt;;17;;R;;1;;18
+18 ;;TS218;;Total PPS Capital HSP DRG Amt;;18;;R;;1;;18
+19 ;;TS219;;Total PPS DSH DRG Amount;;19;;R;;1;;18
+20 ;;END
CLP ;;
+1 ;;CLP01;;Patient Control Number;;1;;AN;;1;;38;;;;VNEWBILL
+2 ;;CLP02;;Claim Status Code;;2;;ID;;1;;2;;24
+3 ;;CLP03;;Total Submitted Charges ($);;3;;R;;1;;18;;;;VCLMCHG
+4 ;;CLP04;;Claim Payment Amount ($);;4;;R;;1;;18;;;;VCLMPAY
+5 ;;CLP05;;Patient Responsibility Amt ($);;5;;R;;1;;18
+6 ;;CLP06;;Claim Filing Indicator Code;;6;;ID;;1;;2;;25
+7 ;;CLP07;;Payer Claim Control Number;;7;;AN;;1;;30;;;;VBILNUM
+8 ;;CLP08;;Facility Type Code;;8;;AN;;1;;2
+9 ;;CLP09;;Claim Frequency Code;;9;;AN;;1;;1
+10 ;;CLP10;;Patient Status Cod (blank);;10;;AN;;1;;2
+11 ;;CLP11;;DRG Code;;11;;AN;;1;;4
+12 ;;CLP12;;DRG Weight;;12;;R;;1;;15
+13 ;;CLP13;;Discharge Fraction (%);;13;;R;;1;;10
+14 ;;END
CAS ;;
+1 ;;CAS01;;Claim Adjustment Group Code;;1;;ID;;1;;2;;26
+2 ;;CAS02;;Adjustment Reason Code;;2;;ID;;1;;5;;33;;VADJREA
+3 ;;CAS03;;Adjustment Amount;;3;;R;;1;;18;;;;VADJAMT
+4 ;;CAS04;;Adjustment Quantity;;4;;R;;1;;15
+5 ;;CAS05;;Adjustment Reason Code;;5;;ID;;1;;5;;33;;VADJREA
+6 ;;CAS06;;Adjustment Amount;;6;;R;;1;;18;;;;VADJAMT
+7 ;;CAS07;;Adjustment Quantity;;7;;R;;1;;15
+8 ;;CAS08;;Adjustment Reason Code;;8;;ID;;1;;5;;33;;VADJREA
+9 ;;CAS09;;Adjustment Amount;;9;;R;;1;;18;;;;VADJAMT
+10 ;;CAS10;;Adjustment Quantity;;10;;R;;1;;15
+11 ;;CAS11;;Adjustment Reason Code;;11;;ID;;1;;5;;33;;VADJREA
+12 ;;CAS12;;Adjustment Amount;;12;;R;;1;;18;;;;VADJAMT
+13 ;;CAS13;;Adjustment Quantity;;13;;R;;1;;15
+14 ;;CAS14;;Adjustment Reason Code;;14;;ID;;1;;5;;33;;VADJREA
+15 ;;CAS15;;Adjustment Amount;;15;;R;;1;;18;;;;VADJAMT
+16 ;;CAS16;;Adjustment Quantity;;16;;R;;1;;15
+17 ;;CAS17;;Adjustment Reason Code;;17;;ID;;1;;5;;33;;VADJREA
+18 ;;CAS18;;Adjustment Amount;;18;;R;;1;;18;;;;VADJAMT
+19 ;;CAS19;;Adjustment Quantity;;19;;R;;1;;15
+20 ;;END
NM1 ;;
+1 ;;NM101;;Entity Identifier Code;;1;;ID;;2;;3;;18
+2 ;;NM102;;Entity Type Qualifier;;2;;ID;;1;;1;;27
+3 ;;NM103;;Last / Organization Name;;3;;AN;;1;;35;;;;VPATLN
+4 ;;NM104;;First Name;;4;;AN;;1;;23;;;;VPATFN
+5 ;;NM105;;Middle Name;;5;;AN;;1;;25;;;;VPATMID
+6 ;;NM106;;Name Prefix (blank);;6;;AN;;1;;10
+7 ;;NM107;;Name Suffix;;7;;AN;;1;;10
+8 ;;NM108;;Identification Code Qualifier;;8;;ID;;1;;2;;21
+9 ;;NM109;;Identification Code;;9;;AN;;2;;80;;;;VPATHIC
+10 ;;END
MIA ;;
+1 ;;MIA01;;Covered Days;;1;;R;;1;;15
+2 ;;MIA02;;PPS Operating Outlier Amt;;2;;R;;1;;15
+3 ;;MIA03;;Lifetime Psychiatric Days;;3;;R;;1;;15
+4 ;;MIA04;;Claim DRG Amount ($);;4;;R;;1;;18
+5 ;;MIA05;;Remark Code;;5;;ID;;1;;30;;34
+6 ;;MIA06;;Disproportionate Share Amt;;6;;R;;1;;18
+7 ;;MIA07;;MSP Pass-through Amt ($);;7;;R;;1;;18
+8 ;;MIA08;;PPS-Capital Amount ($);;8;;R;;1;;18
+9 ;;MIA09;;PPS-Capital FSP DRG Amt ($);;9;;R;;1;;18
+10 ;;MIA10;;PPS-Capital HSP DRG Amt ($);;10;;R;;1;;18
+11 ;;MIA11;;PPS-Capital DSH DRG Amt ($);;11;;R;;1;;18
+12 ;;MIA12;;Old Capital Amount ($);;12;;R;;1;;18
+13 ;;MIA13;;PPS-Capital IME Amt ($);;13;;R;;1;;18
+14 ;;MIA14;;PPS/Hosp Specific DRG Amt ($);;14;;R;;1;;18
+15 ;;MIA15;;Cost Report Day Count;;15;;R;;1;;15
+16 ;;MIA16;;PPS/Operating Fed Spec DRG Amt;;16;;R;;1;;18
+17 ;;MIA17;;PPS-Capital Outlier Amt ($);;17;;R;;1;;18
+18 ;;MIA18;;Indirect Teaching Amount ($);;18;;R;;1;;18
+19 ;;MIA19;;Nonpayable Prof Comp Amt ($);;19;;R;;1;;18
+20 ;;MIA20;;Remark Code;;20;;ID;;1;;30;;34
+21 ;;MIA21;;Remark Code;;21;;ID;;1;;30;;34
+22 ;;MIA22;;Remark Code;;22;;ID;;1;;30;;34
+23 ;;MIA23;;Remark Code;;23;;ID;;1;;30;;34
+24 ;;MIA24;;PPS-Capital Exception Amt ($);;24;;R;;1;;18
+25 ;;END
MOA ;;
+1 ;;MOA01;;Reimbursement Rate (%);;1;;R;;1;;10
+2 ;;MOA02;;Claim HCPCS Payable Amt ($);;2;;R;;1;;18
+3 ;;MOA03;;Remark Code;;3;;ID;;1;;30;;34
+4 ;;MOA04;;Remark Code;;4;;ID;;1;;30;;34
+5 ;;MOA05;;Remark Code;;5;;ID;;1;;30;;34
+6 ;;MOA06;;Remark Code;;6;;ID;;1;;30;;34
+7 ;;MOA07;;Remark Code;;7;;ID;;1;;30;;34
+8 ;;MOA08;;Claim ESRD Payment Amt ($);;8;;R;;1;;18
+9 ;;MOA09;;Nonpayable Prof Comp Amt ($);;9;;R;;1;;18
+10 ;;END
AMT ;;
+1 ;;AMT01;;Amount Qualifier Code;;1;;ID;;1;;3;;28
+2 ;;AMT02;;Amount;;2;;R;;1;;18
+3 ;;END
QTY ;;
+1 ;;QTY01;;Quantity Qualifier;;1;;ID;;2;;2;;29
+2 ;;QTY02;;Quantity;;2;;R;;1;;15
+3 ;;END
SVC ;;
+1 ;;SVC01;;Composite Medical Procedure Id;;1;;AN;;2;;100
+2 ;;SVC02;;Line Item Charge Amt ($);;2;;R;;1;;18
+3 ;;SVC03;;Line Item Prov Paid Amt ($);;3;;R;;1;;18
+4 ;;SVC04;;Revenue Code;;4;;AN;;1;;48
+5 ;;SVC05;;Units of Service Paid (cnt);;5;;R;;1;;15
+6 ;;SVC06;;Composite Medical Procedure Id;;6;;AN;;2;;100
+7 ;;SVC07;;Orig Units of Service (cnt);;7;;R;;1;;15
+8 ;;END
LQ ;;
+1 ;;LQ01;;Remark Code List Qualifier;;1;;ID;;1;;3;;30
+2 ;;LQ02;;Remark Code (Line Level);;2;;AN;;1;;30
+3 ;;END
PLB ;;
+1 ;;PLB01;;Provider Identifier;;1;;AN;;1;;30;;;;VPRVNUM
+2 ;;PLB02;;Fiscal Period Date;;2;;DT;;8;;8
+3 ;;PLB03;;Composite Adjustment Id;;3;;AN;;2;;33
+4 ;;PLB04;;Provider Adjustment Amt;;4;;R;;1;;18
+5 ;;PLB05;;Composite Adjustment Id;;5;;AN;;2;;33
+6 ;;PLB06;;Provider Adjustment Amt;;6;;R;;1;;18
+7 ;;PLB07;;Composite Adjustment Id;;7;;AN;;2;;33
+8 ;;PLB08;;Provider Adjustment Amt;;8;;R;;1;;18
+9 ;;PLB09;;Composite Adjustment Id;;9;;AN;;2;;33
+10 ;;PLB10;;Provider Adjustment Amt;;10;;R;;1;;18
+11 ;;PLB11;;Composite Adjustment Id;;11;;AN;;2;;33
+12 ;;PLB12;;Provider Adjustment Amt;;12;;R;;1;;18
+13 ;;PLB13;;Composite Adjustment Id;;13;;AN;2;33
+14 ;;PLB14;;Provider Adjustment Amt;;14;;R;;1;;18
+15 ;;END
SE ;;
+1 ;;SE01;;Transaction Segment Count;;1;;NO;;1;;10
+2 ;;SE02;;Transaction Set Control Number;;2;;AN;;4;;9
+3 ;;END
GE ;;
+1 ;;GE01;;Functional Group Set Count;;1;;NO;;1;;6
+2 ;;GE02;;Group Control Number;;2;;NO;;1;;9
+3 ;;END
IEA ;;
+1 ;;IEA01;;Interchange Group Count;;1;;NO;;1;;5
+2 ;;IEA02;;Interchange Control Number;;2;;NO;;9;;9
+3 ;;END