use of org.hl7.fhir.dstu3.model.ExplanationOfBenefit.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);
}
use of org.hl7.fhir.dstu3.model.ExplanationOfBenefit.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);
}
Aggregations