From d4749aeb5849c44e80ba034e8131a6e284df4a35 Mon Sep 17 00:00:00 2001 From: Gino Canessa Date: Mon, 27 Jan 2025 16:27:14 -0600 Subject: [PATCH] Cleaning warnings. --- .../Search/FhirSortComparer.cs | 53 ++----------------- src/fhir-candle.Tests/CompartmentTests.cs | 4 +- 2 files changed, 6 insertions(+), 51 deletions(-) diff --git a/src/FhirStore.CommonVersioned/Search/FhirSortComparer.cs b/src/FhirStore.CommonVersioned/Search/FhirSortComparer.cs index 1d3f609..7f46f65 100644 --- a/src/FhirStore.CommonVersioned/Search/FhirSortComparer.cs +++ b/src/FhirStore.CommonVersioned/Search/FhirSortComparer.cs @@ -104,11 +104,6 @@ public int Compare(Resource? x, Resource? y) if ((xValue is IFhirValueProvider xFvp) && (yValue is IFhirValueProvider yFvp)) { - //if (xFvp.FhirValue.TypeName != yFvp.FhirValue.TypeName) - //{ - // continue; - //} - switch (xFvp.FhirValue) { case IComparable xIC: @@ -256,53 +251,13 @@ public int Compare(Resource? x, Resource? y) break; default: - if (false) - { - Console.Write(""); - } + //if (false) + //{ + // Console.Write(""); + //} break; } - - - //if ((xFvp.FhirValue is IComparable xFvc) && - // (yFvp.FhirValue is IComparable yFvc)) - //{ - // int result = xFvc.CompareTo(yFvc); - // if (result != 0) - // { - // return sr.Ascending ? result : -result; - // } - - // continue; - //} - - //if ((xFvp.FhirValue is Period xPeriod) && - // (yFvp.FhirValue is Period yPeriod)) - //{ - // int result = xPeriod.Start?.CompareTo(yPeriod.Start) ?? 0; - // if (result != 0) - // { - // return sr.Ascending ? result : -result; - // } - - // result = xPeriod.End?.CompareTo(yPeriod.End) ?? 0; - // if (result != 0) - // { - // return sr.Ascending ? result : -result; - // } - //} } - - //if (xValue.Value == null) - //{ - // return sr.Ascending ? -1 : 1; - //} - - //if (yValue.Value == null) - //{ - // return sr.Ascending ? 1 : -1; - //} - } return 0; diff --git a/src/fhir-candle.Tests/CompartmentTests.cs b/src/fhir-candle.Tests/CompartmentTests.cs index a82ab34..d368c59 100644 --- a/src/fhir-candle.Tests/CompartmentTests.cs +++ b/src/fhir-candle.Tests/CompartmentTests.cs @@ -124,7 +124,7 @@ private Bundle SearchResource(VersionedFhirStore versionedFhirStore, String sear result.GetType().ToString().ShouldBe("Hl7.Fhir.Model.Bundle"); var bundle = result as Bundle; - return bundle; + return bundle!; } private void putResource(VersionedFhirStore versionedFhirStore, Resource resource) @@ -135,7 +135,7 @@ private void putResource(VersionedFhirStore versionedFhirStore, Resource resourc Store = versionedFhirStore, HttpMethod = "PUT", SourceObject = resource, - Url = null, + Url = string.Empty, Authorization = null, }; versionedFhirStore.InstanceUpdate(ctx, out FhirResponseContext opResponse);