Skip to content

Commit

Permalink
PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasdejong committed Oct 22, 2024
1 parent 34c4d0c commit 95a0b18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/Hl7.Fhir.Base/ElementModel/TypedElementParseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ public static class TypedElementParseExtensions
#pragma warning restore CS0618 // Type or member is obsolete

/// <inheritdoc cref="ParseBindable"/>
[Obsolete("WARNING! Intended for internal API usage exclusively, interface IBaseElementNavigator can be changed in " +
"the near future.")]
internal static Element? ParseBindableInternal(this ITypedElement instance)
[Obsolete("WARNING! Intended for internal API usage exclusively")]
public static Element? ParseBindableInternal(this ITypedElement instance)
{
return instance.InstanceType switch
{
Expand Down Expand Up @@ -88,8 +87,7 @@ public static Quantity ParseQuantity(this ITypedElement instance)
=> ParseQuantityInternal(instance);
#pragma warning restore CS0618 // Type or member is obsolete

[Obsolete("WARNING! Intended for internal API usage exclusively, interface IBaseElementNavigator can be changed in " +
"the near future.")]
[Obsolete("WARNING! Intended for internal API usage exclusively")]
public static Quantity ParseQuantityInternal(this ITypedElement instance)
{
var newQuantity = new Quantity
Expand All @@ -114,8 +112,7 @@ public static Quantity ParseQuantityInternal(this ITypedElement instance)
=> ParsePrimitiveInternal<T>(instance);
#pragma warning restore CS0618 // Type or member is obsolete

[Obsolete("WARNING! Intended for internal API usage exclusively, interface IBaseElementNavigator can be changed in " +
"the near future.")]
[Obsolete("WARNING! Intended for internal API usage exclusively")]
public static T ParsePrimitiveInternal<T>(this ITypedElement instance) where T : PrimitiveType, new()
=> new() { ObjectValue = instance.Value };

Expand All @@ -128,8 +125,7 @@ public static Coding ParseCoding(this ITypedElement instance)
#pragma warning restore CS0618 // Type or member is obsolete


[Obsolete("WARNING! Intended for internal API usage exclusively, interface IBaseElementNavigator can be changed in " +
"the near future.")]
[Obsolete("WARNING! Intended for internal API usage exclusively")]
public static Coding ParseCodingInternal(this ITypedElement instance)
{
return new Coding()
Expand All @@ -149,8 +145,7 @@ public static ResourceReference ParseResourceReference(this ITypedElement instan
=> instance.ParseResourceReferenceInternal();
#pragma warning restore CS0618 // Type or member is obsolete

[Obsolete("WARNING! Intended for internal API usage exclusively, interface IBaseElementNavigator can be changed in " +
"the near future.")]
[Obsolete("WARNING! Intended for internal API usage exclusively")]
public static ResourceReference ParseResourceReferenceInternal(this ITypedElement instance)
{
return new ResourceReference()
Expand All @@ -167,8 +162,7 @@ public static CodeableConcept ParseCodeableConcept(this ITypedElement instance)
=> instance.ParseCodeableConceptInternal();
#pragma warning restore CS0618 // Type or member is obsolete

[Obsolete("WARNING! Intended for internal API usage exclusively, interface IBaseElementNavigator can be changed in " +
"the near future.")]
[Obsolete("WARNING! Intended for internal API usage exclusively")]
public static CodeableConcept ParseCodeableConceptInternal(this ITypedElement instance)
{
return new CodeableConcept()
Expand Down
3 changes: 3 additions & 0 deletions src/Hl7.Fhir.Base/Model/Base.TypedElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using P=Hl7.Fhir.ElementModel.Types;

namespace Hl7.Fhir.Model;
Expand Down Expand Up @@ -81,6 +82,8 @@ IEnumerable<ITypedElement> ITypedElement.Children(string? name) =>
// HEt moet "code" zijn als dit een "Code<T>" is. Dat zijn geloof ik de afwijkingen.
// Wellioht is er ook nog iets met de directe properties "Extension.url" en "Element.id" die van een
// system type zijn ipv een FHIR type.

[TemporarilyChanged] // TODO: This is a temporary change to make the tests pass. This should be removed. We are not planning to implement ITE.
string? ITypedElement.InstanceType =>
((IStructureDefinitionSummary)
ModelInspector
Expand Down

0 comments on commit 95a0b18

Please sign in to comment.