Search in sources :

Example 21 with Diagnosis

use of gov.cms.bfd.server.war.commons.Diagnosis in project beneficiary-fhir-data by CMSgov.

the class DiagnosisUtilV2 method translateLabels.

/**
 * Translates a list of {@link DiagnosisLabel} to an EOB type specific Coding based on the (@link
 * ClaimTypeV2}.
 *
 * <p>In practice, the list will only ever be one {@link DiagnosisLabel}. The {@link Diagnosis}
 * class allows multiple labels to be present, so we cover that case here. In V2, only a single
 * label will ever be assigned.
 */
static CodeableConcept translateLabels(Set<DiagnosisLabel> labels, ClaimTypeV2 claimType) {
    CodeableConcept diagType = new CodeableConcept();
    List<Coding> codings = labels.stream().map(l -> translateLabelCode(l, claimType)).collect(Collectors.toList());
    return diagType.setCoding(codings);
}
Also used : IntStream(java.util.stream.IntStream) CcwCodebookInterface(gov.cms.bfd.model.codebook.model.CcwCodebookInterface) LoggerFactory(org.slf4j.LoggerFactory) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) HashMap(java.util.HashMap) C4BBClaimProfessionalAndNonClinicianDiagnosisType(gov.cms.bfd.server.war.commons.carin.C4BBClaimProfessionalAndNonClinicianDiagnosisType) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ItemComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent) ExDiagnosistype(org.hl7.fhir.r4.model.codesystems.ExDiagnosistype) CcwCodebookVariable(gov.cms.bfd.model.codebook.data.CcwCodebookVariable) Map(java.util.Map) Diagnosis(gov.cms.bfd.server.war.commons.Diagnosis) ReflectionUtils(gov.cms.bfd.server.war.commons.ReflectionUtils) Logger(org.slf4j.Logger) BadCodeMonkeyException(gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException) Set(java.util.Set) IOException(java.io.IOException) C4BBClaimInpatientInstitutionalDiagnosisType(gov.cms.bfd.server.war.commons.carin.C4BBClaimInpatientInstitutionalDiagnosisType) C4BBClaimOutpatientInstitutionalDiagnosisType(gov.cms.bfd.server.war.commons.carin.C4BBClaimOutpatientInstitutionalDiagnosisType) InputStreamReader(java.io.InputStreamReader) Collectors(java.util.stream.Collectors) DiagnosisLabel(gov.cms.bfd.server.war.commons.Diagnosis.DiagnosisLabel) UncheckedIOException(java.io.UncheckedIOException) List(java.util.List) Coding(org.hl7.fhir.r4.model.Coding) ExplanationOfBenefit(org.hl7.fhir.r4.model.ExplanationOfBenefit) Optional(java.util.Optional) BufferedReader(java.io.BufferedReader) DiagnosisComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent) InputStream(java.io.InputStream) Coding(org.hl7.fhir.r4.model.Coding) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Aggregations

Diagnosis (gov.cms.bfd.server.war.commons.Diagnosis)21 ItemComponent (org.hl7.fhir.dstu3.model.ExplanationOfBenefit.ItemComponent)10 ExplanationOfBenefit (org.hl7.fhir.dstu3.model.ExplanationOfBenefit)9 ExplanationOfBenefit (org.hl7.fhir.r4.model.ExplanationOfBenefit)9 ItemComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.ItemComponent)8 CcwCodebookVariable (gov.cms.bfd.model.codebook.data.CcwCodebookVariable)7 BadCodeMonkeyException (gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException)7 Optional (java.util.Optional)7 CCWProcedure (gov.cms.bfd.server.war.commons.CCWProcedure)6 MetricRegistry (com.codahale.metrics.MetricRegistry)5 InpatientClaimLine (gov.cms.bfd.model.rif.InpatientClaimLine)5 DiagnosisLabel (gov.cms.bfd.server.war.commons.Diagnosis.DiagnosisLabel)5 MedicareSegment (gov.cms.bfd.server.war.commons.MedicareSegment)5 IntStream (java.util.stream.IntStream)5 CcwCodebookInterface (gov.cms.bfd.model.codebook.model.CcwCodebookInterface)4 CarrierClaimLine (gov.cms.bfd.model.rif.CarrierClaimLine)4 HHAClaimLine (gov.cms.bfd.model.rif.HHAClaimLine)4 HospiceClaimLine (gov.cms.bfd.model.rif.HospiceClaimLine)4 OutpatientClaimLine (gov.cms.bfd.model.rif.OutpatientClaimLine)4 BufferedReader (java.io.BufferedReader)4