use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project beneficiary-fhir-data by CMSgov.
the class SamhsaMatcherFromClaimTransformerTest method verifySamhsaMatcherForDiagnosisIcd.
/**
* Verify SAMHSA matcher for ICD item with the given system, code and if the expectation is that
* there should be a match for this combination.
*
* @param system the system value
* @param code the code
* @param shouldMatch if the matcher should match on this combination
*/
private void verifySamhsaMatcherForDiagnosisIcd(String system, String code, boolean shouldMatch, ExplanationOfBenefit explanationOfBenefit) {
ExplanationOfBenefit modifiedEob = explanationOfBenefit.copy();
// Set diagnosis
for (ExplanationOfBenefit.DiagnosisComponent diagnosisComponent : modifiedEob.getDiagnosis()) {
CodeableConcept codeableConcept = diagnosisComponent.getDiagnosisCodeableConcept();
if (codeableConcept != null) {
ArrayList<Coding> codingList = new ArrayList<>();
codingList.add(new Coding().setSystem(system).setCode(code));
codeableConcept.setCoding(codingList);
diagnosisComponent.setPackageCode(null);
}
}
// Set procedure to empty so we dont check it for matches
modifiedEob.getProcedure().forEach(c -> c.getProcedureCodeableConcept().setCoding(new ArrayList<>()));
// Set item coding to non-SAMHSA so we dont check it for matches
List<Coding> codings = new ArrayList<>();
Coding coding = new Coding();
coding.setSystem(TransformerConstants.CODING_SYSTEM_HCPCS);
coding.setCode(NON_SAMHSA_HCPCS_CODE);
codings.add(coding);
modifiedEob.getItem().get(0).getService().setCoding(codings);
assertEquals(shouldMatch, samhsaMatcher.test(modifiedEob));
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE 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.r4.model.codesystems.ResourceTypes.PROCEDURE in project BridgeServer2 by Sage-Bionetworks.
the class CRCControllerTest method procedureMissingIdentifiers.
@Test(expectedExceptions = BadRequestException.class, expectedExceptionsMessageRegExp = "Could not find Bridge user ID.")
public void procedureMissingIdentifiers() throws Exception {
when(mockRequest.getHeader(AUTHORIZATION)).thenReturn(AUTHORIZATION_HEADER_VALUE);
when(mockAccountService.authenticate(any(), any())).thenReturn(account);
when(mockAccountService.getAccount(ACCOUNT_ID)).thenReturn(Optional.of(account));
ProcedureRequest procedure = new ProcedureRequest();
String json = FHIR_CONTEXT.newJsonParser().encodeResourceToString(procedure);
mockRequestBody(mockRequest, json);
controller.postProcedureRequest();
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project fhir-bridge by ehrbase.
the class FindProcedureTransactionIT method findProcedureSearch.
@Test
void findProcedureSearch() throws IOException {
for (int i = 0; i < 3; i++) {
create("Procedure/transactions/find-procedure-search.json");
}
Bundle bundle = search("Procedure?subject.identifier=" + PATIENT_ID + "&status=entered-in-error");
Assertions.assertEquals(3, bundle.getTotal());
bundle.getEntry().forEach(entry -> {
Procedure procedure = (Procedure) entry.getResource();
Assertions.assertEquals(PATIENT_ID, procedure.getSubject().getIdentifier().getValue());
Assertions.assertEquals(Procedure.ProcedureStatus.ENTEREDINERROR, procedure.getStatus());
});
}
use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE in project fhir-bridge by ehrbase.
the class FindProcedureTransactionIT method findProcedureRead.
@Test
void findProcedureRead() throws IOException {
MethodOutcome outcome = create("Procedure/transactions/provide-procedure-create.json");
IIdType id = outcome.getId();
Procedure procedure = read(id.getIdPart(), Procedure.class);
Assertions.assertNotNull(procedure);
Assertions.assertNotNull(procedure.getId(), id.getIdPart());
Assertions.assertEquals(PATIENT_ID, procedure.getSubject().getIdentifier().getValue());
}
Aggregations