Search in sources :

Example 26 with DiagnosisComponent

use of org.hl7.fhir.r4.model.Claim.DiagnosisComponent in project beneficiary-fhir-data by CMSgov.

the class SamhsaMatcherFromClaimTransformerTest method verifyNoItemCodingsTriggersSamhsaFiltering.

/**
 * Verifies that a claim with no samhsa diagnosis, procedure, or item-level HCPCS codes does
 * trigger filtering because the code array is empty and therefore does not contain known systems.
 *
 * @param expectMatch if the test is expecting a filtering match
 * @param explanationOfBenefit the loaded benefit to use for the test
 */
private void verifyNoItemCodingsTriggersSamhsaFiltering(ExplanationOfBenefit explanationOfBenefit, boolean expectMatch) {
    ExplanationOfBenefit modifiedEob = explanationOfBenefit.copy();
    // Set Top level diagnosis and package code to null and coding to empty
    for (ExplanationOfBenefit.DiagnosisComponent diagnosisComponent : modifiedEob.getDiagnosis()) {
        if (diagnosisComponent != null && diagnosisComponent.getDiagnosisCodeableConcept() != null) {
            diagnosisComponent.getDiagnosisCodeableConcept().setCoding(new ArrayList<>());
            diagnosisComponent.setPackageCode(null);
        }
    }
    // Set procedure to empty
    modifiedEob.setProcedure(new ArrayList<>());
    // Set item level codings to non-SAMHSA
    modifiedEob.getItem().get(0).setService(null);
    // When
    boolean isMatch = samhsaMatcher.test(modifiedEob);
    // Then
    assertEquals(expectMatch, isMatch);
}
Also used : ExplanationOfBenefit(org.hl7.fhir.dstu3.model.ExplanationOfBenefit)

Example 27 with DiagnosisComponent

use of org.hl7.fhir.r4.model.Claim.DiagnosisComponent in project integration-adaptor-111 by nhsconnect.

the class EncounterReportBundleServiceTest method setUp.

@BeforeEach
public void setUp() throws XmlException {
    INT versionNumber = mock(INT.class);
    when(versionNumber.getValue()).thenReturn(VERSION);
    when(document.getVersionNumber()).thenReturn(versionNumber);
    when(document.getEffectiveTime()).thenReturn(ts);
    when(ts.getValue()).thenReturn(EFFECTIVE_TIME);
    List<QuestionnaireResponse> questionnaireResponseList = new ArrayList<>();
    questionnaireResponseList.add(QUESTIONNAIRE_RESPONSE);
    when(deviceMapper.mapDevice()).thenReturn(DEVICE);
    when(encounterMapper.mapEncounter(any(), any(), any(), any())).thenReturn(ENCOUNTER);
    when(conditionMapper.mapCondition(any(), any(), any())).thenReturn(CONDITION);
    when(compositionMapper.mapComposition(any(), any(), any(), any(), any(), any())).thenReturn(COMPOSITION);
    when(listMapper.mapList(any(), any(), any(), any())).thenReturn(LIST_RESOURCE);
    when(carePlanMapper.mapCarePlan(any(), any(), any())).thenReturn(singletonList(CAREPLAN));
    when(healthcareServiceMapper.mapHealthcareService(any())).thenReturn(singletonList(HEALTHCARE_SERVICE));
    when(consentMapper.mapConsent(any(), any())).thenReturn(CONSENT);
    when(pathwayUtil.getQuestionnaireResponses(any(), any(), any())).thenReturn(questionnaireResponseList);
    when(messageHeaderService.createMessageHeader(any(), any(), eq(EFFECTIVE_TIME))).thenReturn(MESSAGE_HEADER);
    when(referralRequestMapper.mapReferralRequest(any(), any(), any(), any(), any())).thenReturn(REFERRAL_REQUEST);
    when(observationMapper.mapObservations(any(), eq(ENCOUNTER))).thenReturn(Arrays.asList(OBSERVATION));
    when(practitionerRoleMapper.mapAuthorRoles(any())).thenReturn(singletonList(AUTHOR_ROLE));
    when(practitionerRoleMapper.mapResponsibleParty(any())).thenReturn(Optional.of(PRACTITIONER_ROLE));
    when(relatedPersonMapper.createEmergencyContactRelatedPerson(eq(document), eq(ENCOUNTER))).thenReturn(RELATED_PERSON);
    when(deviceMapper.mapDevice()).thenReturn(DEVICE);
    Encounter.DiagnosisComponent diagnosisComponent = new Encounter.DiagnosisComponent();
    diagnosisComponent.setCondition(new Reference());
    diagnosisComponent.setRole(new CodeableConcept());
    diagnosisComponent.setRank(1);
    diagnosisComponent.setConditionTarget(CONDITION);
    ENCOUNTER.addDiagnosis(diagnosisComponent);
}
Also used : Reference(org.hl7.fhir.dstu3.model.Reference) ArrayList(java.util.ArrayList) Encounter(org.hl7.fhir.dstu3.model.Encounter) QuestionnaireResponse(org.hl7.fhir.dstu3.model.QuestionnaireResponse) INT(uk.nhs.connect.iucds.cda.ucr.INT) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ArrayList (java.util.ArrayList)15 Coding (org.hl7.fhir.r4.model.Coding)14 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)9 Coding (org.hl7.fhir.dstu3.model.Coding)8 ExplanationOfBenefit (org.hl7.fhir.dstu3.model.ExplanationOfBenefit)8 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)8 ExplanationOfBenefit (org.hl7.fhir.r4.model.ExplanationOfBenefit)8 DiagnosisComponent (org.hl7.fhir.r4.model.ExplanationOfBenefit.DiagnosisComponent)8 Test (org.junit.jupiter.api.Test)7 Reference (org.hl7.fhir.dstu3.model.Reference)4 Claim (org.mitre.synthea.world.concepts.Claim)4 DateType (org.hl7.fhir.dstu3.model.DateType)3 Money (org.hl7.fhir.dstu3.model.Money)3 Period (org.hl7.fhir.dstu3.model.Period)3 CcwCodebookVariable (gov.cms.bfd.model.codebook.data.CcwCodebookVariable)2 CcwCodebookInterface (gov.cms.bfd.model.codebook.model.CcwCodebookInterface)2 Diagnosis (gov.cms.bfd.server.war.commons.Diagnosis)2 DiagnosisLabel (gov.cms.bfd.server.war.commons.Diagnosis.DiagnosisLabel)2 BadCodeMonkeyException (gov.cms.bfd.sharedutils.exceptions.BadCodeMonkeyException)2 BufferedReader (java.io.BufferedReader)2