Skip to content

Commit

Permalink
Merge pull request #2422 from FirelyTeam/feature/2418-fhir-5.0.0
Browse files Browse the repository at this point in the history
Implemented FHIR R5, version 5.0.0
  • Loading branch information
marcovisserFurore committed Apr 11, 2023
2 parents 34b2774 + ef662db commit dd3cda1
Show file tree
Hide file tree
Showing 254 changed files with 135,497 additions and 105,261 deletions.
62 changes: 50 additions & 12 deletions build/DownloadFhirBuildProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# cls

# Script to be run from 'build' directory
using namespace System.Collections.Generic

param(
[Parameter(Mandatory, HelpMessage="Enter the url from which the specification is to be downloaded")]
Expand All @@ -18,8 +19,9 @@ $baseDir = Resolve-Path ..
$srcdir = "$baseDir\src";

# These are all files from the spec that we need. Narratives are stripped after download
$allFiles = @("conceptmaps.xml",
"extension-definitions.xml",
$allFiles = [List[string]]@(
"conceptmaps.xml",
"extension-definitions.xml",
"namingsystem-registry.xml",
"profiles-others.xml",
"profiles-resources.xml",
Expand All @@ -29,6 +31,13 @@ $allFiles = @("conceptmaps.xml",
"fhir-all-xsd.zip"
);

if ($fhirRelease -eq "R5")
{
# remove extension-definitions.xml and namingsystem-registry.xml because from R5 those files do not exist anymore.
$allFiles.Remove("extension-definitions.xml"); #
$allFiles.Remove("namingsystem-registry.xml"); #
}

function New-TemporaryDirectory {
$parent = [System.IO.Path]::GetTempPath()
$name = [System.IO.Path]::GetRandomFileName()
Expand All @@ -38,7 +47,6 @@ function New-TemporaryDirectory {

$tempDir = New-TemporaryDirectory


# Download a file from a URL and place it at the specified target path.
# This also has some basic capabilities to go through proxies without any additional configuration.
function PowerCurl($targetPath, $sourceUrl)
Expand Down Expand Up @@ -296,6 +304,30 @@ function CorrectConceptmap($name)
$xml.Save($filename)
}

function ExtractPackageToDirectory($packageBaseUrl, $packageName, $packageVersion, $destDir)
{
$packageUrl = $packageBaseUrl + $packageName + "/" + $packageVersion;

$destFile = Join-Path $tempDir $packageName
$destFile = $destFile + ".tgz";

$extractDir = Join-Path $tempDir $packageName

# Download extension package
PowerCurl $destFile $packageUrl

# Unpack extension package
New-Item -ItemType Directory $extractDir -Force | Out-Null
tar -xf $destFile -C $extractDir

# move part of the content to specification dir
New-Item -ItemType Directory $destDir -Force | Out-Null
$exclude = @('.index.json','package.json')
Copy-Item -Path $extractDir\Package\* -Filter "*.json" -Container:$false -Destination $destDir -Exclude $exclude
}

# Start of processing:


foreach($file in $allFiles)
{
Expand Down Expand Up @@ -339,22 +371,28 @@ foreach($file in $allFiles)
ChangeValueElementOfFhirType $file
}
}

}

$specificationDir = New-TemporaryDirectory

Write-Host -ForegroundColor White "Copy files to project..."

# Copy the files necessary for the specification library (specification.zip / data)
CopySpecFile "conceptmaps.xml" $specificationDir
CopySpecFile "extension-definitions.xml" $specificationDir
CopySpecFile "namingsystem-registry.xml" $specificationDir
CopySpecFile "profiles-others.xml" $specificationDir
CopySpecFile "profiles-resources.xml" $specificationDir
CopySpecFile "profiles-types.xml" $specificationDir
CopySpecFile "search-parameters.xml" $specificationDir
CopySpecFile "valuesets.xml" $specificationDir
foreach($specFile in $allFiles)
{
if ($specFile.EndsWith(".xml"))
{
Write-Host "Copy $specFile to $specificationDir"
CopySpecFile $specFile $specificationDir
}
}

if ($fhirRelease -eq "R5")
{
# download package extensions and content to the specification.zip
$extensionDir = Join-Path $specificationDir "extensions"
ExtractPackageToDirectory -packageBaseUrl "http://packages2.fhir.org/packages/" -packageName "hl7.fhir.uv.extensions.r5" -packageVersion "1.0.0" -destDir $extensionDir;
}

# Add example files used for testing

Expand Down
2 changes: 1 addition & 1 deletion 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.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/BackboneElement.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/BackboneType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
6 changes: 3 additions & 3 deletions src/Hl7.Fhir.Base/Model/Generated/Base64Binary.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -55,8 +55,8 @@ public partial class Base64Binary : PrimitiveType, IValue<byte[]>
/// </summary>
public override string TypeName { get { return "base64Binary"; } }

/// Must conform to the pattern "\s*([A-Za-z0-9+\\/]{4})*(([A-Za-z0-9+\\/]{2}==)|([A-Za-z0-9+\\/]{3}=)|([A-Za-z0-9+\\/]{4}))\s*"
public const string PATTERN = @"\s*([A-Za-z0-9+\\/]{4})*(([A-Za-z0-9+\\/]{2}==)|([A-Za-z0-9+\\/]{3}=)|([A-Za-z0-9+\\/]{4}))\s*";
/// Must conform to the pattern "(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?"
public const string PATTERN = @"(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?";

public Base64Binary(byte[] value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Binary.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Bundle.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Canonical.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Code.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/CodeableConcept.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Coding.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/ContactDetail.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions src/Hl7.Fhir.Base/Model/Generated/ContactPoint.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -94,7 +94,7 @@ public enum ContactPointSystem
[EnumLiteral("url", "http://hl7.org/fhir/contact-point-system"), Description("URL")]
Url,
/// <summary>
/// A contact that can be used for sending an sms message (e.g. mobile phones, some landlines).
/// A contact that can be used for sending a sms message (e.g. mobile phones, some landlines).
/// (system: http://hl7.org/fhir/contact-point-system)
/// </summary>
[EnumLiteral("sms", "http://hl7.org/fhir/contact-point-system"), Description("SMS")]
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/DataType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Date.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/DomainResource.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/FhirBoolean.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down
6 changes: 3 additions & 3 deletions src/Hl7.Fhir.Base/Model/Generated/FhirDateTime.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -55,8 +55,8 @@ public partial class FhirDateTime : PrimitiveType, IValue<string>
/// </summary>
public override string TypeName { get { return "dateTime"; } }

/// Must conform to the pattern "([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]{1,9})?)?)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?"
public const string PATTERN = @"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]{1,9})?)?)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?";
/// Must conform to the pattern "([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]{1,9})?)?)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)?)?)?"
public const string PATTERN = @"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]{1,9})?)?)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)?)?)?";

public FhirDateTime(string value)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Hl7.Fhir.Base/Model/Generated/FhirDecimal.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -55,8 +55,8 @@ public partial class FhirDecimal : PrimitiveType, INullableValue<decimal>
/// </summary>
public override string TypeName { get { return "decimal"; } }

/// Must conform to the pattern "-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?"
public const string PATTERN = @"-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?";
/// Must conform to the pattern "-?(0|[1-9][0-9]{0,17})(\.[0-9]{1,17})?([eE][+-]?[0-9]{1,9}})?"
public const string PATTERN = @"-?(0|[1-9][0-9]{0,17})(\.[0-9]{1,17})?([eE][+-]?[0-9]{1,9}})?";

public FhirDecimal(decimal? value)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Hl7.Fhir.Base/Model/Generated/FhirString.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -55,8 +55,8 @@ public partial class FhirString : PrimitiveType, IValue<string>
/// </summary>
public override string TypeName { get { return "string"; } }

/// Must conform to the pattern "[ \r\n\t\S]+"
public const string PATTERN = @"[ \r\n\t\S]+";
/// Must conform to the pattern "^[\s\S]+$"
public const string PATTERN = @"^[\s\S]+$";

public FhirString(string value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/FhirUri.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/FhirUrl.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Id.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Identifier.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Instant.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down
6 changes: 3 additions & 3 deletions src/Hl7.Fhir.Base/Model/Generated/Integer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -55,8 +55,8 @@ public partial class Integer : PrimitiveType, INullableValue<int>
/// </summary>
public override string TypeName { get { return "integer"; } }

/// Must conform to the pattern "-?([0]|([1-9][0-9]*))"
public const string PATTERN = @"-?([0]|([1-9][0-9]*))";
/// Must conform to the pattern "[0]|[-+]?[1-9][0-9]*"
public const string PATTERN = @"[0]|[-+]?[1-9][0-9]*";

public Integer(int? value)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Hl7.Fhir.Base/Model/Generated/Integer64.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -55,8 +55,8 @@ public partial class Integer64 : PrimitiveType, INullableValue<long>
/// </summary>
public override string TypeName { get { return "integer64"; } }

/// Must conform to the pattern "-?([0]|([1-9][0-9]*))"
public const string PATTERN = @"-?([0]|([1-9][0-9]*))";
/// Must conform to the pattern "[0]|[-+]?[1-9][0-9]*"
public const string PATTERN = @"[0]|[-+]?[1-9][0-9]*";

public Integer64(long? value)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Hl7.Fhir.Base/Model/Generated/Markdown.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -55,8 +55,8 @@ public partial class Markdown : PrimitiveType, IValue<string>
/// </summary>
public override string TypeName { get { return "markdown"; } }

/// Must conform to the pattern "\s*(\S|\s)*"
public const string PATTERN = @"\s*(\S|\s)*";
/// Must conform to the pattern "^[\s\S]+$"
public const string PATTERN = @"^[\s\S]+$";

public Markdown(string value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Meta.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Base/Model/Generated/Oid.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <auto-generated/>
// Contents of: hl7.fhir.r5.core version: 5.0.0-snapshot3
// Contents of: hl7.fhir.r5.core version: 5.0.0

using System;
using System.Runtime.Serialization;
Expand Down

0 comments on commit dd3cda1

Please sign in to comment.