Skip to content

Commit

Permalink
Merge pull request #2987 from FirelyTeam/6.0/2531-migrate-searchparam…
Browse files Browse the repository at this point in the history
…-definition-to-base

Moved SearchParamDefinition from STU3+ to a separate class in Base.
  • Loading branch information
mmsmits authored Dec 9, 2024
2 parents 5e8f100 + 7ea74ab commit c684103
Show file tree
Hide file tree
Showing 23 changed files with 8,184 additions and 8,106 deletions.
1,292 changes: 1,292 additions & 0 deletions src/Hl7.Fhir.Base/Model/Generated/Template-Bindings.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Hl7.Fhir.Base/Model/Generated/_GeneratorLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
// Used in model class (resource): Subscription.filterBy.modifier
// Used in model class (resource): SubscriptionTopic.canFilterBy.modifier

// Deferred generation of Shared Enumeration (will be generated in another subset): SearchParamType (http://hl7.org/fhir/ValueSet/search-param-type)
// Generated Shared Enumeration: SearchParamType (http://hl7.org/fhir/ValueSet/search-param-type)
// Used in model class (resource): CapabilityStatement.rest.resource.searchParam.type
// Used in model class (resource): OperationDefinition.parameter.searchType
// Used in model class (resource): SearchParameter.type
Expand All @@ -298,7 +298,7 @@
// Used in model class (resource): Evidence.statistic.modelCharacteristic.variable.handling
// Used in model class (resource): EvidenceVariable.handling

// Deferred generation of Shared Enumeration (will be generated in another subset): VersionIndependentResourceTypesAll (http://hl7.org/fhir/ValueSet/version-independent-all-resource-types)
// Generated Shared Enumeration: VersionIndependentResourceTypesAll (http://hl7.org/fhir/ValueSet/version-independent-all-resource-types)
// Used in model class (resource): GraphDefinition.node.type
// Used in model class (resource): OperationDefinition.resource
// Used in model class (resource): SearchParameter.base
Expand Down
92 changes: 92 additions & 0 deletions src/Hl7.Fhir.Base/Model/SearchParamDefinition.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
Copyright (c) 2011-2012, HL7, Inc
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

#nullable enable

using System;
using System.Diagnostics;
using System.Security.AccessControl;

namespace Hl7.Fhir.Model;


[DebuggerDisplay(@"\{{DebuggerDisplay,nq}}")] // http://blogs.msdn.com/b/jaredpar/archive/2011/03/18/debuggerdisplay-attribute-best-practices.aspx
public class SearchParamDefinition
{
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay
{
get => $"{Resource} {Name} {Type} ({Expression})";
}

public string? Resource { get; set; }
public string? Name { get; set; }
public string? Code { get; set; }
public string? Url { get; set; }
public Markdown? Description { get; set; }
public SearchParamType Type { get; set; }

/// <summary>
/// If this search parameter is a Composite, this array contains
/// the list of search parameters the param is a combination of <seealso cref="Component"/>
/// </summary>
[Obsolete("Use the property Component instead. " +
"Obsolete since 2023-05-16. Will be removed in the next major release.")]
public string[]? CompositeParams { get; set; }

/// <summary>
/// One or more paths into the Resource instance that the search parameter
/// uses
/// </summary>
public string[]? Path { get; set; }

/// <summary>
/// The XPath expression for evaluating this search parameter
/// </summary>
public string? XPath { get; set; }

/// <summary>
/// The FHIR Path expresssion that can be used to extract the data
/// for this search parameter
/// </summary>
public string? Expression { get; set; }

/// <summary>
/// If this is a reference, the possible types of resources that the
/// parameters references to
/// </summary>
public VersionIndependentResourceTypesAll[]? Target { get; set; }

/// <summary>
/// Used to define the parts of a composite search parameter.
/// </summary>
public SearchParamComponent[]? Component { get; set; }
}

