Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding IReadOnlyDictionary support (for R3) #1816

9 changes: 0 additions & 9 deletions Hl7.Fhir.sln
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hl7.Fhir.Support.Tests", "c
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HL7.FhirPath.Tests", "common\src\Hl7.FhirPath.Tests\HL7.FhirPath.Tests.csproj", "{98390A5A-0F65-4275-ADF1-ADF4BD915FA3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hl7.Fhir.Support.Poco.Tests", "common\src\Hl7.Fhir.Support.Poco.Tests\Hl7.Fhir.Support.Poco.Tests.csproj", "{88E59825-ADF2-4B46-892F-BCC95B68559F}"
ewoutkramer marked this conversation as resolved.
Show resolved Hide resolved
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -132,12 +130,6 @@ Global
{98390A5A-0F65-4275-ADF1-ADF4BD915FA3}.FullDebug|Any CPU.Build.0 = Debug|Any CPU
{98390A5A-0F65-4275-ADF1-ADF4BD915FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98390A5A-0F65-4275-ADF1-ADF4BD915FA3}.Release|Any CPU.Build.0 = Release|Any CPU
{88E59825-ADF2-4B46-892F-BCC95B68559F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88E59825-ADF2-4B46-892F-BCC95B68559F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88E59825-ADF2-4B46-892F-BCC95B68559F}.FullDebug|Any CPU.ActiveCfg = Debug|Any CPU
{88E59825-ADF2-4B46-892F-BCC95B68559F}.FullDebug|Any CPU.Build.0 = Debug|Any CPU
{88E59825-ADF2-4B46-892F-BCC95B68559F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88E59825-ADF2-4B46-892F-BCC95B68559F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -155,7 +147,6 @@ Global
{11D29FA2-930D-432A-9DC1-DECA85E3DE19} = {8FA8427B-CC6B-41E2-83A4-F635AC311879}
{34145125-E6ED-47AE-B2F1-D5F39F7ED94D} = {DB63F8A9-84B4-4220-860C-79FC979FB435}
{98390A5A-0F65-4275-ADF1-ADF4BD915FA3} = {DB63F8A9-84B4-4220-860C-79FC979FB435}
{88E59825-ADF2-4B46-892F-BCC95B68559F} = {DB63F8A9-84B4-4220-860C-79FC979FB435}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DD5B5B64-FEB1-4E05-90A1-64F3A1A0EB75}
Expand Down
2 changes: 1 addition & 1 deletion common
2 changes: 2 additions & 0 deletions contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ This library was a collective effort by the following developers:
* Tilo Christ (Siemens)
* Henley Devereux (Artisan Technology Group)
* Kenneth Myhra (Kufu)
* Gino Canessa (Microsoft)

Thanks to:
* The Azure API for FHIR team at Microsoft for their PRs
* HSCIC (NHS Digital) for their financial support
* Max Hauser (https://github.com/maxhauser/semver) for the Semver parsing library
* Nicholas Blumhardt (https://github.com/sprache/Sprache) for the Sprache general parsing library
113 changes: 113 additions & 0 deletions src/Hl7.Fhir.Core/Model/Generated/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,29 @@ public override IEnumerable<ElementValue> NamedChildren
}
}

protected override bool TryGetValue(string key, out object value)
{
switch (key)
{
case "coverage":
value = Coverage;
return Coverage is not null;
case "priority":
value = PriorityElement;
return PriorityElement is not null;
default:
return base.TryGetValue(key, out value);
};

}

protected override IEnumerable<KeyValuePair<string, object>> GetElementPairs()
{
foreach (var kvp in base.GetElementPairs()) yield return kvp;
if (Coverage is not null) yield return new KeyValuePair<string,object>("coverage",Coverage);
if (PriorityElement is not null) yield return new KeyValuePair<string,object>("priority",PriorityElement);
}

}

/// <summary>
Expand Down Expand Up @@ -355,6 +378,33 @@ public override IEnumerable<ElementValue> NamedChildren
}
}

protected override bool TryGetValue(string key, out object value)
{
switch (key)
{
case "party":
value = Party;
return Party is not null;
case "onHold":
value = OnHoldElement;
return OnHoldElement is not null;
case "period":
value = Period;
return Period is not null;
default:
return base.TryGetValue(key, out value);
};

}

protected override IEnumerable<KeyValuePair<string, object>> GetElementPairs()
{
foreach (var kvp in base.GetElementPairs()) yield return kvp;
if (Party is not null) yield return new KeyValuePair<string,object>("party",Party);
if (OnHoldElement is not null) yield return new KeyValuePair<string,object>("onHold",OnHoldElement);
if (Period is not null) yield return new KeyValuePair<string,object>("period",Period);
}

}

/// <summary>
Expand Down Expand Up @@ -691,6 +741,69 @@ public override IEnumerable<ElementValue> NamedChildren
}
}

protected override bool TryGetValue(string key, out object value)
{
switch (key)
{
case "identifier":
value = Identifier;
return Identifier?.Any() == true;
case "status":
value = StatusElement;
return StatusElement is not null;
case "type":
value = Type;
return Type is not null;
case "name":
value = NameElement;
return NameElement is not null;
case "subject":
value = Subject;
return Subject is not null;
case "period":
value = Period;
return Period is not null;
case "active":
value = Active;
return Active is not null;
case "balance":
value = Balance;
return Balance is not null;
case "coverage":
value = Coverage;
return Coverage?.Any() == true;
case "owner":
value = Owner;
return Owner is not null;
case "description":
value = DescriptionElement;
return DescriptionElement is not null;
case "guarantor":
value = Guarantor;
return Guarantor?.Any() == true;
default:
return base.TryGetValue(key, out value);
};

}

protected override IEnumerable<KeyValuePair<string, object>> GetElementPairs()
{
foreach (var kvp in base.GetElementPairs()) yield return kvp;
if (Identifier?.Any() == true) yield return new KeyValuePair<string,object>("identifier",Identifier);
if (StatusElement is not null) yield return new KeyValuePair<string,object>("status",StatusElement);
if (Type is not null) yield return new KeyValuePair<string,object>("type",Type);
if (NameElement is not null) yield return new KeyValuePair<string,object>("name",NameElement);
if (Subject is not null) yield return new KeyValuePair<string,object>("subject",Subject);
if (Period is not null) yield return new KeyValuePair<string,object>("period",Period);
if (Active is not null) yield return new KeyValuePair<string,object>("active",Active);
if (Balance is not null) yield return new KeyValuePair<string,object>("balance",Balance);
if (Coverage?.Any() == true) yield return new KeyValuePair<string,object>("coverage",Coverage);
if (Owner is not null) yield return new KeyValuePair<string,object>("owner",Owner);
if (DescriptionElement is not null) yield return new KeyValuePair<string,object>("description",DescriptionElement);
if (Guarantor?.Any() == true) yield return new KeyValuePair<string,object>("guarantor",Guarantor);
}

}

}
Expand Down
Loading