Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
391228e
Merge pull request #41 from FirelyTeam/remove-unused-files
mmsmits Oct 2, 2024
e905111
Merge branch 'microsoft:main' into main
ewoutkramer Oct 14, 2024
da95bf5
Added support for IDictionary (SetValue)
ewoutkramer Oct 16, 2024
866e8d6
Merge pull request #42 from FirelyTeam/2901-add-SetValue
ewoutkramer Oct 18, 2024
89786fb
Removed generation of nested/resource args to fhirtype.
ewoutkramer Oct 18, 2024
df9dd96
Removed BackboneTypeAttribute.
ewoutkramer Oct 18, 2024
0a53318
Merge pull request #43 from FirelyTeam/2930-remove-isnested-type
Kasdejong Oct 23, 2024
02cb7c1
fix: attachment.url type
mmsmits Oct 25, 2024
bf806e3
Merge pull request #44 from FirelyTeam/fix/fix-attachment-url-datatype
mmsmits Oct 28, 2024
ec6e22c
Merge branch 'main' into dev
ewoutkramer Nov 18, 2024
1aa4f03
Tried replacing Element.id, Extension.url with FHIR datatype instead …
ewoutkramer Nov 19, 2024
83e5cd4
Stop generating Children/NamedChildren.
ewoutkramer Nov 19, 2024
0293f53
Working on improving doccomments given details about changed types.
ewoutkramer Nov 20, 2024
80b621b
Merge pull request #45 from FirelyTeam/6.0/2973-remove-children-named…
ewoutkramer Nov 20, 2024
d6f4f2f
Merge branch 'dev' into 2967-better-reflect-shared-properties
ewoutkramer Nov 20, 2024
1198ba8
WIP
ewoutkramer Nov 25, 2024
114dd3f
Merge branch 'dev' into spike/primitiveprops-as-element
ewoutkramer Nov 25, 2024
234a1b0
Some cosmetics
ewoutkramer Nov 25, 2024
7e87931
Merge branch 'spike/primitiveprops-as-element' into 2967-better-refle…
ewoutkramer Nov 26, 2024
42d429d
Made it work.
ewoutkramer Nov 26, 2024
ca8c52d
Small omission (not relevant for the current set of shared POCOs)
ewoutkramer Nov 26, 2024
fc30f6f
Refactored so we now have a function to generate AllowedType attributes
ewoutkramer Nov 27, 2024
ec3c095
Merge pull request #47 from FirelyTeam/2967-better-reflect-shared-pro…
Kasdejong Dec 3, 2024
fd0cf74
Removed Bw-compat code that's not needed anymore now we do a major ne…
ewoutkramer Dec 3, 2024
51998fb
Changes to how we generate SearchParamDefinition since it moved to Base.
ewoutkramer Dec 3, 2024
f7836c4
Added code to remove certain searparam targets. No longer needed to m…
ewoutkramer Dec 4, 2024
7ddbe83
Merge pull request #48 from FirelyTeam/remove-bw-compat-code
mmsmits Dec 5, 2024
6d004b3
Introduction of CompareChildren instead of Matches/IsExactly.
ewoutkramer Dec 5, 2024
1d2ab49
Merge branch 'remove-bw-compat-code' into 2928-introduce-iequalitycom…
ewoutkramer Dec 5, 2024
fea7355
Merge branch 'dev' into 2928-introduce-iequalitycomparer
ewoutkramer Dec 5, 2024
31544a5
Merge pull request #49 from FirelyTeam/2531-migrate-searchparam-defin…
Kasdejong Dec 5, 2024
0f3f6bd
Merge pull request #50 from FirelyTeam/2928-introduce-iequalitycomparer
ewoutkramer Dec 5, 2024
01f4b9f
Made changes to the deep copy signatures
Kasdejong Dec 17, 2024
4eab679
Merge pull request #51 from FirelyTeam/feature/remove-deepcopyable
ewoutkramer Feb 7, 2025
30b21df
Skip Value prop generation for specific types.
ewoutkramer Feb 19, 2025
ad3e60c
Mmmm.....need to split out nullability generation here
ewoutkramer Feb 22, 2025
c3d5236
Made interface/pattern generation nullable aware.
ewoutkramer Feb 24, 2025
e00c714
Missed the fact that a comment was commenting out an important line
ewoutkramer Feb 24, 2025
196a529
Merge pull request #52 from FirelyTeam/2781-work-on-objectvalue
Kasdejong Feb 26, 2025
4e40118
Merge pull request #53 from FirelyTeam/add-nullability-indicators
Kasdejong Feb 26, 2025
36170b2
Moved Address, Duration, HumanName and Ratio to base.
ewoutkramer Mar 10, 2025
23c9896
Merge branch 'dev' into 3020-make-ratio-version-agnostic
ewoutkramer Mar 10, 2025
ffe2187
Merge pull request #54 from FirelyTeam/3020-make-ratio-version-agnostic
ewoutkramer Mar 11, 2025
b4c55aa
adjusted codegen for overflow errors on pocos
Kasdejong Mar 13, 2025
4d2618c
more changes to codegen for invalid overflow usage
Kasdejong Mar 13, 2025
7246f83
switched around conditions for EnumerateElements
Kasdejong Mar 13, 2025
8127093
wip
ewoutkramer Mar 20, 2025
6e88fe3
Made helper properties access getters instead of backing fields
Kasdejong Mar 20, 2025
b4921d9
Revert "wip"
ewoutkramer Mar 25, 2025
10baff0
Merge remote-tracking branch 'origin/spike/adjust-getters-to-use-over…
ewoutkramer Mar 25, 2025
e6055f6
Changed type check at start of SetValue from enumerable to list
Kasdejong Mar 25, 2025
5cac388
Merge pull request #55 from FirelyTeam/spike/adjust-getters-to-use-ov…
ewoutkramer Mar 25, 2025
1d31db6
wip
ewoutkramer Mar 20, 2025
bd952d9
changed check type to IList since List<T> is invariant
Kasdejong Mar 25, 2025
13830b0
Merge branch 'refs/heads/spike/adjust-getters-to-use-overflow-excepti…
Kasdejong Mar 26, 2025
b222fc5
Rename DeclaredType to AllowedTypes.
ewoutkramer Apr 4, 2025
ee4825a
Merge remote-tracking branch 'origin/really-improve-attribute-validat…
Kasdejong Apr 8, 2025
ad1e376
Removed obsolete comment
Kasdejong Apr 8, 2025
99c4f48
Add Collections to usings.
ewoutkramer Apr 8, 2025
a32f33c
Merge remote-tracking branch 'origin/really-improve-attribute-validat…
ewoutkramer Apr 8, 2025
03a5351
Cleanup of Attachment.size allowedattributes
ewoutkramer Apr 8, 2025
065312f
this should be a writeline
Kasdejong Apr 8, 2025
3109429
Only used [AllowedTypes] where applicable.
ewoutkramer Apr 8, 2025
b86ec42
Merge pull request #56 from FirelyTeam/really-improve-attribute-valid…
Kasdejong Apr 9, 2025
1f7755e
No longer touches the overflow when copying pocos when its empty.
ewoutkramer Apr 23, 2025
f9cb894
Merge pull request #57 from FirelyTeam/3111-fix-hasoverflow
ewoutkramer Apr 23, 2025
3d263d0
Renamed ObjectValue to JsonValue
ewoutkramer Apr 24, 2025
e70c53b
Merge pull request #59 from FirelyTeam/3047-rename-objectvalue
Kasdejong Apr 24, 2025
06a3aa1
Generated [AllowNull] attributes.
ewoutkramer May 8, 2025
5b9edaa
Merge pull request #60 from FirelyTeam/3108-allownull-for-lists
andrzejskowronski May 8, 2025
7db97d8
Changes to be able to generate FHIR R6.
ewoutkramer May 23, 2025
149d65b
Update launchSettings.json
ewoutkramer May 23, 2025
0b9545b
Merge pull request #61 from FirelyTeam/prepare-for-R6
ewoutkramer May 23, 2025
69f44d3
Changes needed to get R6 to compile.
ewoutkramer Jun 20, 2025
729a0bd
Merge branch 'main' into make-r6-compile
ewoutkramer Jun 20, 2025
679110a
Caught a bug that actually activated a repair for the questionnaire e…
ewoutkramer Jun 23, 2025
3e6abbd
Merge branch 'main' into make-r6-compile
ewoutkramer Jun 23, 2025
e060257
Shuffled the fix around again to make sure no header comments get gen…
ewoutkramer Jun 23, 2025
08e0213
Corrected more lost enum values.
ewoutkramer Jun 23, 2025
c49d34f
Merge pull request #62 from FirelyTeam/make-r6-compile
andrzejskowronski Jun 23, 2025
e945502
Merge branch 'main' into dev
ewoutkramer Jun 30, 2025
89dab1c
Uses ballot3, removed code that needs to go out in SDK6
ewoutkramer Jun 30, 2025
c7f6eaf
Merge pull request #63 from FirelyTeam/merge-sdk5-into-sdk6
andrzejskowronski Jul 1, 2025
570d493
made required elements not nullable in the model
Kasdejong Aug 5, 2025
95a47b9
Merge pull request #64 from FirelyTeam/feature/make-mandatory-element…
ewoutkramer Aug 7, 2025
007d7ef
Create special allowed types attributes for open choice types
Kasdejong Aug 13, 2025
27222f5
Merge pull request #65 from FirelyTeam/open-choice-types
ewoutkramer Aug 14, 2025
812c658
Added the capability to generate OpenTypes in ModelInfo
ewoutkramer Aug 15, 2025
0fb45f0
Update src/Microsoft.Health.Fhir.CodeGen/Language/Firely/CSharpFirely…
ewoutkramer Aug 15, 2025
07d2843
Merge pull request #66 from FirelyTeam/add-opentypes-generation
andrzejskowronski Aug 15, 2025
9cc1966
Skip generation of abstract enum members
andrzejskowronski Aug 15, 2025
0b736ae
Merge pull request #67 from FirelyTeam/skip-abstract-enum-gen
ewoutkramer Aug 15, 2025
46e8169
Merge pull request #68 from FirelyTeam/merge-dev-sdk6-in-main-sdk5
Kasdejong Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .run/firely-all.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="firely-all" type="CompoundRunConfigurationType">
<toRun name="fhir-codegen: Firely 5.x Base" type="LaunchSettings" />
<toRun name="fhir-codegen: Firely 5.x Conformance" type="LaunchSettings" />
<toRun name="fhir-codegen: Firely 5.x R4" type="LaunchSettings" />
<toRun name="fhir-codegen: Firely 5.x R4B" type="LaunchSettings" />
<toRun name="fhir-codegen: Firely 5.x R5" type="LaunchSettings" />
<toRun name="fhir-codegen: Firely 5.x STU3" type="LaunchSettings" />
<method v="2" />
</configuration>
</component>
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static int cgComponentFieldOrder(this ElementDefinition ed)
public static string cgBasePath(this ElementDefinition ed) => ed.Base?.Path ?? string.Empty;

