Skip to content

Commit

Permalink
Merge pull request #44 from FirelyTeam/fix/fix-attachment-url-datatype
Browse files Browse the repository at this point in the history
Fix attachment url datatype
  • Loading branch information
mmsmits authored Oct 28, 2024
2 parents e905111 + 02cb7c1 commit bf806e3
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// </copyright>

using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Text;
using Hl7.Fhir.Model;
using Hl7.Fhir.Utility;
Expand Down Expand Up @@ -3110,6 +3109,10 @@ private void WriteElement(
{
_writer.WriteLineIndented($"[DeclaredType(Type = typeof(Code), Since = FhirRelease.R5)]");
}
else if (path == "Attachment.url")
{
_writer.WriteLineIndented($"[DeclaredType(Type = typeof(FhirUrl), Since = FhirRelease.R4)]");
}
else if (path == "Attachment.size")
{
_writer.WriteLineIndented($"[DeclaredType(Type = typeof(UnsignedInt), Since = FhirRelease.STU3)]");
Expand Down Expand Up @@ -3240,6 +3243,14 @@ TypeReference determineTypeReferenceForFhirElementName()
return PrimitiveTypeReference.GetTypeReference("uri");
}

if (element.Path is "Attachment.url")
{
/* we want to share Attachment across different FHIR versions,
* so we use the "most common" type to the versions, which
* is uri rather than the more specific url. */
return PrimitiveTypeReference.GetTypeReference("uri");
}

if (element.Path is "Element.id" or "Extension.url")
{
/* these two properties formally use a CQL primitive (at least,
Expand Down

0 comments on commit bf806e3

Please sign in to comment.