Search in sources :

Example 11 with RecordAction

use of gov.cms.bfd.model.rif.RecordAction in project beneficiary-fhir-data by CMSgov.

the class RifFilesProcessor method buildMedicareBeneficiaryIdHistoryEvent.

/**
 * @param fileEvent the {@link RifFileEvent} being processed
 * @param csvRecords the {@link CSVRecord} to be mapped (in a single-element {@link List}), which
 *     must be from a {@link RifFileType#Medicare_Beneficiary_Id_History} {@link RifFile}
 * @return a {@link RifRecordEvent} built from the specified {@link CSVRecord}s
 */
private static RifRecordEvent<MedicareBeneficiaryIdHistory> buildMedicareBeneficiaryIdHistoryEvent(RifFileEvent fileEvent, List<CSVRecord> csvRecords) {
    if (csvRecords.size() != 1)
        throw new BadCodeMonkeyException();
    CSVRecord csvRecord = csvRecords.get(0);
    if (LOGGER.isTraceEnabled())
        LOGGER.trace(csvRecord.toString());
    RecordAction recordAction = RecordAction.INSERT;
    MedicareBeneficiaryIdHistory medicareBeneficiaryIdHistoryRow = MedicareBeneficiaryIdHistoryParser.parseRif(csvRecords);
    return new RifRecordEvent<MedicareBeneficiaryIdHistory>(fileEvent, csvRecords, recordAction, medicareBeneficiaryIdHistoryRow.getBeneficiaryId().get(), medicareBeneficiaryIdHistoryRow);
}
Also used : BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) CSVRecord(org.apache.commons.csv.CSVRecord) RecordAction(gov.cms.bfd.model.rif.RecordAction) MedicareBeneficiaryIdHistory(gov.cms.bfd.model.rif.MedicareBeneficiaryIdHistory)

Example 12 with RecordAction

use of gov.cms.bfd.model.rif.RecordAction in project beneficiary-fhir-data by CMSgov.

the class RifFilesProcessor method buildCarrierClaimEvent.

/**
 * @param fileEvent the {@link RifFileEvent} being processed
 * @param csvRecords the {@link CSVRecord}s to be mapped, which must be from a {@link
 *     RifFileType#CARRIER} {@link RifFile}
 * @return a {@link RifRecordEvent} built from the specified {@link CSVRecord}s
 */
private static RifRecordEvent<CarrierClaim> buildCarrierClaimEvent(RifFileEvent fileEvent, List<CSVRecord> csvRecords) {
    if (LOGGER.isTraceEnabled())
        LOGGER.trace(csvRecords.toString());
    CSVRecord firstCsvRecord = csvRecords.get(0);
    RecordAction recordAction = RecordAction.match(firstCsvRecord.get("DML_IND"));
    CarrierClaim claim = CarrierClaimParser.parseRif(csvRecords);
    return new RifRecordEvent<CarrierClaim>(fileEvent, csvRecords, recordAction, claim.getBeneficiaryId(), claim);
}
Also used : RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) CSVRecord(org.apache.commons.csv.CSVRecord) RecordAction(gov.cms.bfd.model.rif.RecordAction) CarrierClaim(gov.cms.bfd.model.rif.CarrierClaim)

Aggregations

RecordAction (gov.cms.bfd.model.rif.RecordAction)12 CSVRecord (org.apache.commons.csv.CSVRecord)12 RifRecordEvent (gov.cms.bfd.model.rif.RifRecordEvent)11 BadCodeMonkeyException (gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException)5 Beneficiary (gov.cms.bfd.model.rif.Beneficiary)2 MetricRegistry (com.codahale.metrics.MetricRegistry)1 Timer (com.codahale.metrics.Timer)1 BeneficiaryHistory (gov.cms.bfd.model.rif.BeneficiaryHistory)1 CarrierClaim (gov.cms.bfd.model.rif.CarrierClaim)1 DMEClaim (gov.cms.bfd.model.rif.DMEClaim)1 HHAClaim (gov.cms.bfd.model.rif.HHAClaim)1 HospiceClaim (gov.cms.bfd.model.rif.HospiceClaim)1 InpatientClaim (gov.cms.bfd.model.rif.InpatientClaim)1 LoadedBatch (gov.cms.bfd.model.rif.LoadedBatch)1 LoadedBatchBuilder (gov.cms.bfd.model.rif.LoadedBatchBuilder)1 MedicareBeneficiaryIdHistory (gov.cms.bfd.model.rif.MedicareBeneficiaryIdHistory)1 OutpatientClaim (gov.cms.bfd.model.rif.OutpatientClaim)1 PartDEvent (gov.cms.bfd.model.rif.PartDEvent)1 RifFileEvent (gov.cms.bfd.model.rif.RifFileEvent)1 RifFileType (gov.cms.bfd.model.rif.RifFileType)1