/// <summary> /// Conditionally add search parameter for the specified value to the parameter collection. /// </summary> /// <param name="searchParams">The search parameter collection to modify.</param> /// <param name="searchParam">Search parameter to add.</param> /// <param name="paramValue">The value of the parameter to add to the collection. If value is null no search parameter will be added.</param> /// <param name="searchPrefix">Optional prefix for value matching.</param> /// <returns>The modified search parameter collection.</returns> public static Hl7.Fhir.Rest.SearchParams WhenParamValue(this Hl7.Fhir.Rest.SearchParams searchParams, string searchParam, object paramValue, SearchPrefix searchPrefix = null) { if (searchParam == null) { throw new ArgumentNullException(nameof(searchParam)); } if (paramValue != null) { SearchPrefix prefix = searchPrefix ?? SearchPrefix.Empty; searchParams.Add(searchParam, $@"{searchPrefix}{paramValue}"); } return(searchParams); }
/// <summary> /// Conditionally add search parameter for the specified value to the parameter collection. /// </summary> /// <param name="searchParams">The search parameter collection to modify.</param> /// <param name="searchParam">Search parameter to add.</param> /// <param name="resourceRefValue">The resource reference add to the collection. If value is null no search parameter will be added.</param> /// <param name="searchPrefix">Optional prefix for value matching.</param> /// <returns>The modified search parameter collection.</returns> public static Hl7.Fhir.Rest.SearchParams WhenParamValue(this Hl7.Fhir.Rest.SearchParams searchParams, SearchParam searchParam, Hl7.Fhir.Model.ResourceReference resourceRefValue, SearchPrefix searchPrefix = null) { return(searchParams.WhenParamValue(searchParam?.ToString(), resourceRefValue, searchPrefix)); }
/// <summary> /// Conditionally add search parameter for the specified value to the parameter collection. /// </summary> /// <param name="searchParams">The search parameter collection to modify.</param> /// <param name="searchParam">Search parameter to add.</param> /// <param name="paramValue">The value of to add to the collection. If value is null no search parameter will be added.</param> /// <param name="searchPrefix">Optional prefix for value matching.</param> /// <returns>The modified search parameter collection.</returns> public static Hl7.Fhir.Rest.SearchParams WhenParamValue(this Hl7.Fhir.Rest.SearchParams searchParams, SearchParam searchParam, object paramValue, SearchPrefix searchPrefix = null) { return(searchParams.WhenParamValue(searchParam?.ToString(), paramValue, searchPrefix)); }