-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed Children, de-duplicated some SnapshotGen files.
- Loading branch information
1 parent
4d8d896
commit 6d4b929
Showing
654 changed files
with
439 additions
and
82,015 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#nullable enable | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
namespace Hl7.Fhir.Model; | ||
|
||
public static class BaseExtensions | ||
{ | ||
[Obsolete("Use GetElementPairs() instead. Note that with GetElementPairs(), the elements are not guaranteed to " + | ||
"be the same type, as they reflect the type in the actual POCO definition.")] | ||
public static IEnumerable<Base> Children(this Base instance) | ||
{ | ||
foreach (var element in instance.GetElementPairs()) | ||
{ | ||
switch (element.Key, element.Value) | ||
{ | ||
case ("div", XHtml xhtml): | ||
yield return new FhirString(xhtml.Value); | ||
break; | ||
case ("id", string id): | ||
yield return new FhirString(id); | ||
break; | ||
case ("url", string url): | ||
yield return new FhirUri(url); | ||
break; | ||
case (_, IEnumerable<Base> list): | ||
foreach (var item in list) | ||
yield return item; | ||
break; | ||
case("value", _) when instance is PrimitiveType: | ||
yield break; | ||
default: | ||
yield return (Base)element.Value; | ||
break; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.