Skip to content

Commit

Permalink
Remove tests as search by identifier will no longer work
Browse files Browse the repository at this point in the history
  • Loading branch information
VaishSiddharth committed Sep 25, 2024
1 parent fc0dfd5 commit 0dae571
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -620,59 +620,6 @@ public void searchForEncounters_shouldReturnEmptyListOfEncountersByMultipleSubje
assertThat(resultList, empty());
}

@Test
public void searchForEncounters_shouldSearchForEncountersByParticipantIdentifier() {
ReferenceAndListParam participantReference = new ReferenceAndListParam();
ReferenceParam participant = new ReferenceParam();

participant.setValue(PARTICIPANT_IDENTIFIER);
participant.setChain(Practitioner.SP_IDENTIFIER);

participantReference.addValue(new ReferenceOrListParam().add(participant));

SearchParameterMap theParams = new SearchParameterMap()
.addParameter(FhirConstants.PARTICIPANT_REFERENCE_SEARCH_HANDLER, participantReference);
IBundleProvider results = search(theParams);

List<IBaseResource> resultList = get(results);

assertThat(results, notNullValue());
assertThat(resultList, not(empty()));
assertThat(resultList, hasSize(greaterThanOrEqualTo(1)));
assertThat(
((Encounter) resultList.iterator().next()).getParticipantFirstRep().getIndividual().getIdentifier().getValue(),
equalTo(PARTICIPANT_IDENTIFIER));
}

@Test
public void searchForEncounters_shouldSearchForEncountersByMultipleParticipantIdentifierOr() {
ReferenceAndListParam participantReference = new ReferenceAndListParam();
ReferenceParam participant = new ReferenceParam();

participant.setValue(PARTICIPANT_IDENTIFIER);
participant.setChain(Practitioner.SP_IDENTIFIER);

ReferenceParam badParticipant = new ReferenceParam();

badParticipant.setValue(WRONG_IDENTIFIER);
badParticipant.setChain(Practitioner.SP_IDENTIFIER);

participantReference.addValue(new ReferenceOrListParam().add(participant).add(badParticipant));

SearchParameterMap theParams = new SearchParameterMap()
.addParameter(FhirConstants.PARTICIPANT_REFERENCE_SEARCH_HANDLER, participantReference);
IBundleProvider results = search(theParams);

List<IBaseResource> resultList = get(results);

assertThat(results, notNullValue());
assertThat(resultList, not(empty()));
assertThat(resultList, hasSize(greaterThanOrEqualTo(1)));
assertThat(
((Encounter) resultList.iterator().next()).getParticipantFirstRep().getIndividual().getIdentifier().getValue(),
equalTo(PARTICIPANT_IDENTIFIER));
}

@Test
public void searchForEncounters_shouldReturnEmptyListOfEncountersByMultipleParticipantIdentifierAnd() {
ReferenceAndListParam participantReference = new ReferenceAndListParam();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -825,34 +825,6 @@ public void searchForMedicationRequest_shouldReturnMedicationRequestByParticipan
assertThat(resultList, hasSize(equalTo(11)));
}

@Test
public void searchForMedicationRequests_shouldSearchForMedicationRequestsByMultipleParticipantIdentifierOr() {
ReferenceAndListParam participantReference = new ReferenceAndListParam();
ReferenceParam participant = new ReferenceParam();

participant.setValue(PARTICIPANT_IDENTIFIER);
participant.setChain(Practitioner.SP_IDENTIFIER);

ReferenceParam badParticipant = new ReferenceParam();

badParticipant.setValue(WRONG_IDENTIFIER);
badParticipant.setChain(Practitioner.SP_IDENTIFIER);

participantReference.addValue(new ReferenceOrListParam().add(participant).add(badParticipant));

SearchParameterMap theParams = new SearchParameterMap()
.addParameter(FhirConstants.PARTICIPANT_REFERENCE_SEARCH_HANDLER, participantReference);
IBundleProvider results = search(theParams);

assertThat(results, notNullValue());
List<MedicationRequest> resultList = get(results);

assertThat(resultList, not(empty()));
assertThat(resultList, hasSize(equalTo(11)));

assertThat(resultList.get(0).getRequester().getIdentifier().getValue(), equalTo(PARTICIPANT_IDENTIFIER));
}

@Test
public void searchForMedicationRequests_shouldReturnEmptyListOfMedicationRequestsByMultipleParticipantIdentifierAnd() {
ReferenceAndListParam participantReference = new ReferenceAndListParam();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -948,49 +948,6 @@ public void searchForServiceRequests_shouldReturnEmptyListOfServiceRequestsByMul
assertThat(resultList, empty());
}

@Test
public void searchForServiceRequests_shouldReturnServiceRequestsByParticipantIdentifier() {
ReferenceAndListParam participantReference = new ReferenceAndListParam().addAnd(new ReferenceOrListParam()
.add(new ReferenceParam().setValue(PARTICIPANT_IDENTIFIER).setChain(Practitioner.SP_IDENTIFIER)));

SearchParameterMap theParams = new SearchParameterMap()
.addParameter(FhirConstants.PARTICIPANT_REFERENCE_SEARCH_HANDLER, participantReference);

IBundleProvider results = search(theParams);

assertThat(results, notNullValue());
assertThat(results.size(), equalTo(4));

List<ServiceRequest> resources = get(results);

assertThat(resources, notNullValue());
assertThat(resources, hasSize(equalTo(4)));
assertThat(resources, everyItem(
hasProperty("requester", hasProperty("identifier", hasProperty("value", equalTo(PARTICIPANT_IDENTIFIER))))));
}

@Test
public void searchForServiceRequests_shouldSearchForServiceRequestsByMultipleParticipantIdentifierOr() {
ReferenceAndListParam participantReference = new ReferenceAndListParam().addAnd(new ReferenceOrListParam()
.add(new ReferenceParam().setValue(PARTICIPANT_IDENTIFIER).setChain(Practitioner.SP_IDENTIFIER))
.add(new ReferenceParam().setValue(PARTICIPANT_WRONG_IDENTIFIER).setChain(Practitioner.SP_IDENTIFIER)));

SearchParameterMap theParams = new SearchParameterMap()
.addParameter(FhirConstants.PARTICIPANT_REFERENCE_SEARCH_HANDLER, participantReference);

IBundleProvider results = search(theParams);

assertThat(results, notNullValue());
assertThat(results.size(), equalTo(4));

List<ServiceRequest> resources = get(results);

assertThat(resources, notNullValue());
assertThat(resources, hasSize(equalTo(4)));
assertThat(resources, everyItem(
hasProperty("requester", hasProperty("identifier", hasProperty("value", equalTo(PARTICIPANT_IDENTIFIER))))));
}

@Test
public void searchForServiceRequests_shouldReturnEmptyListOfServiceRequestsByMultipleParticipantIdentifierAnd() {
ReferenceAndListParam participantReference = new ReferenceAndListParam()
Expand Down

0 comments on commit 0dae571

Please sign in to comment.