Skip to content

Commit

Permalink
updates per review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Nov 22, 2024
1 parent f9d9235 commit 1b0d02f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
type: fix
issue: 6502
title: "Allow `_profile` to be used as a ReferenceParam as per the spec"
title: "Support ReferenceParam for `_profile` in queries using the SearchParameterMap."
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,19 @@ void repositoryTests(){
void _profileCanBeReferenceParam() {
// as per https://www.hl7.org/fhir/r4/search.html#all _profile is a reference param
var repository = new HapiFhirRepository(myDaoRegistry, setupRequestDetails(), myRestfulServer);
var profileToFind = "http://www.a-test-profile.com";
var encounterWithProfile = new Encounter();
encounterWithProfile.getMeta().addProfile(profileToFind);
repository.create(encounterWithProfile);
repository.create(new Encounter());
Map<String, List<IQueryParameterType>> map = new HashMap<>();
map.put("_profile", Collections.singletonList(new ReferenceParam("test")));
assertDoesNotThrow(() -> repository.search(Bundle.class, Encounter.class, map));
map.put("_profile", Collections.singletonList(new ReferenceParam(profileToFind)));
assertDoesNotThrow(() -> {
var returnBundle = repository.search(Bundle.class, Encounter.class, map);
assertTrue(returnBundle.hasEntry());
assertEquals(1,returnBundle.getEntry().size());
assertEquals(profileToFind, returnBundle.getEntryFirstRep().getResource().getMeta().getProfile().get(0).getValue());
});
}


Expand Down

0 comments on commit 1b0d02f

Please sign in to comment.