diff --git a/.editorconfig b/.editorconfig index 499513576f9..f19de7e2a01 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,12 +5,7 @@ end_of_line = lf insert_final_newline = true tab_width = 3 indent_size = 3 - -[*.java] charset = utf-8 -indent_style = tab -tab_width = 3 -indent_size = 3 [*.xml] charset = utf-8 @@ -30,3 +25,259 @@ indent_style = tab tab_width = 3 indent_size = 3 + +[*.java] +charset = utf-8 +indent_style = tab +tab_width = 3 +indent_size = 3 +ij_java_align_consecutive_assignments = false +ij_java_align_consecutive_variable_declarations = false +ij_java_align_group_field_declarations = false +ij_java_align_multiline_annotation_parameters = false +ij_java_align_multiline_array_initializer_expression = false +ij_java_align_multiline_assignment = false +ij_java_align_multiline_binary_operation = false +ij_java_align_multiline_chained_methods = false +ij_java_align_multiline_extends_list = false +ij_java_align_multiline_for = true +ij_java_align_multiline_method_parentheses = false +ij_java_align_multiline_parameters = true +ij_java_align_multiline_parameters_in_calls = false +ij_java_align_multiline_parenthesized_expression = false +ij_java_align_multiline_records = true +ij_java_align_multiline_resources = true +ij_java_align_multiline_ternary_operation = false +ij_java_align_multiline_text_blocks = false +ij_java_align_multiline_throws_list = false +ij_java_align_subsequent_simple_methods = false +ij_java_align_throws_keyword = false +ij_java_annotation_parameter_wrap = off +ij_java_array_initializer_new_line_after_left_brace = false +ij_java_array_initializer_right_brace_on_new_line = false +ij_java_array_initializer_wrap = off +ij_java_assert_statement_colon_on_next_line = false +ij_java_assert_statement_wrap = off +ij_java_assignment_wrap = off +ij_java_binary_operation_sign_on_next_line = false +ij_java_binary_operation_wrap = off +ij_java_blank_lines_after_anonymous_class_header = 0 +ij_java_blank_lines_after_class_header = 0 +ij_java_blank_lines_after_imports = 1 +ij_java_blank_lines_after_package = 1 +ij_java_blank_lines_around_class = 1 +ij_java_blank_lines_around_field = 0 +ij_java_blank_lines_around_field_in_interface = 0 +ij_java_blank_lines_around_initializer = 1 +ij_java_blank_lines_around_method = 1 +ij_java_blank_lines_around_method_in_interface = 1 +ij_java_blank_lines_before_class_end = 0 +ij_java_blank_lines_before_imports = 1 +ij_java_blank_lines_before_method_body = 0 +ij_java_blank_lines_before_package = 0 +ij_java_block_brace_style = end_of_line +ij_java_block_comment_at_first_column = true +ij_java_call_parameters_new_line_after_left_paren = false +ij_java_call_parameters_right_paren_on_new_line = false +ij_java_call_parameters_wrap = off +ij_java_case_statement_on_separate_line = true +ij_java_catch_on_new_line = false +ij_java_class_annotation_wrap = split_into_lines +ij_java_class_brace_style = end_of_line +ij_java_class_count_to_use_import_on_demand = 999 +ij_java_class_names_in_javadoc = 1 +ij_java_do_not_indent_top_level_class_members = false +ij_java_do_not_wrap_after_single_annotation = false +ij_java_do_while_brace_force = never +ij_java_doc_add_blank_line_after_description = true +ij_java_doc_add_blank_line_after_param_comments = false +ij_java_doc_add_blank_line_after_return = false +ij_java_doc_add_p_tag_on_empty_lines = true +ij_java_doc_align_exception_comments = true +ij_java_doc_align_param_comments = true +ij_java_doc_do_not_wrap_if_one_line = false +ij_java_doc_enable_formatting = true +ij_java_doc_enable_leading_asterisks = true +ij_java_doc_indent_on_continuation = false +ij_java_doc_keep_empty_lines = true +ij_java_doc_keep_empty_parameter_tag = true +ij_java_doc_keep_empty_return_tag = true +ij_java_doc_keep_empty_throws_tag = true +ij_java_doc_keep_invalid_tags = true +ij_java_doc_param_description_on_new_line = false +ij_java_doc_preserve_line_breaks = false +ij_java_doc_use_throws_not_exception_tag = true +ij_java_else_on_new_line = false +ij_java_entity_dd_suffix = EJB +ij_java_entity_eb_suffix = Bean +ij_java_entity_hi_suffix = Home +ij_java_entity_lhi_prefix = Local +ij_java_entity_lhi_suffix = Home +ij_java_entity_li_prefix = Local +ij_java_entity_pk_class = java.lang.String +ij_java_entity_vo_suffix = VO +ij_java_enum_constants_wrap = off +ij_java_extends_keyword_wrap = off +ij_java_extends_list_wrap = off +ij_java_field_annotation_wrap = split_into_lines +ij_java_field_name_prefix = my +ij_java_finally_on_new_line = false +ij_java_for_brace_force = never +ij_java_for_statement_new_line_after_left_paren = false +ij_java_for_statement_right_paren_on_new_line = false +ij_java_for_statement_wrap = off +ij_java_generate_final_locals = false +ij_java_generate_final_parameters = false +ij_java_if_brace_force = never +ij_java_imports_layout = *,|,javax.**,java.**,|,$* +ij_java_indent_case_from_switch = true +ij_java_insert_inner_class_imports = false +ij_java_insert_override_annotation = true +ij_java_keep_blank_lines_before_right_brace = 2 +ij_java_keep_blank_lines_between_package_declaration_and_header = 2 +ij_java_keep_blank_lines_in_code = 2 +ij_java_keep_blank_lines_in_declarations = 2 +ij_java_keep_control_statement_in_one_line = true +ij_java_keep_first_column_comment = true +ij_java_keep_indents_on_empty_lines = false +ij_java_keep_line_breaks = true +ij_java_keep_multiple_expressions_in_one_line = false +ij_java_keep_simple_blocks_in_one_line = false +ij_java_keep_simple_classes_in_one_line = false +ij_java_keep_simple_lambdas_in_one_line = false +ij_java_keep_simple_methods_in_one_line = false +ij_java_label_indent_absolute = false +ij_java_label_indent_size = 0 +ij_java_lambda_brace_style = end_of_line +ij_java_layout_static_imports_separately = true +ij_java_line_comment_add_space = false +ij_java_line_comment_at_first_column = true +ij_java_message_dd_suffix = EJB +ij_java_message_eb_suffix = Bean +ij_java_method_annotation_wrap = split_into_lines +ij_java_method_brace_style = end_of_line +ij_java_method_call_chain_wrap = off +ij_java_method_parameters_new_line_after_left_paren = false +ij_java_method_parameters_right_paren_on_new_line = false +ij_java_method_parameters_wrap = off +ij_java_modifier_list_wrap = false +ij_java_names_count_to_use_import_on_demand = 999 +ij_java_new_line_after_lparen_in_record_header = false +ij_java_packages_to_use_import_on_demand = java.awt.*,javax.swing.* +ij_java_parameter_annotation_wrap = off +ij_java_parameter_name_prefix = the +ij_java_parentheses_expression_new_line_after_left_paren = false +ij_java_parentheses_expression_right_paren_on_new_line = false +ij_java_place_assignment_sign_on_next_line = false +ij_java_prefer_longer_names = true +ij_java_prefer_parameters_wrap = false +ij_java_record_components_wrap = normal +ij_java_repeat_synchronized = true +ij_java_replace_instanceof_and_cast = false +ij_java_replace_null_check = true +ij_java_replace_sum_lambda_with_method_ref = true +ij_java_resource_list_new_line_after_left_paren = false +ij_java_resource_list_right_paren_on_new_line = false +ij_java_resource_list_wrap = off +ij_java_rparen_on_new_line_in_record_header = false +ij_java_session_dd_suffix = EJB +ij_java_session_eb_suffix = Bean +ij_java_session_hi_suffix = Home +ij_java_session_lhi_prefix = Local +ij_java_session_lhi_suffix = Home +ij_java_session_li_prefix = Local +ij_java_session_si_suffix = Service +ij_java_space_after_closing_angle_bracket_in_type_argument = false +ij_java_space_after_colon = true +ij_java_space_after_comma = true +ij_java_space_after_comma_in_type_arguments = true +ij_java_space_after_for_semicolon = true +ij_java_space_after_quest = true +ij_java_space_after_type_cast = true +ij_java_space_before_annotation_array_initializer_left_brace = false +ij_java_space_before_annotation_parameter_list = false +ij_java_space_before_array_initializer_left_brace = false +ij_java_space_before_catch_keyword = true +ij_java_space_before_catch_left_brace = true +ij_java_space_before_catch_parentheses = true +ij_java_space_before_class_left_brace = true +ij_java_space_before_colon = true +ij_java_space_before_colon_in_foreach = true +ij_java_space_before_comma = false +ij_java_space_before_do_left_brace = true +ij_java_space_before_else_keyword = true +ij_java_space_before_else_left_brace = true +ij_java_space_before_finally_keyword = true +ij_java_space_before_finally_left_brace = true +ij_java_space_before_for_left_brace = true +ij_java_space_before_for_parentheses = true +ij_java_space_before_for_semicolon = false +ij_java_space_before_if_left_brace = true +ij_java_space_before_if_parentheses = true +ij_java_space_before_method_call_parentheses = false +ij_java_space_before_method_left_brace = true +ij_java_space_before_method_parentheses = false +ij_java_space_before_opening_angle_bracket_in_type_parameter = false +ij_java_space_before_quest = true +ij_java_space_before_switch_left_brace = true +ij_java_space_before_switch_parentheses = true +ij_java_space_before_synchronized_left_brace = true +ij_java_space_before_synchronized_parentheses = true +ij_java_space_before_try_left_brace = true +ij_java_space_before_try_parentheses = true +ij_java_space_before_type_parameter_list = false +ij_java_space_before_while_keyword = true +ij_java_space_before_while_left_brace = true +ij_java_space_before_while_parentheses = true +ij_java_space_inside_one_line_enum_braces = false +ij_java_space_within_empty_array_initializer_braces = false +ij_java_space_within_empty_method_call_parentheses = false +ij_java_space_within_empty_method_parentheses = false +ij_java_spaces_around_additive_operators = true +ij_java_spaces_around_assignment_operators = true +ij_java_spaces_around_bitwise_operators = true +ij_java_spaces_around_equality_operators = true +ij_java_spaces_around_lambda_arrow = true +ij_java_spaces_around_logical_operators = true +ij_java_spaces_around_method_ref_dbl_colon = false +ij_java_spaces_around_multiplicative_operators = true +ij_java_spaces_around_relational_operators = true +ij_java_spaces_around_shift_operators = true +ij_java_spaces_around_type_bounds_in_type_parameters = true +ij_java_spaces_around_unary_operator = false +ij_java_spaces_within_angle_brackets = false +ij_java_spaces_within_annotation_parentheses = false +ij_java_spaces_within_array_initializer_braces = false +ij_java_spaces_within_braces = false +ij_java_spaces_within_brackets = false +ij_java_spaces_within_cast_parentheses = false +ij_java_spaces_within_catch_parentheses = false +ij_java_spaces_within_for_parentheses = false +ij_java_spaces_within_if_parentheses = false +ij_java_spaces_within_method_call_parentheses = false +ij_java_spaces_within_method_parentheses = false +ij_java_spaces_within_parentheses = false +ij_java_spaces_within_switch_parentheses = false +ij_java_spaces_within_synchronized_parentheses = false +ij_java_spaces_within_try_parentheses = false +ij_java_spaces_within_while_parentheses = false +ij_java_special_else_if_treatment = true +ij_java_static_field_name_prefix = our +ij_java_subclass_name_suffix = Impl +ij_java_ternary_operation_signs_on_next_line = false +ij_java_ternary_operation_wrap = off +ij_java_test_name_suffix = Test +ij_java_throws_keyword_wrap = off +ij_java_throws_list_wrap = off +ij_java_use_external_annotations = false +ij_java_use_fq_class_names = false +ij_java_use_relative_indents = false +ij_java_use_single_class_imports = true +ij_java_variable_annotation_wrap = off +ij_java_visibility = public +ij_java_while_brace_force = never +ij_java_while_on_new_line = false +ij_java_wrap_comments = false +ij_java_wrap_first_method_in_call_chain = false +ij_java_wrap_long_lines = false + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java index aa5b7b08d6f..f8a1330a3c8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/api/Pointcut.java @@ -425,7 +425,7 @@ public enum Pointcut { "java.io.Writer", "ca.uhn.fhir.rest.api.server.RequestDetails", "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" - ), + ), /** @@ -1401,7 +1401,7 @@ public enum Pointcut { * * *
- * Hooks should return an instance of ca.uhn.fhir.jpa.api.model.RequestPartitionId
or null
.
+ * Hooks must return an instance of ca.uhn.fhir.interceptor.model.RequestPartitionId
.
*
- * Hooks should return an instance of ca.uhn.fhir.jpa.api.model.RequestPartitionId
or null
.
+ * Hooks must return an instance of ca.uhn.fhir.interceptor.model.RequestPartitionId
.
*
+ * This hook will only be called if + * partitioning is enabled in the JPA server. + *
+ *+ * Hooks may accept the following parameters: + *
+ *+ * Hooks must return void. + *
+ */ + STORAGE_PARTITION_SELECTED( + // Return type + void.class, + // Params + "ca.uhn.fhir.interceptor.model.RequestPartitionId", + "ca.uhn.fhir.rest.api.server.RequestDetails", + "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" + ), + /** * Performance Tracing Hook: * This hook is invoked when any informational messages generated by the diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java index c1d0f8291c1..d66e74208d5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/model/RequestPartitionId.java @@ -20,27 +20,55 @@ package ca.uhn.fhir.interceptor.model; * #L% */ +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.time.LocalDate; -import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; - +/** + * @since 5.0.0 + */ public class RequestPartitionId { - private final Integer myPartitionId; + private static final RequestPartitionId ALL_PARTITIONS = new RequestPartitionId(); private final LocalDate myPartitionDate; + private final boolean myAllPartitions; + private final Integer myPartitionId; private final String myPartitionName; /** - * Constructor + * Constructor for a single partition */ private RequestPartitionId(@Nullable String thePartitionName, @Nullable Integer thePartitionId, @Nullable LocalDate thePartitionDate) { - myPartitionName = thePartitionName; myPartitionId = thePartitionId; + myPartitionName = thePartitionName; myPartitionDate = thePartitionDate; + myAllPartitions = false; } + /** + * Constructor for all partitions + */ + private RequestPartitionId() { + super(); + myPartitionDate = null; + myPartitionName = null; + myPartitionId = null; + myAllPartitions = true; + } + + public boolean isAllPartitions() { + return myAllPartitions; + } + + @Nullable + public LocalDate getPartitionDate() { + return myPartitionDate; + } + + @Nullable public String getPartitionName() { return myPartitionName; } @@ -50,32 +78,59 @@ public class RequestPartitionId { return myPartitionId; } - @Nullable - public LocalDate getPartitionDate() { - return myPartitionDate; - } - @Override public String toString() { - return getPartitionIdStringOrNullString(); + return "RequestPartitionId[id=" + getPartitionId() + ", name=" + getPartitionName() + "]"; } /** * Returns the partition ID (numeric) as a string, or the string "null" */ public String getPartitionIdStringOrNullString() { - return defaultIfNull(myPartitionId, "null").toString(); + if (myPartitionId == null) { + return "null"; + } + return myPartitionId.toString(); } - /** - * Create a string representation suitable for use as a cache key. Null aware. - */ - public static String stringifyForKey(RequestPartitionId theRequestPartitionId) { - String retVal = "(null)"; - if (theRequestPartitionId != null) { - retVal = theRequestPartitionId.getPartitionIdStringOrNullString(); + @Override + public boolean equals(Object theO) { + if (this == theO) { + return true; } - return retVal; + + if (theO == null || getClass() != theO.getClass()) { + return false; + } + + RequestPartitionId that = (RequestPartitionId) theO; + + return new EqualsBuilder() + .append(myAllPartitions, that.myAllPartitions) + .append(myPartitionDate, that.myPartitionDate) + .append(myPartitionId, that.myPartitionId) + .append(myPartitionName, that.myPartitionName) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37) + .append(myPartitionDate) + .append(myAllPartitions) + .append(myPartitionId) + .append(myPartitionName) + .toHashCode(); + } + + @Nonnull + public static RequestPartitionId allPartitions() { + return ALL_PARTITIONS; + } + + @Nonnull + public static RequestPartitionId defaultPartition() { + return fromPartitionId(null); } @Nonnull @@ -99,8 +154,23 @@ public class RequestPartitionId { } @Nonnull - public static RequestPartitionId forPartitionNameAndId(@Nullable String thePartitionName, @Nullable Integer thePartitionId, @Nullable LocalDate thePartitionDate) { + public static RequestPartitionId fromPartitionIdAndName(@Nullable Integer thePartitionId, @Nullable String thePartitionName) { + return new RequestPartitionId(thePartitionName, thePartitionId, null); + } + + @Nonnull + public static RequestPartitionId forPartitionIdAndName(@Nullable Integer thePartitionId, @Nullable String thePartitionName, @Nullable LocalDate thePartitionDate) { return new RequestPartitionId(thePartitionName, thePartitionId, thePartitionDate); } + /** + * Create a string representation suitable for use as a cache key. Null aware. + */ + public static String stringifyForKey(RequestPartitionId theRequestPartitionId) { + String retVal = "(null)"; + if (theRequestPartitionId != null) { + retVal = theRequestPartitionId.getPartitionIdStringOrNullString(); + } + return retVal; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java index 9628034b3f9..b8d66cac6ce 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/Constants.java @@ -264,6 +264,13 @@ public class Constants { public static final String PARAM_FHIRPATH = "_fhirpath"; public static final String PARAM_TYPE = "_type"; + /** + * {@link org.hl7.fhir.instance.model.api.IBaseResource#getUserData(String) User metadata key} used + * to store the partition ID (if any) associated with the given resource. Value for this + * key will be of type {@link ca.uhn.fhir.interceptor.model.RequestPartitionId}. + */ + public static final String RESOURCE_PARTITION_ID = Constants.class.getName() + "_RESOURCE_PARTITION_ID"; + static { CHARSET_UTF8 = StandardCharsets.UTF_8; CHARSET_US_ASCII = StandardCharsets.ISO_8859_1; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/BaseHttpRequest.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/BaseHttpRequest.java new file mode 100644 index 00000000000..2ced28af0fe --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/BaseHttpRequest.java @@ -0,0 +1,37 @@ +package ca.uhn.fhir.rest.client.api; + +/*- + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 - 2020 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +public abstract class BaseHttpRequest implements IHttpRequest { + + private UrlSourceEnum myUrlSource; + + @Override + public UrlSourceEnum getUrlSource() { + return myUrlSource; + } + + @Override + public void setUrlSource(UrlSourceEnum theUrlSource) { + myUrlSource = theUrlSource; + } + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IHttpRequest.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IHttpRequest.java index 62389f6c5b3..a2c7445849f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IHttpRequest.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IHttpRequest.java @@ -60,11 +60,15 @@ public interface IHttpRequest { /** * Return the request URI, or null + * + * @see #getUri() */ String getUri(); /** * Modify the request URI, or null + * + * @see #setUrlSource(UrlSourceEnum) */ void setUri(String theUrl); @@ -79,4 +83,19 @@ public interface IHttpRequest { * @param theHeaderName The header name, e.g. "Accept" (must not be null or blank) */ void removeHeaders(String theHeaderName); + + /** + * Where was the URL from? + * + * @since 5.0.0 + */ + UrlSourceEnum getUrlSource(); + + /** + * Where was the URL from? + * + * @since 5.0.0 + */ + void setUrlSource(UrlSourceEnum theUrlSource); + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/UrlSourceEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/UrlSourceEnum.java new file mode 100644 index 00000000000..26230194c0a --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/UrlSourceEnum.java @@ -0,0 +1,35 @@ +package ca.uhn.fhir.rest.client.api; + +/*- + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 - 2020 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +public enum UrlSourceEnum { + + /** + * URL was generated (typically by adding the base URL + other things) + */ + GENERATED, + + /** + * URL was supplied (i.e. it came from a paging link in a bundle) + */ + EXPLICIT + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java index 609a49ebd06..89cb4343942 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java @@ -9,9 +9,16 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.util.DateUtils; import org.hl7.fhir.instance.model.api.IPrimitiveType; -import java.util.*; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.TimeZone; -import static ca.uhn.fhir.rest.param.ParamPrefixEnum.*; +import static ca.uhn.fhir.rest.param.ParamPrefixEnum.EQUAL; +import static ca.uhn.fhir.rest.param.ParamPrefixEnum.GREATERTHAN_OR_EQUALS; +import static ca.uhn.fhir.rest.param.ParamPrefixEnum.LESSTHAN_OR_EQUALS; import static java.lang.String.format; import static org.apache.commons.lang3.StringUtils.isNotBlank; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateUtils.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateUtils.java index d208e3fe599..58b83b7b630 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateUtils.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateUtils.java @@ -23,7 +23,12 @@ package ca.uhn.fhir.util; import java.lang.ref.SoftReference; import java.text.ParsePosition; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.TimeZone; /** * A utility class for parsing and formatting HTTP dates as used in cookies and diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/MetaUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/MetaUtil.java index cd6c9384906..775c274e929 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/MetaUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/MetaUtil.java @@ -96,7 +96,7 @@ public class MetaUtil { value.setValue(theValue); sourceExtension.setValue(value); } else { - ourLog.error(MetaUtil.class.getSimpleName() + ".setSource() not supported on FHIR Version " + theContext.getVersion().getVersion()); + ourLog.debug(MetaUtil.class.getSimpleName() + ".setSource() not supported on FHIR Version " + theContext.getVersion().getVersion()); } } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IPrimitiveType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IPrimitiveType.java index 089aba760e7..8a782d961ec 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IPrimitiveType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IPrimitiveType.java @@ -22,16 +22,26 @@ package org.hl7.fhir.instance.model.api; */ -public interface IPrimitiveTypeName | -Type | -Cardinality | -Description | -
---|---|---|---|
id | -Integer | -1..1 | -- The numeric ID for the partition. This value can be any integer, positive or negative or zero. It must not be a value that has already been used. - | -
name | -Code | -1..1 | -- A code (string) to assign to the partition. - | -
description | -String | -0..1 | -- An optional description for the partition. - | -
Name | -Type | -Cardinality | -Description | -
---|---|---|---|
id | -Integer | -1..1 | -- The numeric ID for the partition to update. This ID must already exist. - | -
name | -Code | -1..1 | -- A code (string) to assign to the partition. Note that it is acceptable to change the name of a partition, but this should be done with caution since partition names may be referenced by URLs, caches, etc. - | -
description | -String | -0..1 | -- An optional description for the partition. - | -
Name | -Type | -Cardinality | -Description | -
---|---|---|---|
id | -Integer | -1..1 | -- The numeric ID for the partition to update. This ID must already exist. - | -
Name | +Type | +Cardinality | +Description | +
---|---|---|---|
id | +Integer | +1..1 | ++ The numeric ID for the partition. This value can be any integer, positive or negative or zero. It must not be a value that has already been used. + | +
name | +Code | +1..1 | ++ A code (string) to assign to the partition. + | +
description | +String | +0..1 | ++ An optional description for the partition. + | +
Name | +Type | +Cardinality | +Description | +
---|---|---|---|
id | +Integer | +1..1 | ++ The numeric ID for the partition to update. This ID must already exist. + | +
name | +Code | +1..1 | ++ A code (string) to assign to the partition. Note that it is acceptable to change the name of a partition, but this should be done with caution since partition names may be referenced by URLs, caches, etc. + | +
description | +String | +0..1 | ++ An optional description for the partition. + | +
Name | +Type | +Cardinality | +Description | +
---|---|---|---|
id | +Integer | +1..1 | ++ The numeric ID for the partition to update. This ID must already exist. + | +
* This method returns a Collection where each row is an element in the collection. Each element in the collection
* is an object array, where the order matters (the array represents columns returned by the query). Be careful if you change this query in any way.
*/
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IResourceHistoryTableDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IResourceHistoryTableDao.java
index 2366c7d9eaa..63d1779ae2d 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IResourceHistoryTableDao.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IResourceHistoryTableDao.java
@@ -6,13 +6,8 @@ import org.springframework.data.domain.Slice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.jpa.repository.Temporal;
import org.springframework.data.repository.query.Param;
-import javax.persistence.TemporalType;
-import java.util.Collection;
-import java.util.Date;
-
/*
* #%L
* HAPI FHIR JPA Server
@@ -35,36 +30,6 @@ import java.util.Date;
public interface IResourceHistoryTableDao extends JpaRepository