Skip to content

Commit

Permalink
BFD-3372: Ingest RDA API v0.14.1 fields (#2283)
Browse files Browse the repository at this point in the history
  • Loading branch information
meliGuzman authored Apr 24, 2024
1 parent 4335645 commit f0832e6
Show file tree
Hide file tree
Showing 22 changed files with 355 additions and 22 deletions.
8 changes: 8 additions & 0 deletions apps/bfd-model/bfd-model-rda/mappings/FissClaim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ mappings:
comment: 'Medical Record Number: This field identifies the number assigned to
the patient''s medical/health record by the provider.'
dbName: medical_record_no
- name: admTypCd
sqlType: varchar(2)
comment: 'Indicates the type and priority of inpatient services.'
dbName: adm_typ_cd
- name: mbiId
dbName: mbi_id
sqlType: bigint
Expand Down Expand Up @@ -701,5 +705,9 @@ mappings:
- from: fissRevenueLines
to: revenueLines
transformer: Array
- from: admTypCd
transformer: MessageEnum
transformerOptions:
enumClass: gov.cms.mpsm.rda.v1.fiss.FissAdmTypeCode
externalTransformations:
- applyMbiCache
19 changes: 19 additions & 0 deletions apps/bfd-model/bfd-model-rda/mappings/FissRevenueLine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ mappings:
or the service is for home health Part B; this field will identify the applicable
adjustment group code that defines the liability for adjustments in charges
occurring from this payment reduction.'
- name: ndc
sqlType: varchar(11)
dbName: ndc
comment: 'This field identifies the NDC assigned to each medication.'
- name: ndcQty
sqlType: varchar(11)
dbName: ndc_qty
comment: 'This field identifies the quantity of the NDC medication administered.'
- name: ndcQtyQual
sqlType: varchar(2)
dbName: ndc_qty_qual
comment: 'This field identifies the measurement qualifier for the quantity of the NDC medication administered.'

transformations:
- from: PARENT
to: claimId
Expand Down Expand Up @@ -143,3 +156,9 @@ mappings:
- from: acoRedRarc
- from: acoRedCarc
- from: acoRedCagc
- from: ndc
- from: ndcQty
- from: ndcQtyQual
transformer: MessageEnum
transformerOptions:
enumClass: gov.cms.mpsm.rda.v1.fiss.FissNdcQtyQual
13 changes: 13 additions & 0 deletions apps/bfd-model/bfd-model-rda/mappings/McsDetail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,17 @@ mappings:
dbName: idr_dtl_amb_dropoff_zipcode
comment: 'Ambulance Drop-off Location ZIP Code: This field contains the ambulance
drop-off location''s zip code.'
- name: idrDtlNdc
sqlType: varchar(48)
dbName: idr_dtl_ndc
comment: 'Detail level NDC (National Drug Code): This field holds the data from
segment 2410-LIN03 of claims submitted in 5010A1 format.'
- name: idrDtlNdcUnitCount
sqlType: varchar(15)
dbName: idr_dtl_ndc_unit_count
comment: 'Detail level NDC (National Drug Code) Units: This field holds the data
from 5010A format 2410 CTP04 claims.'

transformations:
- from: PARENT
to: idrClmHdIcn
Expand Down Expand Up @@ -333,3 +344,5 @@ mappings:
- from: idrDtlAmbDropoffCity
- from: idrDtlAmbDropoffState
- from: idrDtlAmbDropoffZipcode
- from: idrDtlNdc
- from: idrDtlNdcUnitCount
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- As part of the 0.14.1 RDA API update, new fields added

/*
* fiss_claims
*/
ALTER TABLE rda.fiss_claims ADD adm_typ_cd varchar(2);

/*
* fiss_revenue_lines
*/
ALTER TABLE rda.fiss_revenue_lines ADD ndc varchar(11);
ALTER TABLE rda.fiss_revenue_lines ADD ndc_qty varchar(11);
ALTER TABLE rda.fiss_revenue_lines ADD ndc_qty_qual varchar(2);

/*
* mcs_details
*/
ALTER TABLE rda.mcs_details ADD idr_dtl_ndc varchar(48);
ALTER TABLE rda.mcs_details ADD idr_dtl_ndc_unit_count varchar(15);
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.annotations.VisibleForTesting;
import gov.cms.mpsm.rda.v1.fiss.FissAdjustmentMedicareBeneficiaryIdentifierIndicator;
import gov.cms.mpsm.rda.v1.fiss.FissAdjustmentRequestorCode;
import gov.cms.mpsm.rda.v1.fiss.FissAdmTypeCode;
import gov.cms.mpsm.rda.v1.fiss.FissAssignmentOfBenefitsIndicator;
import gov.cms.mpsm.rda.v1.fiss.FissAuditTrail;
import gov.cms.mpsm.rda.v1.fiss.FissBeneZPayer;
Expand All @@ -21,6 +22,7 @@
import gov.cms.mpsm.rda.v1.fiss.FissDiagnosisPresentOnAdmissionIndicator;
import gov.cms.mpsm.rda.v1.fiss.FissHealthInsuranceClaimNumberOrMedicareBeneficiaryIdentifier;
import gov.cms.mpsm.rda.v1.fiss.FissInsuredPayer;
import gov.cms.mpsm.rda.v1.fiss.FissNdcQtyQual;
import gov.cms.mpsm.rda.v1.fiss.FissNonBillRevCode;
import gov.cms.mpsm.rda.v1.fiss.FissPatientRelationshipCode;
import gov.cms.mpsm.rda.v1.fiss.FissPayer;
Expand Down Expand Up @@ -161,6 +163,14 @@ public class RandomFissClaimGenerator extends AbstractRandomClaimGenerator<FissC
private static final List<FissNonBillRevCode> FissNonBillRevCodeEnums =
enumValues(FissNonBillRevCode.values());

/** A list of the enums for the fiss claim admission type codes. */
private static final List<FissAdmTypeCode> FissAdmTypeCodeEnums =
enumValues(FissAdmTypeCode.values());

/** A list of the enums for the fiss NDC measurement qualifiers. */
private static final List<FissNdcQtyQual> FissNdcQtyQualEnums =
enumValues(FissNdcQtyQual.values());

/** Max length of a FISS claim id. */
private static final int FissClaimIdLength = 32;

Expand Down Expand Up @@ -372,6 +382,10 @@ private void addRandomFieldValues(FissClaim.Builder claim) {
() -> claim.setAdjMbiIndUnrecognized(randomAlphaNumeric(1, 1)));
optional("adjMbi", () -> claim.setAdjMbi(randomAlphaNumeric(1, 11)));
optional("medicalRecordNo", () -> claim.setMedicalRecordNo(randomAlphaNumeric(1, 17)));
optionalOneOf(
"admTypCd",
() -> claim.setAdmTypCdEnum(randomEnum(FissAdmTypeCodeEnums)),
() -> claim.setAdmTypCdUnrecognized(randomAlphaNumeric(1, 1)));
}

