Search in sources :

Example 1 with RecordAction

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

the class RifFilesProcessor method buildOutpatientClaimEvent.

/**
 * @param fileEvent the {@link RifFileEvent} being processed that is being processed
 * @param csvRecords the {@link CSVRecord}s to be mapped, which must be from a {@link
 *     RifFileType#OUTPATIENT} {@link RifFile}
 * @return a {@link RifRecordEvent} built from the specified {@link CSVRecord}s
 */
private static RifRecordEvent<OutpatientClaim> buildOutpatientClaimEvent(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"));
    OutpatientClaim claim = OutpatientClaimParser.parseRif(csvRecords);
    return new RifRecordEvent<OutpatientClaim>(fileEvent, csvRecords, recordAction, claim.getBeneficiaryId(), claim);
}
Also used : OutpatientClaim(gov.cms.bfd.model.rif.OutpatientClaim) RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) CSVRecord(org.apache.commons.csv.CSVRecord) RecordAction(gov.cms.bfd.model.rif.RecordAction)

Example 2 with RecordAction

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

the class RifFilesProcessor method buildPartDEvent.

/**
 * @param fileEvent the {@link RifFilesEvent} being processed
 * @param csvRecords the {@link CSVRecord}s to be mapped, which must be from a {@link
 *     RifFileType#PDE} {@link RifFile}
 * @return a {@link RifRecordEvent} built from the specified {@link CSVRecord}s
 */
private static RifRecordEvent<PartDEvent> buildPartDEvent(RifFileEvent fileEvent, List<CSVRecord> csvRecords) {
    if (csvRecords.size() != 1)
        throw new BadCodeMonkeyException();
    if (LOGGER.isTraceEnabled())
        LOGGER.trace(csvRecords.toString());
    CSVRecord csvRecord = csvRecords.get(0);
    RecordAction recordAction = RecordAction.match(csvRecord.get("DML_IND"));
    PartDEvent partDEvent = PartDEventParser.parseRif(csvRecords);
    return new RifRecordEvent<PartDEvent>(fileEvent, csvRecords, recordAction, partDEvent.getBeneficiaryId(), partDEvent);
}
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) PartDEvent(gov.cms.bfd.model.rif.PartDEvent)

Example 3 with RecordAction

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

the class RifFilesProcessor method buildSNFClaimEvent.

/**
 * @param fileEvent the {@link RifFileEvent} being processed
 * @param csvRecords the {@link CSVRecord}s to be mapped, which must be from a {@link
 *     RifFileType#SNF} {@link RifFile}
 * @return a {@link RifRecordEvent} built from the specified {@link CSVRecord}s
 */
private static RifRecordEvent<SNFClaim> buildSNFClaimEvent(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"));
    SNFClaim claim = SNFClaimParser.parseRif(csvRecords);
    return new RifRecordEvent<SNFClaim>(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) SNFClaim(gov.cms.bfd.model.rif.SNFClaim)

Example 4 with RecordAction

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

the class RifFilesProcessor method buildInpatientClaimEvent.

/**
 * @param fileEvent the {@link RifFileEvent} being processed that is being processed
 * @param csvRecords the {@link CSVRecord}s to be mapped, which must be from a {@link
 *     RifFileType#INPATIENT} {@link RifFile}
 * @return a {@link RifRecordEvent} built from the specified {@link CSVRecord}s
 */
private static RifRecordEvent<InpatientClaim> buildInpatientClaimEvent(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"));
    InpatientClaim claim = InpatientClaimParser.parseRif(csvRecords);
    return new RifRecordEvent<InpatientClaim>(fileEvent, csvRecords, recordAction, claim.getBeneficiaryId(), claim);
}
Also used : InpatientClaim(gov.cms.bfd.model.rif.InpatientClaim) RifRecordEvent(gov.cms.bfd.model.rif.RifRecordEvent) CSVRecord(org.apache.commons.csv.CSVRecord) RecordAction(gov.cms.bfd.model.rif.RecordAction)

Example 5 with RecordAction

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

the class RifFilesProcessor method buildBeneficiaryHistoryEvent.

/**
 * @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#BENEFICIARY_HISTORY} {@link RifFile}
 * @return a {@link RifRecordEvent} built from the specified {@link CSVRecord}s
 */
private static RifRecordEvent<BeneficiaryHistory> buildBeneficiaryHistoryEvent(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.match(csvRecord.get("DML_IND"));
    BeneficiaryHistory beneficiaryHistoryRow = BeneficiaryHistoryParser.parseRif(csvRecords);
    return new RifRecordEvent<BeneficiaryHistory>(fileEvent, csvRecords, recordAction, beneficiaryHistoryRow.getBeneficiaryId(), beneficiaryHistoryRow);
}
Also used : BeneficiaryHistory(gov.cms.bfd.model.rif.BeneficiaryHistory) 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)

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