RCDPESR9 ;ALB/TMK,DWA - ERA return file field captions ;09-SEP-2003
;;4.5;Accounts Receivable;**173,252,269,302,371**;Mar 20, 1995;Build 29
;;Per VA Directive 6402, this routine should not be modified.
;
; Note: if the 835 flat file changes, make the corresponding changes
; in this routine.
835 ;;HEADER DATA
;;835^^Return Message ID^S Y=X_" (ERA HEADER DATA)"
;;835^^X12/Proprietary flag^S Y=$S(X="X":"X12",1:X)
;;835^^File Date^S Y=$$FDT^RCDPESR9(X)
;;835^^File Time^S Y=$E(X,1,2)-$S($E(X,1,2)>12:12,1:0)_":"_$E(X,3,4)_$S($E(X,1,2)=24:" AM",$E(X,1,2)>11:" PM",1:" AM")
;;835^1^MRA^S Y=""
;;835^^Payer Name
;;835^^Payer ID
;;835^^Trace Number
;;835^^Date Claims Paid^S Y=$$FDT^RCDPESR9(X)
;;835^^Total ERA Amount^S Y=$$ZERO^RCDPESR9(X,1)
;;835^^Erroneous Provider Tax ID
;;835^^Tax ID correction Flag^S Y=$S(X="E":"CHANGED BY EPHRA",X="C":"DETERMINED FROM CLAIM DATA",X="":"NO CHANGE MADE",1:X)
;;835^^Sequence Control #
;;835^^Sequence #
;;835^^Last Sequence #
;;835^^Contact Information
;;835^^Payment Method Code
;;835^^Billing Provider NPI
;
01 ;;PAYER CONTACT INFORMATION
;;01^^Line Type^S Y=X_" (ERA LEVEL CONTACT DATA)"
;;01^^ERA Contact Name
;;01^^ERA Contact #1
;;01^^ERA Contact #1 Type^S Y=$$EXTERNAL^DILFD(344.4,3.03,,X)
;;01^^ERA Contact #2
;;01^^ERA Contact #2 Type^S Y=$$EXTERNAL^DILFD(344.4,3.05,,X)
;;01^^ERA Contact #3
;;01^^ERA Contact #3 Type^S Y=$$EXTERNAL^DILFD(344.4,3.07,,X)
;
02 ;;PAYER ADJUSTMENT RECORD
;;02^^Line Type^S Y=X_" (ERA LEVEL PAYER ADJUSTMENT RECORD)"
;;02^^X12 Adjustment Reason Code
;;02^^Provider Adjustment Identifier
;;02^^Adjustment Amount^S Y=$$ZERO^RCDPESR9(X,1)
;;02^^X12 Reason Text
;
05 ;;CLAIM PATIENT ID
;;05^^Line Type^S Y=X_" (CLAIM LEVEL PATIENT ID DATA)"
;;05^^Bill #
;;05^^Patient Last Name
;;05^^Patient First Name
;;05^^Patient Middle Name
;;05^^Patient ID #
;;05^1^Record Contains Patient Name Change^S Y=""
;;05^1^Record Contains Patient ID Change^S Y=""
;;05^^Statement Start Date^S Y=$$FDT^RCDPESR9(X)
;;05^^Statement End Date^S Y=$$FDT^RCDPESR9(X)
;
06 ;;CORECT PATIENT DATA
;;06^^Line Type^S Y=X_" (CLAIM LEVEL CORRECT PATIENT DATA)"
;;06^^Bill #
;;06^^Corrected Patient Last Name
;;06^^Corrected Patient First Name
;;06^^Corrected Patient Middle Name
;;06^^Corrected Patient ID #
;
10 ;;CLAIM STATUS DATA
;;10^^Line Type^S Y=X_" (CLAIM LEVEL CLAIM STATUS DATA)"
;;10^^Bill #
;;10^^Claim Processed^S Y=$$YN^RCDPESR9(X)
;;10^^Claim Denied^S Y=$$YN^RCDPESR9(X)
;;10^^Claim Pended^S Y=$$YN^RCDPESR9(X)
;;10^^Claim Reversal^S Y=$$YN^RCDPESR9(X)
;;10^^Claim Status Code
;;10^1^Crossed Over Name^S Y=""
;;10^1^Crossed Over ID^S Y=""
;;10^^Submitted Charge^S Y=$$ZERO^RCDPESR9(X,1)
;;10^^Amount Paid^S Y=$$ZERO^RCDPESR9(X,1)
;;10^^ICN
;;10^^DRG Code Used
;;10^^DRG Weight Used^S Y=$J($$ZERO^RCDPESR9(X,1)/100,4)
;;10^^Discharge Fraction^S Y=$$ZERO^RCDPESR9(X,1)
;;10^^Rendering NPI
;;10^^Entity Type Qualifier
;;10^^Last Name
;;10^^First Name
;
15 ;;CLAIM STATUS DATA
;;15^^Line Type^S Y=X_" (CLAIM LEVEL CLAIM STATUS DATA (CONTINUED))"
;;15^^Bill #
;;15^^Covered Amount^S Y=$$ZERO^RCDPESR9(X,1)
;;15^1^Discount Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
;;15^1^Day Limit Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;15^1^Interest Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
;;15^1^Tax Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
;;15^1^Total Before Taxes Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;15^^Patient Responsibility Amount^S Y=$$ZERO^RCDPESR9(X,1)
;;15^1^Negative Reimbursement^S Y=$$ZERO^RCDPESR9(X,1,1)
;;15^^Health Plan Identifier
;
17 ;;CLAIM LEVEL PAYER CONTACT INFORMATION
;;17^^Line Type^S Y=X_" (CLAIM LEVEL PAYER CONTACT INFO)"
;;17^^Bill #
;;17^^Contact Name
;;17^^Contact #1
;;17^^Contact #1 Type^S Y=$$EXTERNAL^DILFD(361.1,25.03,,X)
;;17^^Contact #2
;;17^^Contact #2 Type^S Y=$$EXTERNAL^DILFD(361.1,25.05,,X)
;;17^^Contact #3
;;17^^Contact #3 Type^S Y=$$EXTERNAL^DILFD(361.1,25.07,,X)
;
20 ;;CLAIM LEVEL ADJUSTMENT DATA
;;20^^Line Type^S Y=X_" (CLAIM LEVEL CLAIM ADJUSTMENT DATA)"
;;20^^Bill #
;;20^^Adjustment Group Code
;;20^^Adjustment Reason Code
;;20^^Adjustment Amount^S Y=$$ZERO^RCDPESR9(X,1)
;;20^^Quantity^S Y=$$ZERO^RCDPESR9(X)
;;20^^Reason Code Text
;
30 ;;CLAIM LEVEL MEDICARE INPT ADJUDICATION DATA
;;30^^Line Type^S Y=X_" (CLAIM LEVEL MEDICARE INPATIENT ADJUDICATION DATA)"
;;30^^Bill #
;;30^^Covered Days/Visits^S Y=$$ZERO^RCDPESR9(X)
;;30^1^Lifetime Reserve Days Count^S Y=$$ZERO^RCDPESR9(X,,1)
;;30^1^Lifetime Psych Days Count^S Y=$$ZERO^RCDPESR9(X,,1)
;;30^^Claim DRG Amt^S Y=$$ZERO^RCDPESR9(X,1)
;;30^1^Claim Disproportionate Share Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;30^1^Claim MSP Pass thru Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;30^1^Claim PPS Capital Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;30^1^PPS-Capital FSP DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;30^1^PPS-Capital HSP DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;30^1^PPS-Capital DSH DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;30^1^Old Capital Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;30^^Non-Covered Days^S Y=$$ZERO^RCDPESR9(X)
;
35 ;;CLAIM LEVEL MEDICARE ADJUDICATION DATA
;;35^^Line Type^S Y=X_" (CLAIM LEVEL MEDICARE ADJUDICATION DATA)"
;;35^^Bill #
;;35^1^PPS-Capital IME Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;35^1^PPS-Operating Hosp Specific DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;35^1^Cost Report Day Count^S Y=$$ZERO^RCDPESR9(X)
;;35^1^PPS-Operating Fed Specific DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;35^1^Claim PPS Capital Outlier Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;35^1^Claim Indirect Teaching Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;35^1^Non-payable Professional Component Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;35^1^PPS-Capital Exception Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
;;35^1^Outpatient Reimbursement %^S Y=$$ZERO^RCDPESR9(X)
;;35^1^HCPCS Payable Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
;;35^1^ESRD Paid Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
;;35^1^Non-payable Professional Component^S Y=$$ZERO^RCDPESR9(X,1,1)
;
37 ;;CLAIM LEVEL MEDICARE ADJUDICATION DATA REMARKS
;;37^^Line Type^S Y=X_" (CLAIM LEVEL MEDICARE ADJUDICATION DATA REMARKS)"
;;37^^Bill #
;;37^^Type^S Y=$S(X="O":"MOA",X="I":"MIA",1:X)
;;37^^Claim Payment Remark Code
;;37^^Claim Payment Remark Code Message Text
;
40 ;;SERVICE LINE DATA
;;40^^Line Type^S Y=X_" (CLAIM LEVEL SERVICE LINE DATA)"
;;40^^Bill #
;;40^^Procedure
;;40^^Revenue Code
;;40^^Modifier 1
;;40^^Modifier 2
;;40^^Modifier 3
;;40^^Modifier 4
;;40^^Description
;;40^^Original Procedure
;;40^^Original Modifier 1
;;40^^Original Modifier 2
;;40^^Original Modifier 3
;;40^^Original Modifier 4
;;40^^Original Charge^S Y=$$ZERO^RCDPESR9(X,1)
;;40^^Original Units^S Y=$$ZERO^RCDPESR9(X,1)
;;40^^Amount Paid^S Y=$$ZERO^RCDPESR9(X,1)
;;40^^Covered Units^S Y=$$ZERO^RCDPESR9(X,1)
;;40^^Service From Date^S Y=$$FDT^RCDPESR9(X)
;;40^^Service To Date^S Y=$$FDT^RCDPESR9(X)
;;40^^Procedure Type
;;40^^Applies to Billing Line
;
41 ;;SERVICE LINE DATA
;;41^^Line Type^S Y=X_" (CLAIM LEVEL SERVICE LINE DATA (CONTINUED))"
;;41^^Bill #
;;41^^Allowed Amount^S Y=$$ZERO^RCDPESR9(X,1)
;;41^1^Per Diem Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
;
42 ;;SERVICE LINE DATA
;;42^^Line Type^S Y=X_" (CLAIM LEVEL SERVICE LINE DATA (CONTINUED))"
;;42^^Bill #
;;42^^Line Item Remark Code
;;42^^Line Item Remark Code Text
;
45 ;;SERVICE LINE ADJUSTMENT DATA
;;45^^Line Type^S Y=X_" (CLAIM LEVEL SERVICE LINE ADJUSTMENT DATA)"
;;45^^Bill #
;;45^^Adjustment Group Code
;;45^^Adjustment Reason Code
;;45^^Adjustment Amount^S Y=$$ZERO^RCDPESR9(X,1)
;;45^^Quantity^S Y=$$ZERO^RCDPESR9(X)
;;45^^Reason Code Text
;
FDT(X) ; returns MM/DD/YYYY or MM/DD/YY from YYYYMMDD or YYMMDD in X
I $L(X)=8,X?8N S X=$E(X,5,6)_"/"_$E(X,7,8)_"/"_$E(X,1,4)
I $L(X)=6,X?6N S X=$E(X,3,4)_"/"_$E(X,5,6)_"/"_$E(X,1,2)
Q X
;
ZERO(X,D,NULL) ; Returns numeric value of X without leading 0's
; or null if no value wanted for 0 amount
; D = 1 if dollar amt
N Z
I X["." S Z=$P(X,"."),X=+Z_"."_$P(X,".",2)
I X'["." D
. I $G(D) S X=+$E(X,1,$L(X)-2)_"."_$E(X,$L(X)-1,$L(X))
. S X=$S('$G(D):+X,1:$J(X,"",2))
Q $S(X:X,$G(NULL):"",1:X)
;
YN(X) ; Returns YES for X="Y" and NO for X="N"
S X=$S(X="Y":"YES",X="N":"NO",1:X)
Q X
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCDPESR9 8352 printed Sep 15, 2024@21:09:44 Page 2
RCDPESR9 ;ALB/TMK,DWA - ERA return file field captions ;09-SEP-2003
+1 ;;4.5;Accounts Receivable;**173,252,269,302,371**;Mar 20, 1995;Build 29
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 ; Note: if the 835 flat file changes, make the corresponding changes
+5 ; in this routine.
835 ;;HEADER DATA
+1 ;;835^^Return Message ID^S Y=X_" (ERA HEADER DATA)"
+2 ;;835^^X12/Proprietary flag^S Y=$S(X="X":"X12",1:X)
+3 ;;835^^File Date^S Y=$$FDT^RCDPESR9(X)
+4 ;;835^^File Time^S Y=$E(X,1,2)-$S($E(X,1,2)>12:12,1:0)_":"_$E(X,3,4)_$S($E(X,1,2)=24:" AM",$E(X,1,2)>11:" PM",1:" AM")
+5 ;;835^1^MRA^S Y=""
+6 ;;835^^Payer Name
+7 ;;835^^Payer ID
+8 ;;835^^Trace Number
+9 ;;835^^Date Claims Paid^S Y=$$FDT^RCDPESR9(X)
+10 ;;835^^Total ERA Amount^S Y=$$ZERO^RCDPESR9(X,1)
+11 ;;835^^Erroneous Provider Tax ID
+12 ;;835^^Tax ID correction Flag^S Y=$S(X="E":"CHANGED BY EPHRA",X="C":"DETERMINED FROM CLAIM DATA",X="":"NO CHANGE MADE",1:X)
+13 ;;835^^Sequence Control #
+14 ;;835^^Sequence #
+15 ;;835^^Last Sequence #
+16 ;;835^^Contact Information
+17 ;;835^^Payment Method Code
+18 ;;835^^Billing Provider NPI
+19 ;
01 ;;PAYER CONTACT INFORMATION
+1 ;;01^^Line Type^S Y=X_" (ERA LEVEL CONTACT DATA)"
+2 ;;01^^ERA Contact Name
+3 ;;01^^ERA Contact #1
+4 ;;01^^ERA Contact #1 Type^S Y=$$EXTERNAL^DILFD(344.4,3.03,,X)
+5 ;;01^^ERA Contact #2
+6 ;;01^^ERA Contact #2 Type^S Y=$$EXTERNAL^DILFD(344.4,3.05,,X)
+7 ;;01^^ERA Contact #3
+8 ;;01^^ERA Contact #3 Type^S Y=$$EXTERNAL^DILFD(344.4,3.07,,X)
+9 ;
02 ;;PAYER ADJUSTMENT RECORD
+1 ;;02^^Line Type^S Y=X_" (ERA LEVEL PAYER ADJUSTMENT RECORD)"
+2 ;;02^^X12 Adjustment Reason Code
+3 ;;02^^Provider Adjustment Identifier
+4 ;;02^^Adjustment Amount^S Y=$$ZERO^RCDPESR9(X,1)
+5 ;;02^^X12 Reason Text
+6 ;
05 ;;CLAIM PATIENT ID
+1 ;;05^^Line Type^S Y=X_" (CLAIM LEVEL PATIENT ID DATA)"
+2 ;;05^^Bill #
+3 ;;05^^Patient Last Name
+4 ;;05^^Patient First Name
+5 ;;05^^Patient Middle Name
+6 ;;05^^Patient ID #
+7 ;;05^1^Record Contains Patient Name Change^S Y=""
+8 ;;05^1^Record Contains Patient ID Change^S Y=""
+9 ;;05^^Statement Start Date^S Y=$$FDT^RCDPESR9(X)
+10 ;;05^^Statement End Date^S Y=$$FDT^RCDPESR9(X)
+11 ;
06 ;;CORECT PATIENT DATA
+1 ;;06^^Line Type^S Y=X_" (CLAIM LEVEL CORRECT PATIENT DATA)"
+2 ;;06^^Bill #
+3 ;;06^^Corrected Patient Last Name
+4 ;;06^^Corrected Patient First Name
+5 ;;06^^Corrected Patient Middle Name
+6 ;;06^^Corrected Patient ID #
+7 ;
10 ;;CLAIM STATUS DATA
+1 ;;10^^Line Type^S Y=X_" (CLAIM LEVEL CLAIM STATUS DATA)"
+2 ;;10^^Bill #
+3 ;;10^^Claim Processed^S Y=$$YN^RCDPESR9(X)
+4 ;;10^^Claim Denied^S Y=$$YN^RCDPESR9(X)
+5 ;;10^^Claim Pended^S Y=$$YN^RCDPESR9(X)
+6 ;;10^^Claim Reversal^S Y=$$YN^RCDPESR9(X)
+7 ;;10^^Claim Status Code
+8 ;;10^1^Crossed Over Name^S Y=""
+9 ;;10^1^Crossed Over ID^S Y=""
+10 ;;10^^Submitted Charge^S Y=$$ZERO^RCDPESR9(X,1)
+11 ;;10^^Amount Paid^S Y=$$ZERO^RCDPESR9(X,1)
+12 ;;10^^ICN
+13 ;;10^^DRG Code Used
+14 ;;10^^DRG Weight Used^S Y=$J($$ZERO^RCDPESR9(X,1)/100,4)
+15 ;;10^^Discharge Fraction^S Y=$$ZERO^RCDPESR9(X,1)
+16 ;;10^^Rendering NPI
+17 ;;10^^Entity Type Qualifier
+18 ;;10^^Last Name
+19 ;;10^^First Name
+20 ;
15 ;;CLAIM STATUS DATA
+1 ;;15^^Line Type^S Y=X_" (CLAIM LEVEL CLAIM STATUS DATA (CONTINUED))"
+2 ;;15^^Bill #
+3 ;;15^^Covered Amount^S Y=$$ZERO^RCDPESR9(X,1)
+4 ;;15^1^Discount Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
+5 ;;15^1^Day Limit Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+6 ;;15^1^Interest Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
+7 ;;15^1^Tax Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
+8 ;;15^1^Total Before Taxes Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+9 ;;15^^Patient Responsibility Amount^S Y=$$ZERO^RCDPESR9(X,1)
+10 ;;15^1^Negative Reimbursement^S Y=$$ZERO^RCDPESR9(X,1,1)
+11 ;;15^^Health Plan Identifier
+12 ;
17 ;;CLAIM LEVEL PAYER CONTACT INFORMATION
+1 ;;17^^Line Type^S Y=X_" (CLAIM LEVEL PAYER CONTACT INFO)"
+2 ;;17^^Bill #
+3 ;;17^^Contact Name
+4 ;;17^^Contact #1
+5 ;;17^^Contact #1 Type^S Y=$$EXTERNAL^DILFD(361.1,25.03,,X)
+6 ;;17^^Contact #2
+7 ;;17^^Contact #2 Type^S Y=$$EXTERNAL^DILFD(361.1,25.05,,X)
+8 ;;17^^Contact #3
+9 ;;17^^Contact #3 Type^S Y=$$EXTERNAL^DILFD(361.1,25.07,,X)
+10 ;
20 ;;CLAIM LEVEL ADJUSTMENT DATA
+1 ;;20^^Line Type^S Y=X_" (CLAIM LEVEL CLAIM ADJUSTMENT DATA)"
+2 ;;20^^Bill #
+3 ;;20^^Adjustment Group Code
+4 ;;20^^Adjustment Reason Code
+5 ;;20^^Adjustment Amount^S Y=$$ZERO^RCDPESR9(X,1)
+6 ;;20^^Quantity^S Y=$$ZERO^RCDPESR9(X)
+7 ;;20^^Reason Code Text
+8 ;
30 ;;CLAIM LEVEL MEDICARE INPT ADJUDICATION DATA
+1 ;;30^^Line Type^S Y=X_" (CLAIM LEVEL MEDICARE INPATIENT ADJUDICATION DATA)"
+2 ;;30^^Bill #
+3 ;;30^^Covered Days/Visits^S Y=$$ZERO^RCDPESR9(X)
+4 ;;30^1^Lifetime Reserve Days Count^S Y=$$ZERO^RCDPESR9(X,,1)
+5 ;;30^1^Lifetime Psych Days Count^S Y=$$ZERO^RCDPESR9(X,,1)
+6 ;;30^^Claim DRG Amt^S Y=$$ZERO^RCDPESR9(X,1)
+7 ;;30^1^Claim Disproportionate Share Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+8 ;;30^1^Claim MSP Pass thru Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+9 ;;30^1^Claim PPS Capital Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+10 ;;30^1^PPS-Capital FSP DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+11 ;;30^1^PPS-Capital HSP DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+12 ;;30^1^PPS-Capital DSH DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+13 ;;30^1^Old Capital Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+14 ;;30^^Non-Covered Days^S Y=$$ZERO^RCDPESR9(X)
+15 ;
35 ;;CLAIM LEVEL MEDICARE ADJUDICATION DATA
+1 ;;35^^Line Type^S Y=X_" (CLAIM LEVEL MEDICARE ADJUDICATION DATA)"
+2 ;;35^^Bill #
+3 ;;35^1^PPS-Capital IME Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+4 ;;35^1^PPS-Operating Hosp Specific DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+5 ;;35^1^Cost Report Day Count^S Y=$$ZERO^RCDPESR9(X)
+6 ;;35^1^PPS-Operating Fed Specific DRG Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+7 ;;35^1^Claim PPS Capital Outlier Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+8 ;;35^1^Claim Indirect Teaching Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+9 ;;35^1^Non-payable Professional Component Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+10 ;;35^1^PPS-Capital Exception Amt^S Y=$$ZERO^RCDPESR9(X,1,1)
+11 ;;35^1^Outpatient Reimbursement %^S Y=$$ZERO^RCDPESR9(X)
+12 ;;35^1^HCPCS Payable Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
+13 ;;35^1^ESRD Paid Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
+14 ;;35^1^Non-payable Professional Component^S Y=$$ZERO^RCDPESR9(X,1,1)
+15 ;
37 ;;CLAIM LEVEL MEDICARE ADJUDICATION DATA REMARKS
+1 ;;37^^Line Type^S Y=X_" (CLAIM LEVEL MEDICARE ADJUDICATION DATA REMARKS)"
+2 ;;37^^Bill #
+3 ;;37^^Type^S Y=$S(X="O":"MOA",X="I":"MIA",1:X)
+4 ;;37^^Claim Payment Remark Code
+5 ;;37^^Claim Payment Remark Code Message Text
+6 ;
40 ;;SERVICE LINE DATA
+1 ;;40^^Line Type^S Y=X_" (CLAIM LEVEL SERVICE LINE DATA)"
+2 ;;40^^Bill #
+3 ;;40^^Procedure
+4 ;;40^^Revenue Code
+5 ;;40^^Modifier 1
+6 ;;40^^Modifier 2
+7 ;;40^^Modifier 3
+8 ;;40^^Modifier 4
+9 ;;40^^Description
+10 ;;40^^Original Procedure
+11 ;;40^^Original Modifier 1
+12 ;;40^^Original Modifier 2
+13 ;;40^^Original Modifier 3
+14 ;;40^^Original Modifier 4
+15 ;;40^^Original Charge^S Y=$$ZERO^RCDPESR9(X,1)
+16 ;;40^^Original Units^S Y=$$ZERO^RCDPESR9(X,1)
+17 ;;40^^Amount Paid^S Y=$$ZERO^RCDPESR9(X,1)
+18 ;;40^^Covered Units^S Y=$$ZERO^RCDPESR9(X,1)
+19 ;;40^^Service From Date^S Y=$$FDT^RCDPESR9(X)
+20 ;;40^^Service To Date^S Y=$$FDT^RCDPESR9(X)
+21 ;;40^^Procedure Type
+22 ;;40^^Applies to Billing Line
+23 ;
41 ;;SERVICE LINE DATA
+1 ;;41^^Line Type^S Y=X_" (CLAIM LEVEL SERVICE LINE DATA (CONTINUED))"
+2 ;;41^^Bill #
+3 ;;41^^Allowed Amount^S Y=$$ZERO^RCDPESR9(X,1)
+4 ;;41^1^Per Diem Amount^S Y=$$ZERO^RCDPESR9(X,1,1)
+5 ;
42 ;;SERVICE LINE DATA
+1 ;;42^^Line Type^S Y=X_" (CLAIM LEVEL SERVICE LINE DATA (CONTINUED))"
+2 ;;42^^Bill #
+3 ;;42^^Line Item Remark Code
+4 ;;42^^Line Item Remark Code Text
+5 ;
45 ;;SERVICE LINE ADJUSTMENT DATA
+1 ;;45^^Line Type^S Y=X_" (CLAIM LEVEL SERVICE LINE ADJUSTMENT DATA)"
+2 ;;45^^Bill #
+3 ;;45^^Adjustment Group Code
+4 ;;45^^Adjustment Reason Code
+5 ;;45^^Adjustment Amount^S Y=$$ZERO^RCDPESR9(X,1)
+6 ;;45^^Quantity^S Y=$$ZERO^RCDPESR9(X)
+7 ;;45^^Reason Code Text
+8 ;
FDT(X) ; returns MM/DD/YYYY or MM/DD/YY from YYYYMMDD or YYMMDD in X
+1 IF $LENGTH(X)=8
IF X?8N
SET X=$EXTRACT(X,5,6)_"/"_$EXTRACT(X,7,8)_"/"_$EXTRACT(X,1,4)
+2 IF $LENGTH(X)=6
IF X?6N
SET X=$EXTRACT(X,3,4)_"/"_$EXTRACT(X,5,6)_"/"_$EXTRACT(X,1,2)
+3 QUIT X
+4 ;
ZERO(X,D,NULL) ; Returns numeric value of X without leading 0's
+1 ; or null if no value wanted for 0 amount
+2 ; D = 1 if dollar amt
+3 NEW Z
+4 IF X["."
SET Z=$PIECE(X,".")
SET X=+Z_"."_$PIECE(X,".",2)
+5 IF X'["."
Begin DoDot:1
+6 IF $GET(D)
SET X=+$EXTRACT(X,1,$LENGTH(X)-2)_"."_$EXTRACT(X,$LENGTH(X)-1,$LENGTH(X))
+7 SET X=$SELECT('$GET(D):+X,1:$JUSTIFY(X,"",2))
End DoDot:1
+8 QUIT $SELECT(X:X,$GET(NULL):"",1:X)
+9 ;
YN(X) ; Returns YES for X="Y" and NO for X="N"
+1 SET X=$SELECT(X="Y":"YES",X="N":"NO",1:X)
+2 QUIT X
+3 ;