/**
Expand Down Expand Up @@ -619,6 +633,7 @@ private void addRandomAudits(FissClaim.Builder claim) {
private void addRandomRevenueLines(FissClaim.Builder claim) {
final int MAX_UNITS_BILLED = 50;
final int MAX_SERV_UNIT_COUNT = 50;
final int MAX_NDC_QTY = 11;

always(
"revenue",
Expand Down Expand Up @@ -663,6 +678,11 @@ private void addRandomRevenueLines(FissClaim.Builder claim) {
optional("acoRedRarc", () -> revenue.setAcoRedRarc(randomAlphaNumeric(1, 5)));
optional("acoRedCarc", () -> revenue.setAcoRedCarc(randomAlphaNumeric(1, 3)));
optional("acoRedCagc", () -> revenue.setAcoRedCagc(randomAlphaNumeric(1, 2)));
optional("ndc", () -> revenue.setNdc(randomAlphaNumeric(1, 11)));
optional("ndcQty", () -> revenue.setNdcQty(randomDigit(1, MAX_NDC_QTY)));
optional(
"ndcQtyQual",
() -> revenue.setNdcQtyQualEnum(randomEnum(FissNdcQtyQualEnums)));
});

revenue.setRdaPosition(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ private void addDetails(McsClaim.Builder claim, int detailCount) {
optional(
"idrDtlAmbDropoffZipcode",
(() -> detail.setIdrDtlAmbDropoffZipcode(randomAlphaNumeric(1, 9))));
optional("idrDtlNdc", (() -> detail.setIdrDtlNdc(randomAlphaNumeric(1, 48))));
optional(
"idrDtlNdcUnitCount",
(() -> detail.setIdrDtlNdcUnitCount(randomAlphaNumeric(1, 15))));
});

claim.addMcsDetails(detail.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class RdaService extends RDAServiceGrpc.RDAServiceImplBase {
private static final Logger LOGGER = LoggerFactory.getLogger(RdaService.class);

/** The RDA server version to use when serving messages. */
public static final String RDA_PROTO_VERSION = "0.13.0";
public static final String RDA_PROTO_VERSION = "0.14.1";

