From 048c1f99bb7f3abbad13e5f821415a3e4561dc6c Mon Sep 17 00:00:00 2001 From: jmarchionatto <60409882+jmarchionatto@users.noreply.github.com> Date: Thu, 15 Jun 2023 10:03:45 -0400 Subject: [PATCH] issue-4987-searchbundle-parts-are-labeled-by-default-as-include-instead-of-match (#4988) * Default search mode to MATCH when creating SearchBundleEntryParts * Add changelog * Use enum name instead of explicit constant --------- Co-authored-by: juan.marchionatto --- .../ca/uhn/fhir/util/bundle/SearchBundleEntryParts.java | 6 +++--- ...-are-labeled-by-default-as-include-instead-of-match.yaml | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_8_0/4987-searchbundle-parts-are-labeled-by-default-as-include-instead-of-match.yaml diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/bundle/SearchBundleEntryParts.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/bundle/SearchBundleEntryParts.java index e8f97336610..70eb0b63f69 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/bundle/SearchBundleEntryParts.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/bundle/SearchBundleEntryParts.java @@ -30,10 +30,10 @@ public class SearchBundleEntryParts { public SearchBundleEntryParts(String theFullUrl, IBaseResource theResource, String theSearchMode) { myFullUrl = theFullUrl; myResource = theResource; - if ("match".equalsIgnoreCase(theSearchMode)) { - mySearchMode = BundleEntrySearchModeEnum.MATCH; - } else { + if (BundleEntrySearchModeEnum.INCLUDE.getCode().equalsIgnoreCase(theSearchMode)) { mySearchMode = BundleEntrySearchModeEnum.INCLUDE; + } else { + mySearchMode = BundleEntrySearchModeEnum.MATCH; } } diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_8_0/4987-searchbundle-parts-are-labeled-by-default-as-include-instead-of-match.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_8_0/4987-searchbundle-parts-are-labeled-by-default-as-include-instead-of-match.yaml new file mode 100644 index 00000000000..9fd9b211760 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_8_0/4987-searchbundle-parts-are-labeled-by-default-as-include-instead-of-match.yaml @@ -0,0 +1,5 @@ +--- +type: fix +issue: 4987 +title: "Search bundle entry parts were being created as `INCLUDE` unless explicitly indicated as `MATCH`. + This has been fixed. Now they are created as `MATCH` unless explicitly indicated as `INCLUDE`."