public readonly record struct SearchParamComponent(string Definition, string Expression);
7 changes: 7 additions & 0 deletions src/Hl7.Fhir.Conformance/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Hl7.Fhir.Model.SearchParamType</Target>
<Left>lib/net8.0/Hl7.Fhir.Conformance.dll</Left>
<Right>lib/net8.0/Hl7.Fhir.Conformance.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Hl7.Fhir.Specification.Snapshot.SnapshotGeneratorExtensions</Target>
Expand Down
64 changes: 0 additions & 64 deletions src/Hl7.Fhir.Conformance/Model/Generated/Template-Bindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,69 +158,5 @@ public enum ConstraintSeverity
Warning,
}

/// <summary>
/// Data types allowed to be used for search parameters.
/// (url: http://hl7.org/fhir/ValueSet/search-param-type)
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[FhirEnumeration("SearchParamType", "http://hl7.org/fhir/ValueSet/search-param-type", "http://hl7.org/fhir/search-param-type")]
public enum SearchParamType
{
/// <summary>
/// Search parameter SHALL be a number (a whole number, or a decimal).
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[EnumLiteral("number"), Description("Number")]
Number,
/// <summary>
/// Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported.
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[EnumLiteral("date"), Description("Date/DateTime")]
Date,
/// <summary>
/// Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces.
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[EnumLiteral("string"), Description("String")]
String,
/// <summary>
/// Search parameter on a coded element or identifier. May be used to search through the text, display, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a \"|\", depending on the modifier used.
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[EnumLiteral("token"), Description("Token")]
Token,
/// <summary>
/// A reference to another resource (Reference or canonical).
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[EnumLiteral("reference"), Description("Reference")]
Reference,
/// <summary>
/// A composite search parameter that combines a search on two values together.
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[EnumLiteral("composite"), Description("Composite")]
Composite,
/// <summary>
/// A search parameter that searches on a quantity.
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[EnumLiteral("quantity"), Description("Quantity")]
Quantity,
/// <summary>
/// A search parameter that searches on a URI (RFC 3986).
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[EnumLiteral("uri"), Description("URI")]
Uri,
/// <summary>
/// Special logic applies to this parameter per the description of the search parameter.
/// (system: http://hl7.org/fhir/search-param-type)
/// </summary>
[EnumLiteral("special"), Description("Special")]
Special,
}

}

2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Conformance/Model/Generated/_GeneratorLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
// Used in model class (resource): Subscription.filterBy.modifier
// Used in model class (resource): SubscriptionTopic.canFilterBy.modifier

// Generated Shared Enumeration: SearchParamType (http://hl7.org/fhir/ValueSet/search-param-type)
// Deferred generation of Shared Enumeration (will be generated in another subset): SearchParamType (http://hl7.org/fhir/ValueSet/search-param-type)
// Used in model class (resource): CapabilityStatement.rest.resource.searchParam.type
// Used in model class (resource): OperationDefinition.parameter.searchType
// Used in model class (resource): SearchParameter.type
Expand Down
21 changes: 21 additions & 0 deletions src/Hl7.Fhir.R4/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Hl7.Fhir.Model.ModelInfo.SearchParamComponent</Target>
<Left>lib/net8.0/Hl7.Fhir.R4.dll</Left>
<Right>lib/net8.0/Hl7.Fhir.R4.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Hl7.Fhir.Model.ModelInfo.SearchParamDefinition</Target>
<Left>lib/net8.0/Hl7.Fhir.R4.dll</Left>
<Right>lib/net8.0/Hl7.Fhir.R4.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:Hl7.Fhir.Model.ModelInfo.SearchParameters</Target>
<Left>lib/net8.0/Hl7.Fhir.R4.dll</Left>
<Right>lib/net8.0/Hl7.Fhir.R4.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:Hl7.Fhir.Model.Questionnaire.QuestionnaireItemType.Question</Target>
Expand Down
Loading

0 comments on commit c684103

Please sign in to comment.