Skip to content

Commit

Permalink
Update to Firely 5.11.3, add binary resource test (#4814)
Browse files Browse the repository at this point in the history
Update FhirService to use Firely 5.11.3 SDK

Refs AB#135366
  • Loading branch information
feordin authored Feb 12, 2025
1 parent 0606cc8 commit 4550de9
Show file tree
Hide file tree
Showing 22 changed files with 1,090 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/microsoft/fhir-server</RepositoryUrl>
<RunSettingsFilePath>$(MSBuildThisFileDirectory)\CodeCoverage.runsettings</RunSettingsFilePath>
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
Expand Down
32 changes: 13 additions & 19 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
<Project>
<!-- Shared dependencies versions.-->
<PropertyGroup>
<HealthcareSharedPackageVersion>8.0.30</HealthcareSharedPackageVersion>
<Hl7FhirVersion>5.4.0</Hl7FhirVersion>
<Hl7FhirLegacyVersion>5.3.0</Hl7FhirLegacyVersion>
<HealthcareSharedPackageVersion>8.0.33</HealthcareSharedPackageVersion>
<Hl7FhirVersion>5.11.3</Hl7FhirVersion>
<Hl7FhirLegacyVersion>5.11.0</Hl7FhirLegacyVersion>
</PropertyGroup>
<!-- SDK Packages -->
<Choose>
<When Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup>
<!-- >= 12.2.0 MediatR started depending on 8.x Microsoft.Extension.* libraries -->
<MediatRVersion>12.4.1</MediatRVersion>
<LoggingVersion>8.0.2</LoggingVersion>
<SdkPackageVersion>8.0</SdkPackageVersion>
<AspNetPackageVersion>6.0</AspNetPackageVersion>
</PropertyGroup>
</When>
<When Condition="'$(TargetFramework)' == 'net8.0'">
<PropertyGroup>
<!-- >= 12.2.0 MediatR started depending on 8.x Microsoft.Extension.* libraries -->
<MediatRVersion>12.4.1</MediatRVersion>
<LoggingVersion>8.0.2</LoggingVersion>
<ConsoleLoggingVersion>8.0.1</ConsoleLoggingVersion>
<SdkPackageVersion>8.0</SdkPackageVersion>
<AspNetPackageVersion>8.0</AspNetPackageVersion>
<AspNetPackageVersion>8.0.12</AspNetPackageVersion>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<MediatRVersion>12.4.1</MediatRVersion>
<LoggingVersion>9.0.1</LoggingVersion>
<SdkPackageVersion>9.0.0</SdkPackageVersion>
<AspNetPackageVersion>9.0.0</AspNetPackageVersion>
<ConsoleLoggingVersion>9.0.1</ConsoleLoggingVersion>
<SdkPackageVersion>9.0</SdkPackageVersion>
<AspNetPackageVersion>9.0.1</AspNetPackageVersion>
</PropertyGroup>
</Otherwise>
</Choose>
Expand All @@ -40,7 +33,7 @@
<!--CVE-2023-29331-->
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
<!-- CVE-2021-26701 -->
<PackageVersion Include="System.Text.Encodings.Web" Version="8.0.0" />
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.1" />
<!-- CVE-2020-1045 -->
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<!-- CVE-2022-26907 -->
Expand Down Expand Up @@ -100,7 +93,7 @@
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(LoggingVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.22.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(SdkPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(SdkPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(ConsoleLoggingVersion)" />
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="$(SdkPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="$(SdkPackageVersion)" />
<PackageVersion Include="Microsoft.Health.Abstractions" Version="$(HealthcareSharedPackageVersion)" />
Expand All @@ -110,8 +103,8 @@
<PackageVersion Include="Microsoft.Health.Encryption" Version="$(HealthcareSharedPackageVersion)" />
<PackageVersion Include="Microsoft.Health.Extensions.BuildTimeCodeGenerator" Version="$(HealthcareSharedPackageVersion)" />
<PackageVersion Include="Microsoft.Health.Extensions.DependencyInjection" Version="$(HealthcareSharedPackageVersion)" />
<PackageVersion Include="Microsoft.Health.Fhir.Anonymizer.R4.Core" Version="3.1.0.90" />
<PackageVersion Include="Microsoft.Health.Fhir.Anonymizer.Stu3.Core" Version="3.1.0.90" />
<PackageVersion Include="Microsoft.Health.Fhir.Anonymizer.R4.Core" Version="4.1.1.3" />
<PackageVersion Include="Microsoft.Health.Fhir.Anonymizer.Stu3.Core" Version="4.1.1.3" />
<PackageVersion Include="Microsoft.Health.Fhir.Liquid.Converter" Version="7.0.1" />
<PackageVersion Include="Microsoft.Health.SqlServer.Api" Version="$(HealthcareSharedPackageVersion)" />
<PackageVersion Include="Microsoft.Health.SqlServer" Version="$(HealthcareSharedPackageVersion)" />
Expand Down Expand Up @@ -147,5 +140,6 @@
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="System.Drawing.Common" Version="8.0.8" />
<PackageVersion Include="Moq" Version="4.20.69" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
</Project>
11 changes: 2 additions & 9 deletions build/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,14 @@ stages:
targetBuildFramework: $(defaultBuildFramework)
unitTest: false
codeCoverage: true
- job: Windows_dotnet8
pool:
name: '$(DefaultWindowsPool)'
steps:
- template: ./jobs/build.yml
parameters:
targetBuildFramework: 'net8.0'
- job: Linux_dotnet6
- job: Linux_dotnet8
pool:
name: '$(DefaultLinuxPool)'
vmImage: '$(LinuxVmImage)'
steps:
- template: ./jobs/build.yml
parameters:
targetBuildFramework: 'net6.0'
targetBuildFramework: 'net8.0'

- stage: BuildArtifacts
displayName: 'Build artifacts'
Expand Down
11 changes: 2 additions & 9 deletions build/pr-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,14 @@ stages:
targetBuildFramework: $(defaultBuildFramework)
unitTest: false
codeCoverage: true
- job: Windows_dotnet8
pool:
name: '$(DefaultWindowsPool)'
steps:
- template: ./jobs/build.yml
parameters:
targetBuildFramework: 'net8.0'
- job: Linux_dotnet6
- job: Linux_dotnet8
pool:
name: '$(DefaultLinuxPool)'
vmImage: '$(LinuxVmImage)'
steps:
- template: ./jobs/build.yml
parameters:
targetBuildFramework: 'net6.0'
targetBuildFramework: 'net8.0'

- stage: BuildArtifacts
displayName: 'Build artifacts'
Expand Down
9 changes: 9 additions & 0 deletions docs/rest/binary-example.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Microsoft.Health.Fhir.Core/Models/ResourceElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public ResourceElement(ITypedElement instance)
EnsureArg.IsNotNull(instance, nameof(instance));

Instance = instance;
_context = new Lazy<EvaluationContext>(() => new EvaluationContext(instance));
_context = new Lazy<EvaluationContext>(() =>
new EvaluationContext().WithResourceOverrides(instance));
}

internal ResourceElement(ITypedElement instance, object resourceInstance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,18 @@ private static EnumerableReturnType Visit(VariableRefExpression expression, Cont
throw new NotImplementedException();
}

private static EnumerableReturnType Visit(BracketExpression expression, Context ctx)
{
if (expression.Operand != null)
{
return Accept(expression.Operand, ctx);
}

// Bracket expressions should always have an operand.
// They should fail compilation if they don't.
throw new NotImplementedException();
}

private static EnumerableReturnType Visit(Expression expression, Context ctx)
{
throw new NotImplementedException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
<None Remove="TestFiles\Normative\Bundle-BatchWithConditionalUpdateByIdentifier.json" />
<None Remove="TestFiles\Normative\MemberMatch.json" />
<None Remove="TestFiles\Normative\sql_8623_script.sql" />
<None Remove="TestFiles\R4B\CommunicationAttachment.json" />
<None Remove="TestFiles\R4\binary-example.json" />
<None Remove="TestFiles\R4\CommunicationAttachment.json" />
<None Remove="TestFiles\R4\DocumentReference-example-with-base64.json" />
<None Remove="TestFiles\R5\binary-example.json" />
<None Remove="TestFiles\R5\CommunicationAttachment.json" />
<None Remove="TestFiles\R5\DocumentReference-example-with-base64.json" />
<None Remove="TestFiles\Stu3\binary-example.json" />
<None Remove="TestFiles\Stu3\CommunicationAttachment.json" />
<None Remove="TestFiles\Stu3\DocumentReference-example-with-base64.json" />
<None Remove="TestFiles\Stu3\MemberMatch.json" />
<None Remove="TestFiles\Normative\Bundle-BatchWithDuplicatedItems.json" />
</ItemGroup>
Expand Down Expand Up @@ -92,6 +102,10 @@
<EmbeddedResource Include="TestFiles\Normative\SearchParameterMissingExpression.json" />
<EmbeddedResource Include="TestFiles\Normative\SearchParameterMissingBase.json" />
<EmbeddedResource Include="TestFiles\Normative\Specimen.json" />
<EmbeddedResource Include="TestFiles\R4B\binary-example.json" />
<EmbeddedResource Include="TestFiles\R4B\CommunicationAttachment.json" />
<EmbeddedResource Include="TestFiles\R4B\DocumentReference-example-with-base64.json" />
<EmbeddedResource Include="TestFiles\R4\binary-example.json" />
<EmbeddedResource Include="TestFiles\R4\Bundle-ChainingSortAndSearchValidation.json" />
<EmbeddedResource Include="TestFiles\R4\CarePlan.json" />
<EmbeddedResource Include="TestFiles\Normative\CodeSystem-careplan-category.json" />
Expand Down Expand Up @@ -156,6 +170,7 @@
<EmbeddedResource Include="TestFiles\Normative\ValueSet.json" />
<EmbeddedResource Include="TestFiles\Normative\Weight.json" />
<EmbeddedResource Include="TestFiles\Normative\WeightInGrams.json" />
<EmbeddedResource Include="TestFiles\R4\CommunicationAttachment.json" />
<EmbeddedResource Include="TestFiles\R4\DocumentReference-example-relatesTo-code-appends.indexes.json" />
<EmbeddedResource Include="TestFiles\R4\DocumentReference-example-relatesTo-code-appends.json" />
<EmbeddedResource Include="TestFiles\R4\DocumentReference-example-relatesTo-code-transforms-replaces-target.indexes.json" />
Expand All @@ -164,6 +179,7 @@
<EmbeddedResource Include="TestFiles\R4\DocumentReference-example-relatesTo-code-transforms.json" />
<EmbeddedResource Include="TestFiles\Normative\Sequence.json" />
<EmbeddedResource Include="TestFiles\Normative\Parameter-Convert-Data.json" />
<EmbeddedResource Include="TestFiles\R4\DocumentReference-example-with-base64.json" />
<EmbeddedResource Include="TestFiles\R4\Immunization.json" />
<EmbeddedResource Include="TestFiles\R4\SmartCommon.json" />
<EmbeddedResource Include="TestFiles\R4\SmartPatientA.json" />
Expand All @@ -172,10 +188,12 @@
<EmbeddedResource Include="TestFiles\R5\Appointment.json" />
<EmbeddedResource Include="TestFiles\R5\BasicExampleNarrative.json" />
<EmbeddedResource Include="TestFiles\R5\BasicExampleNarrative.xml" />
<EmbeddedResource Include="TestFiles\R5\binary-example.json" />
<EmbeddedResource Include="TestFiles\R5\Bundle-ChainingSortAndSearchValidation.json" />
<EmbeddedResource Include="TestFiles\R5\Bundle-TransactionWithInvalidBundleEntry.json" />
<EmbeddedResource Include="TestFiles\R5\Bundle-TransactionWithReferenceInResourceBody.json" />
<EmbeddedResource Include="TestFiles\R5\CarePlan.json" />
<EmbeddedResource Include="TestFiles\R5\CommunicationAttachment.json" />
<EmbeddedResource Include="TestFiles\R5\Condition-For-Patient-f001.json" />
<EmbeddedResource Include="TestFiles\R5\Coverage.json" />
<EmbeddedResource Include="TestFiles\R5\Device-d1.json" />
Expand All @@ -185,6 +203,7 @@
<EmbeddedResource Include="TestFiles\R5\DocumentReference-example-relatesTo-code-transforms-replaces-target.json" />
<EmbeddedResource Include="TestFiles\R5\DocumentReference-example-relatesTo-code-transforms.indexes.json" />
<EmbeddedResource Include="TestFiles\R5\DocumentReference-example-relatesTo-code-transforms.json" />
<EmbeddedResource Include="TestFiles\R5\DocumentReference-example-with-base64.json" />
<EmbeddedResource Include="TestFiles\R5\Encounter-For-Patient-f001.json" />
<EmbeddedResource Include="TestFiles\R5\Immunization.json" />
<EmbeddedResource Include="TestFiles\R5\InvalidCompartmentDefinition.json" />
Expand Down Expand Up @@ -226,6 +245,7 @@
<EmbeddedResource Include="TestFiles\R4\ValidCompartmentDefinition.json" />
<EmbeddedResource Include="TestFiles\Stu3\BasicExampleNarrative.json" />
<EmbeddedResource Include="TestFiles\Stu3\BasicExampleNarrative.xml" />
<EmbeddedResource Include="TestFiles\Stu3\binary-example.json" />
<EmbeddedResource Include="TestFiles\Stu3\BloodGlucose.json" />
<EmbeddedResource Include="TestFiles\Stu3\BloodPressure.json" />
<EmbeddedResource Include="TestFiles\Stu3\Bundle-Batch.json" />
Expand All @@ -246,6 +266,7 @@
<EmbeddedResource Include="TestFiles\Stu3\Bundle-TransactionWithPOSTFullUrlMatchesWithPUTRequestUrl.json" />
<EmbeddedResource Include="TestFiles\Stu3\Bundle-TypeMissing.json" />
<EmbeddedResource Include="TestFiles\Stu3\CarePlan.json" />
<EmbeddedResource Include="TestFiles\Stu3\CommunicationAttachment.json" />
<EmbeddedResource Include="TestFiles\Stu3\Condition-For-Patient-f001.json" />
<EmbeddedResource Include="TestFiles\Stu3\Device-d1.json" />
<EmbeddedResource Include="TestFiles\Stu3\DeviceComponent-For-Device-d1.json" />
Expand All @@ -255,6 +276,7 @@
<EmbeddedResource Include="TestFiles\Stu3\DocumentReference-example-relatesTo-code-transforms-replaces-target.json" />
<EmbeddedResource Include="TestFiles\Stu3\DocumentReference-example-relatesTo-code-transforms.indexes.json" />
<EmbeddedResource Include="TestFiles\Stu3\DocumentReference-example-relatesTo-code-transforms.json" />
<EmbeddedResource Include="TestFiles\Stu3\DocumentReference-example-with-base64.json" />
<EmbeddedResource Include="TestFiles\Stu3\Encounter-For-Patient-f001.json" />
<EmbeddedResource Include="TestFiles\Stu3\Immunization.json" />
<EmbeddedResource Include="TestFiles\Stu3\InvalidObservation.json" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"resourceType": "Communication",
"id": "fm-attachment",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Attachment which is unsolicited</div>"
},
"identifier": [
{
"system": "http://www.providerco.com/communication",
"value": "12345"
}
],
"status": "completed",
"category": [
{
"coding": [
{
"system": "http://acme.org/messagetypes",
"code": "SolicitedAttachment"
}
]
}
],
"subject": {
"reference": "Patient/1"
},
"about": [
{
"identifier": {
"system": "http://happyvalley.com/claim",
"value": "12345"
}
},
{
"identifier": {
"system": "http://www.BenefitsInc.com/fhir/claimresponse",
"value": "R3500"
}
}
],
"sent": "2016-06-12T18:01:10-08:00",
"recipient": [
{
"identifier": {
"system": "http://www.jurisdiction.com/insurer",
"value": "123456"
}
}
],
"sender": {
"identifier": {
"system": "http://www.jurisdiction.com/provideroffices",
"value": "3456"
}
},
"payload": [
{
"contentAttachment": {
"contentType": "application/pdf",
"data": "SGVsbG8=",
"title": "accident notes 20100201.pdf",
"creation": "2010-02-01T11:50:23-05:00"
}
},
{
"contentAttachment": {
"contentType": "application/pdf",
"url": "http://example.org/docs/AB12345",
"size": 104274,
"hash": "SGVsbG8gdGhlcmU=",
"creation": "2010-02-01T10:57:34+01:00"
}
}
]
}
Loading

0 comments on commit 4550de9

Please sign in to comment.