/** The source of claims for the server. */
private final RdaMessageSourceFactory messageSourceFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.0
0.14.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

package gov.cms.mpsm.rda.v1.fiss;

option java_multiple_files = true;

import "rda/v1/enum_options.proto";

// FISS Adm Type Code
enum FissAdmTypeCode {
ADM_TYPE_0 = 0 [(string_value) = "0"];
ADM_TYPE_EMERGENCY = 1 [(string_value) = "1"];
ADM_TYPE_URGENT = 2 [(string_value) = "2"];
ADM_TYPE_ELECTIVE = 3 [(string_value) = "3"];
ADM_TYPE_NEWBORN = 4 [(string_value) = "4"];
ADM_TYPE_TRAUMA_CENTER = 5 [(string_value) = "5"];
ADM_TYPE_9 = 6 [(string_value) = "9"];
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "rda/v1/fiss/fiss_repository_indicator.proto";
import "rda/v1/fiss/fiss_source_of_admission.proto";
import "rda/v1/fiss/fiss_revenue_line.proto";
import "rda/v1/fiss/fiss_claim_type_indicator.proto";
import "rda/v1/fiss/fiss_adm_type_code.proto";

// FISS (Fiscal Intermediary Shared Systems) Claim
message FissClaim {
Expand Down Expand Up @@ -356,6 +357,12 @@ message FissClaim {
string clm_typ_ind_unrecognized = 109;
};

// Adm Type Code
oneof adm_typ_cd {
FissAdmTypeCode adm_typ_cd_enum = 114;
string adm_typ_cd_unrecognized = 115;
};

// Adjustment Medicare Beneficiary Identifier
optional string adj_mbi = 100;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

package gov.cms.mpsm.rda.v1.fiss;

option java_multiple_files = true;

import "rda/v1/enum_options.proto";

// FISS NDC quantity qualifier:
//
// This field identifies the NDC quantity qualifier
enum FissNdcQtyQual {
NDC_QTY_QUAL_F2 = 0 [(string_value) = "F2"];
NDC_QTY_QUAL_GR = 1 [(string_value) = "GR"];
NDC_QTY_QUAL_ME = 2 [(string_value) = "ME"];
NDC_QTY_QUAL_ML = 3 [(string_value) = "ML"];
NDC_QTY_QUAL_UN = 4 [(string_value) = "UN"];
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ option java_multiple_files = true;

import "rda/v1/fiss/fiss_non_bill_rev_code.proto";
import "rda/v1/fiss/fiss_claim_type_indicator.proto";
import "rda/v1/fiss/fiss_adm_type_code.proto";
import "rda/v1/fiss/fiss_ndc_qty_qual.proto";

// FISS Revenue Line
message FissRevenueLine {
Expand All @@ -21,6 +23,12 @@ message FissRevenueLine {
string non_bill_rev_code_unrecognized = 17;
}

// NDC Quantity Qual
oneof ndc_qty_qual {
FissNdcQtyQual ndc_qty_qual_enum = 34;
string ndc_qty_qual_unrecognized = 35;
}

// Revenue Code
optional string rev_cd = 18;

Expand Down Expand Up @@ -66,4 +74,10 @@ message FissRevenueLine {

// Pioneer Accountable Care Organization (ACO) Reduction Group Code
optional string aco_red_cagc = 33;

// NDC assigned to each medication
optional string ndc = 36;

// Quantity of NDC medication assigned
optional string ndc_qty = 37;
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ message McsDetail {
optional string idr_dtl_amb_dropoff_city = 59;
optional string idr_dtl_amb_dropoff_state = 60;
optional string idr_dtl_amb_dropoff_zipcode = 61;
optional string idr_dtl_ndc = 62;
optional string idr_dtl_ndc_unit_count = 63;
uint32 idr_dtl_number = 67;
}
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ public void randomClaim() throws InvalidProtocolBufferException {
"hcpcModifier5": "f",
"acoRedRarc": "1x4",
"acoRedCarc": "g",
"acoRedCagc": "nz"
"acoRedCagc": "nz",
"ndcQtyQualEnum": "NDC_QTY_QUAL_GR",
"ndc": "jcmf6sx",
"ndcQty": "7936840010"
}, {
"rdaPosition": 2,
"nonBillRevCodeUnrecognized": "m",
Expand All @@ -372,7 +375,10 @@ public void randomClaim() throws InvalidProtocolBufferException {
"hcpcModifier5": "df",
"acoRedRarc": "p",
"acoRedCarc": "t0",
"acoRedCagc": "tm"
"acoRedCagc": "tm",
"ndcQtyQualEnum": "NDC_QTY_QUAL_F2",
"ndc": "dnmvqsj",
"ndcQty": "1309901"
}, {
"rdaPosition": 3,
"nonBillRevCodeEnum": "NON_BILL_INVALID_REV_CODE",
Expand All @@ -390,7 +396,10 @@ public void randomClaim() throws InvalidProtocolBufferException {
"hcpcModifier5": "8",
"acoRedRarc": "c1c7",
"acoRedCarc": "67",
"acoRedCagc": "tv"
"acoRedCagc": "tv",
"ndcQtyQualEnum": "NDC_QTY_QUAL_F2",
"ndc": "nt4chn640z0",
"ndcQty": "6727587507"
}, {
"rdaPosition": 4,
"nonBillRevCodeEnum": "NON_BILL_INVALID_HCPCS_HC",
Expand All @@ -408,7 +417,10 @@ public void randomClaim() throws InvalidProtocolBufferException {
"hcpcModifier5": "rg",
"acoRedRarc": "ntq",
"acoRedCarc": "z7",
"acoRedCagc": "3x"
"acoRedCagc": "3x",
"ndcQtyQualEnum": "NDC_QTY_QUAL_UN",
"ndc": "p4g",
"ndcQty": "4149"
}, {
"rdaPosition": 5,
"nonBillRevCodeEnum": "NON_BILL_S",
Expand All @@ -426,7 +438,10 @@ public void randomClaim() throws InvalidProtocolBufferException {
"hcpcModifier5": "f",
"acoRedRarc": "x",
"acoRedCarc": "s95",
"acoRedCagc": "k2"
"acoRedCagc": "k2",
"ndcQtyQualEnum": "NDC_QTY_QUAL_F2",
"ndc": "612jg4h6gx",
"ndcQty": "253"
}, {
"rdaPosition": 6,
"nonBillRevCodeEnum": "NON_BILL_ESRD",
Expand All @@ -444,7 +459,10 @@ public void randomClaim() throws InvalidProtocolBufferException {
"hcpcModifier5": "x",
"acoRedRarc": "svf7",
"acoRedCarc": "5",
"acoRedCagc": "xv"
"acoRedCagc": "xv",
"ndcQtyQualEnum": "NDC_QTY_QUAL_ME",
"ndc": "ps",
"ndcQty": "14975409"
}, {
"rdaPosition": 7,
"nonBillRevCodeEnum": "NON_BILL_T",
Expand All @@ -462,7 +480,10 @@ public void randomClaim() throws InvalidProtocolBufferException {
"hcpcModifier5": "8m",
"acoRedRarc": "sh1zj",
"acoRedCarc": "054",
"acoRedCagc": "93"
"acoRedCagc": "93",
"ndcQtyQualEnum": "NDC_QTY_QUAL_ML",
"ndc": "9nrj",
"ndcQty": "98448896"
}, {
"rdaPosition": 8,
"nonBillRevCodeEnum": "NON_BILL_INVALID_HCPCS_EMC",
Expand All @@ -480,7 +501,10 @@ public void randomClaim() throws InvalidProtocolBufferException {
"hcpcModifier5": "6",
"acoRedRarc": "df57b",
"acoRedCarc": "rt",
"acoRedCagc": "q"
"acoRedCagc": "q",
"ndcQtyQualEnum": "NDC_QTY_QUAL_ME",
"ndc": "36g",
"ndcQty": "36115325290"
}, {
"rdaPosition": 9,
"nonBillRevCodeEnum": "NON_BILL_INVALID_REV_CODE",
Expand All @@ -498,15 +522,19 @@ public void randomClaim() throws InvalidProtocolBufferException {
"hcpcModifier5": "9",
"acoRedRarc": "rjfgw",
"acoRedCarc": "2xb",
"acoRedCagc": "1"
"acoRedCagc": "1",
"ndcQtyQualEnum": "NDC_QTY_QUAL_UN",
"ndc": "dksxpmx1dt",
"ndcQty": "09102"
}],
"drgCd": "0",
"groupCode": "1",
"clmTypIndEnum": "CLAIM_TYPE_TOB_X20_X28",
"recdDtCymdText": "2021-01-15",
"currTranDtCymdText": "2021-05-07",
"rdaClaimKey": "79173353508803659401417553844541",
"intermediaryNb": "82320"
"intermediaryNb": "82320",
"admTypCdEnum": "ADM_TYPE_9"
}""",
json);
}
Expand Down
Loading

0 comments on commit f0832e6

Please sign in to comment.