/// <summary>Gets the explicit name of this element if set, or returns an empty string.</summary>
public static string cgExplicitName(this ElementDefinition ed) => ed.GetExtensionValue<FhirString>(CommonDefinitions.ExtUrlExplicitTypeName)?.ToString() ?? string.Empty;
public static string? cgExplicitName(this ElementDefinition ed) => ed.GetExtensionValue<FhirString>(CommonDefinitions.ExtUrlExplicitTypeName)?.ToString();

/// <summary>Gets the short name of this element, or explicit name if there is one.</summary>
/// <param name="ed"> The ed to act on.</param>
Expand All @@ -89,12 +89,10 @@ public static string cgName(this ElementDefinition ed, bool allowExplicitName =
{
if (allowExplicitName)
{
string en = ed.cgExplicitName();
string? en = ed.cgExplicitName();

if (!string.IsNullOrEmpty(en))
{
if (en is not null)
return en;
}
}

if (removeChoiceMarker && ed.Path.EndsWith("[x]", StringComparison.Ordinal))
Expand Down
1,855 changes: 813 additions & 1,042 deletions src/Microsoft.Health.Fhir.CodeGen/Language/Firely/CSharpFirely2.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
// </copyright>

using System.ComponentModel;
using System.Text;
using Hl7.Fhir.Model;
using Microsoft.Health.Fhir.CodeGen.FhirExtensions;
using Microsoft.Health.Fhir.CodeGenCommon.Extensions;
using Microsoft.Health.Fhir.CodeGenCommon.Packaging;
using Microsoft.Health.Fhir.CodeGenCommon.Utils;

#if NETSTANDARD2_0
using Microsoft.Health.Fhir.CodeGenCommon.Polyfill;
Expand All @@ -17,7 +21,7 @@ public static class CSharpFirelyCommon
{

/// <summary>Dictionary mapping FHIR primitive types to language equivalents (see Template-Model.tt#1252).</summary>
public static readonly Dictionary<string, string> PrimitiveTypeMap = new Dictionary<string, string>()
public static readonly Dictionary<string, string> PrimitiveTypeMap = new()
{
{ "base64Binary", "byte[]" },
{ "boolean", "bool?" },
Expand Down Expand Up @@ -61,22 +65,6 @@ public static class CSharpFirelyCommon
{ "Resource", "DomainResource" },
};

/// <summary>Primitive types that have a specific validation attribute on their Value property.</summary>
public static readonly Dictionary<string, string> PrimitiveValidationPatterns = new()
{
["uri"] = "UriPattern",
["uuid"] = "UuidPattern",
["id"] = "IdPattern",
["date"] = "DatePattern",
["dateTime"] = "DateTimePattern",
["oid"] = "OidPattern",
["code"] = "CodePattern",
["time"] = "TimePattern",
["string"] = "StringPattern",
["markdown"] = "StringPattern",
["xhtml"] = "NarrativeXhtmlPattern"
};

/// <summary>
/// Determines the subset of code to generate.
/// </summary>
Expand Down Expand Up @@ -251,4 +239,27 @@ public static int GetOrder(int relativeOrder)
{
return (relativeOrder * 10) + 10;
}

public static string BuildOpenAllowedTypesAttribute() => "[AllowedTypes(OpenChoice = true)]";

public static string BuildAllowedTypesAttribute(IEnumerable<TypeReference> types, FhirReleases.FhirSequenceCodes? since)
{
StringBuilder sb = new();
sb.Append("[AllowedTypes(");

string typesList = string.Join(",",
types.Select(t => $"typeof({t.PropertyTypeString})"));

sb.Append(typesList);
if (since is not null)
sb.Append($", Since = FhirRelease.{since}");
sb.Append(")]");
return sb.ToString();
}
}


public static class StringHelpers
{
public static string EnsurePeriod(this string s) => s.EndsWith('.') ? s : s + ".";
}
12 changes: 6 additions & 6 deletions src/Microsoft.Health.Fhir.CodeGen/Language/Firely/FirelyNetIG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ private void ProcessAndWriteValueSets()
foreach ((string unversionedUrl, string[] versions) in _info.ValueSetVersions.OrderBy(kvp => kvp.Key))
{
// check for exclusions
if (CSharpFirely2._exclusionSet.Contains(unversionedUrl))
if (CSharpFirely2.ExclusionSet.Contains(unversionedUrl))
{
continue;
}
Expand Down Expand Up @@ -808,7 +808,7 @@ private void ProcessAndWriteValueSet(

// Enums and their containing classes cannot have the same name,
// so we have to correct these here
if (CSharpFirely2._enumNamesOverride.TryGetValue(vs.Url, out var replacementName))
if (CSharpFirely2.EnumNamesOverride.TryGetValue(vs.Url, out var replacementName))
{
nameSanitized = replacementName;
}
Expand Down Expand Up @@ -2159,9 +2159,9 @@ private void WriteProfile(StructureDefinition sd)
break;
//throw new Exception($"Found multiple discriminators for {id}");
}

if (discriminators.Length == 1)
{
{
discriminator = discriminators[0];

bool isExtensionSlice = _findExtensionPathRegex.IsMatch(discriminator.Path);
Expand Down Expand Up @@ -3361,7 +3361,7 @@ private ExtensionData GetExtensionData(
remarks = (remarks == null ? string.Empty : remarks + "\n") +
$"Structure Definition Name: {cd.Structure.Name}";
}

string directive;
if (_info.TryGetPackageSource(cd.Structure, out string packageId, out string packageVersion))
{
Expand Down Expand Up @@ -3567,7 +3567,7 @@ private ExtensionData GetExtensionData(
Expression = "DataType",
},
ContextTarget = null,
ContextElementInfo = new("", "", "", new ChoiceTypeReference(), null),
ContextElementInfo = new("", "", "", ComplexTypeReference.DataTypeReference, null),
//ContextElementInfo = new CSharpFirely2.WrittenElementInfo()
//{
// ElementType = "Hl7.Fhir.Model.DataType",
Expand Down
62 changes: 45 additions & 17 deletions src/Microsoft.Health.Fhir.CodeGen/Language/Firely/TypeReference.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
#nullable enable

using Microsoft.Health.Fhir.CodeGenCommon.Extensions;
using Microsoft.Health.Fhir.CodeGenCommon.Utils;

namespace Microsoft.Health.Fhir.CodeGen.Language.Firely;

public abstract record TypeReference(string Name)
{
public static TypeReference BuildFromFhirTypeName(string name, string? vsName=null, string? vsClass=null)
{
// Elements of type Code or Code<T> have their own naming/types, so handle those separately.
if (name == "code" && vsName is not null)
return new CodedTypeReference(vsName, vsClass);

if (PrimitiveTypeReference.IsFhirPrimitiveType(name))
return PrimitiveTypeReference.GetTypeReference(name);

// Otherwise, this is a "normal" name for a complex type.
return new ComplexTypeReference(name, MapTypeName(name));
}

public abstract string PropertyTypeString { get; }

internal static string MapTypeName(string name)
Expand Down Expand Up @@ -43,27 +54,42 @@ public record PrimitiveTypeReference(string Name, string PocoTypeName, Type Conv
public static PrimitiveTypeReference ForTypeName(string name, Type propertyType) =>
new(name, MapTypeName(name), propertyType);

public static readonly PrimitiveTypeReference PrimitiveType = ForTypeName("PrimitiveType", typeof(object));
public static readonly PrimitiveTypeReference Boolean = ForTypeName("boolean", typeof(bool));
public static readonly PrimitiveTypeReference Base64Binary = ForTypeName("base64Binary", typeof(byte[]));
public static readonly PrimitiveTypeReference Canonical = ForTypeName("canonical", typeof(string));
public static readonly PrimitiveTypeReference Code = ForTypeName("code", typeof(string));
public static readonly PrimitiveTypeReference Date = ForTypeName("date", typeof(string));
public static readonly PrimitiveTypeReference DateTime = ForTypeName("dateTime", typeof(string));
public static readonly PrimitiveTypeReference Decimal = ForTypeName("decimal", typeof(decimal));
public static readonly PrimitiveTypeReference Id = ForTypeName("id", typeof(string));
public static readonly PrimitiveTypeReference Instant = ForTypeName("instant", typeof(DateTimeOffset));
public static readonly PrimitiveTypeReference Integer = ForTypeName("integer", typeof(int));
public static readonly PrimitiveTypeReference Integer64 = ForTypeName("integer64", typeof(long));
public static readonly PrimitiveTypeReference Oid = ForTypeName("oid", typeof(string));
public static readonly PrimitiveTypeReference PositiveInt = ForTypeName("positiveInt", typeof(int));
public static readonly PrimitiveTypeReference String = ForTypeName("string", typeof(string));
public static readonly PrimitiveTypeReference Time = ForTypeName("time", typeof(string));
public static readonly PrimitiveTypeReference UnsignedInt = ForTypeName("unsignedInt", typeof(int));
public static readonly PrimitiveTypeReference Uri = ForTypeName("uri", typeof(string));
public static readonly PrimitiveTypeReference Url = ForTypeName("url", typeof(string));
public static readonly PrimitiveTypeReference Xhtml = ForTypeName("xhtml", typeof(string));
public static readonly PrimitiveTypeReference Markdown = ForTypeName("markdown", typeof(string));

public static readonly IReadOnlyCollection<PrimitiveTypeReference> PrimitiveList =
[
ForTypeName("base64Binary", typeof(byte[])), ForTypeName("boolean", typeof(bool)),
ForTypeName("canonical", typeof(string)), ForTypeName("code", typeof(string)),
ForTypeName("date", typeof(string)), ForTypeName("dateTime", typeof(string)),
ForTypeName("decimal", typeof(decimal)), ForTypeName("id", typeof(string)),
ForTypeName("instant", typeof(DateTimeOffset)), ForTypeName("integer", typeof(int)),
ForTypeName("integer64", typeof(long)), ForTypeName("oid", typeof(string)),
ForTypeName("positiveInt", typeof(int)), ForTypeName("string", typeof(string)),
ForTypeName("time", typeof(string)), ForTypeName("unsignedInt", typeof(int)),
ForTypeName("uri", typeof(string)), ForTypeName("url", typeof(string)),
ForTypeName("xhtml", typeof(string)), ForTypeName("markdown", typeof(string))
Boolean, Base64Binary, Canonical, Code, Date, DateTime, Decimal, Id,
Instant, Integer, Integer64, Oid, PositiveInt, String, Time, UnsignedInt,
Uri, Url, Xhtml, Markdown
];

private static readonly Dictionary<string, PrimitiveTypeReference> s_primitiveDictionary =
private static readonly Dictionary<string, PrimitiveTypeReference> _primitiveDictionary =
PrimitiveList.ToDictionary(ptr => ptr.Name);

public static bool IsFhirPrimitiveType(string name) => s_primitiveDictionary.ContainsKey(name);
public static bool IsFhirPrimitiveType(string name) => _primitiveDictionary.ContainsKey(name);

public static PrimitiveTypeReference GetTypeReference(string name) =>
s_primitiveDictionary.TryGetValue(name, out var tr)
_primitiveDictionary.TryGetValue(name, out var tr)
? tr
: throw new InvalidOperationException($"Unknown FHIR primitive {name}");

Expand All @@ -83,10 +109,12 @@ public record CqlTypeReference(string Name, Type PropertyType) : TypeReference(N

public record ComplexTypeReference(string Name, string PocoTypeName) : TypeReference(Name)
{
public ComplexTypeReference(string name) : this(name, name) { }

public override string PropertyTypeString => $"Hl7.Fhir.Model.{PocoTypeName}";
}

public record ChoiceTypeReference() : ComplexTypeReference("DataType", "DataType");
public static readonly ComplexTypeReference DataTypeReference = new("DataType");
}

public record CodedTypeReference(string EnumName, string? EnumClassName)
: PrimitiveTypeReference("code", EnumName, typeof(Enum))
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Health.Fhir.CodeGen/Loader/PackageLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public PackageLoader(ConfigRoot? config = null, LoaderOptions? opts = null)

_defaultFhirVersion = FhirReleases.FhirVersionToSequence(_rootConfiguration.FhirVersion);

_jsonOptions = opts.FhirJsonOptions;
_jsonOptions = opts.FhirJsonOptions.UsingMode(DeserializerModes.Ostrich);
_jsonParser = new(opts.FhirJsonSettings);

#if !DISABLE_XML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand All @@ -51,5 +51,5 @@
<ItemGroup>
<Folder Include="Polyfill\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public ComponentDefinition(StructureDefinition sd)

/// <summary>Cg explicit name.</summary>
/// <returns>A string.</returns>
public string cgExplicitName() => Element?.cgExplicitName() ?? string.Empty;
public string? cgExplicitName() => Element.cgExplicitName();

/// <summary>Gets the code generation name.</summary>
/// <remarks>Note: Firely generation uses this version.</remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,14 @@ private void ProcessParameters(OperationDefinition op)
fo = outFieldOrder.Count + 1;
outFieldOrder.Add(pc.Name, fo);
}
else
else
{
if (inFieldOrder.ContainsKey(pc.Name))
{
Console.WriteLine($"Operation: {op.Id} ({op.Url}) defines the parameter {pc.Name} more than once!!!");
continue;
}

fo = inFieldOrder.Count + 1;
inFieldOrder.Add(pc.Name, fo);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static string ToPascalCase(
return string.Join(joinDelimiter, word.Split(delimitersToRemove, _wordSplitOptions).Select(w => w.ToPascalCase(false)));
}

return string.Concat(word.Substring(0, 1).ToUpperInvariant(), word.Substring(1));
return string.Concat(word[..1].ToUpperInvariant(), word[1..]);
}

/// <summary>An extension method that converts an array of words each to PascalCase.</summary>
Expand Down Expand Up @@ -163,10 +163,10 @@ public static string ToCamelCase(
{
// converting to pascal and changing the initial letter is faster than accumulating here
string pc = word.ToPascalCase(removeDelimiters, joinDelimiter, delimitersToRemove);
return string.Concat(pc.Substring(0, 1).ToLowerInvariant(), pc.Substring(1));
return string.Concat(pc[..1].ToLowerInvariant(), pc[1..]);
}

return string.Concat(word.Substring(0, 1).ToLowerInvariant(), word.Substring(1));
return string.Concat(word[..1].ToLowerInvariant(), word[1..]);
}

/// <summary>An extension method that converts an array of words each to camelCase.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public enum FhirSequenceCodes : int
/// <summary>FHIR R5.</summary>
R5 = 5,

/// <summary>FHIR R5.</summary>
/// <summary>FHIR R6.</summary>
R6 = 6,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading