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

Fix wrong attachment url datatype in PocoSummaryProvider #2952

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions src/Hl7.Fhir.Base/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
<Right>lib/net8.0/Hl7.Fhir.Base.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Hl7.Fhir.Model.Attachment.get_UrlElement</Target>
<Left>lib/net8.0/Hl7.Fhir.Base.dll</Left>
<Right>lib/net8.0/Hl7.Fhir.Base.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Hl7.Fhir.Rest.ContentType.BuildContentType(Hl7.Fhir.Rest.ResourceFormat,System.String)</Target>
Expand Down Expand Up @@ -42,6 +49,13 @@
<Right>lib/netstandard2.0/Hl7.Fhir.Base.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Hl7.Fhir.Model.Attachment.get_UrlElement</Target>
<Left>lib/netstandard2.0/Hl7.Fhir.Base.dll</Left>
<Right>lib/netstandard2.0/Hl7.Fhir.Base.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Hl7.Fhir.Rest.ContentType.BuildContentType(Hl7.Fhir.Rest.ResourceFormat,System.String)</Target>
Expand Down
11 changes: 6 additions & 5 deletions src/Hl7.Fhir.Base/Model/Generated/Attachment.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.expansions#5.0.0, hl7.fhir.r5.core#5.0.0
// Contents of: hl7.fhir.r5.expansions@5.0.0, hl7.fhir.r5.core@5.0.0

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -159,14 +159,15 @@ public byte[] Data
/// Uri where the data can be found
/// </summary>
[FhirElement("url", InSummary=true, Order=60)]
[DeclaredType(Type = typeof(FhirUrl), Since = FhirRelease.R4)]
[DataMember]
public Hl7.Fhir.Model.FhirUrl UrlElement
public Hl7.Fhir.Model.FhirUri UrlElement
{
get { return _UrlElement; }
set { _UrlElement = value; OnPropertyChanged("UrlElement"); }
}

private Hl7.Fhir.Model.FhirUrl _UrlElement;
private Hl7.Fhir.Model.FhirUri _UrlElement;

/// <summary>
/// Uri where the data can be found
Expand All @@ -181,7 +182,7 @@ public string Url
if (value == null)
UrlElement = null;
else
UrlElement = new Hl7.Fhir.Model.FhirUrl(value);
UrlElement = new Hl7.Fhir.Model.FhirUri(value);
OnPropertyChanged("Url");
}
}
Expand Down Expand Up @@ -480,7 +481,7 @@ public override IDeepCopyable CopyTo(IDeepCopyable other)
if(ContentTypeElement != null) dest.ContentTypeElement = (Hl7.Fhir.Model.Code)ContentTypeElement.DeepCopy();
if(LanguageElement != null) dest.LanguageElement = (Hl7.Fhir.Model.Code)LanguageElement.DeepCopy();
if(DataElement != null) dest.DataElement = (Hl7.Fhir.Model.Base64Binary)DataElement.DeepCopy();
if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUrl)UrlElement.DeepCopy();
if(UrlElement != null) dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy();
if(SizeElement != null) dest.SizeElement = (Hl7.Fhir.Model.Integer64)SizeElement.DeepCopy();
if(HashElement != null) dest.HashElement = (Hl7.Fhir.Model.Base64Binary)HashElement.DeepCopy();
if(TitleElement != null) dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ public void PocoAndSdSummaryProvidersShouldBeEqual()

AssertEqual(pocoSummary, sdSummary);
}

foreach (var item in ModelInfo.OpenTypes)
{
if (item == typeof(Canonical) || item == typeof(DataRequirement) || item == typeof(Signature) || item == typeof(Timing) || item == typeof(FhirUrl) || item == typeof(UsageContext)) continue;
var canonicalResource = ModelInfo.CanonicalUriForFhirCoreType(item);
var pocoSummary = pocoSdProvider.Provide(canonicalResource);
var sdSummary = sdProvide.Provide(canonicalResource);

AssertEqual(pocoSummary, sdSummary);
}
}


Expand Down