-
Notifications
You must be signed in to change notification settings - Fork 354
Breaking changes in 5.0
This version of the SDK no longer supports .NET Framework 4.5.2. The following framework are supported:
- .NET 6.0
- NetStandard 2.0
- Methods ConceptMap.SourceAsString() and ConceptMap.TargetAsString() are removed
- The class Hl7.Fhir.Model.Attachment moved to the library Base.
- Hl7.Fhir.Model.Attachment.UrlElement is now of type FhirUri instead of FhirUrl.
- DomainResource.modifierExtension is a summary element now.
- Hl7.Fhir.Model.Signature
- Cardinality of Signature.type is now 0..* (was 1..*)
- Cardinality of Signature.when is now 0..1 (was 1..1)
- Cardinality of Signature.who is now 0..1 (was 1..1)
- The type of
CapabilityStatement.Typehas been changed tostring?(wasResourceType?) - The type of
CapabilityStatement.TypeElementhas been changed toCode(wasCode<Hl7.Fhir.Model.ResourceType>) - The
AllowedTypesattribute has been removed from the following properties:ElementDefinition.ValueElementDefinition.DefaultValueElementDefinition.PatternElementDefinition.Fixed
- Enum
ElementDefinition.ConstraintSeverityhas been moved toTemplate-Bindings.cs. - Description of
Moneyvalues has been corrected (diacritics) - The class Hl7.Fhir.Model.RelatedArtifact has been moved to Conformance library
- ElementDefinition.constraint.RequirementsElement is now of type Markdown instead of FhirString.
- ElementDefinition.binding.DescriptionElement is now of type Markdown instead of FhirString.
- ElementDefinition.mapping.CommentElement is now of type Markdown instead of FhirString.
- Elements that are of type Markdown now are treated as primitives: they have both a primitive (of type string) and an
Elementproperty of type Markdown.
- RelatedArtifact.UrlElement has been removed from the spec. The property is still available in RelatedArtifact, but should not be used in R5.
- The enum value ElementDefinition.DiscriminatorType.Pattern has been deprecated for R5. Do not use this enum value for R5.
- ElementDefinition.constraint.xpath has been removed from the spec. The property is still available in ElementDefinition, but should not be used in R5.
- ValueSet.scope.focus has been removed from the spec. The property is still available in ValueSet, but should not be used in R5.
- Obsolete NamingSystem Purpose/Experimental/ExperimentalElement properties have been removed.
-
Signature.who[x]andSignature.onBehalfOf[x]are no longer choice types in the R5 HL7 spec, however for backwards compatibility in the shared code of the SDK, we have decided to keep the type of these elements the same as they were (DataType), even though from R5 on this can only be aResourceReference.
- The constructor of previously abstract class
BaseFhirClientis now public and requires aModelInspectorandfhirVersion. The nullable parameterIStructureDefinitionSummaryProviderhas been removed. - The classes
BundleToEntryRequest,TypedEntryResponseToBundle,EntryRequest,EntryRequestHeaders,EntryResponse,TypedEntryResponse,EntryToTypedEntryExtensions,EntryToHttpExtensions,HttpToEntryExtensionsandTypedEntryResponseToBundlehave been made internal. They exposed internal details about the FhirClient and should never have been public. - The default parameter
IStructureDefinitionSummaryProvider providerof all the constructors ofFhirClienthave been removed. - We have added nullability annotations to
BaseFhirClientandFhirClient, which means you may get compiler errors about the fact that most functions on these classes return a nullable resource, which may have gone unhandled until now. These functions return null when the operation resulted in anOperationOutcomeinstead of the expected resource type. In such cases, checkLastResultfor the OperationOutcome. - The constructor of classes
BaseFhirParserandBaseFhirSerializerrequires aModelInspector. - The protected methods
BaseFhirParser.MakeElementStackare not static anymore. -
ModelInfo.ConformanceResourcesandModelInfo.ConformanceResourceTypeshave been removed. -
ModelInfo.FhirCoreProfileBaseUrihas been removed. Use nowCanonical.FHIR_CORE_PROFILE_BASE_URI. - Obsolete members
ModelInfo.IsProfiledQuantityandModelInfoExtensions.GetCollectionNamehave been removed. - Partial class
ModelInfois not static anymore. -
SchemaCollectionhas been removed -
ValidationSettings.XsdSchemaCollectionis now of typeXmlSchemaSetinstead ofSchemaCollection. -
IncorrectElementDefinitionExceptionhas been removed. - Interface
IConformanceSourceis now derived fromICommonConformanceSource. AndIConformanceSource.FindCodeSystemByValueSet(string)has been moved to this new interfaceICommonConformanceSource. - Obsolete extension methods of
ResourceResolverExtensionshas been removed:FindExtensionDefinition,FindStructureDefinition,FindStructureDefinitionForCoreTypeandFindValueSet. - The constructor of
ProfileAssertionandProfilePreprocessorrequire now aModelInspectoras a parameter. - The public method of
ProfileAssertion.SetDeclaredTypehas been removed. - The overloaded methods
Validateof the classValidatorwith the parameterITypedElementrequires now aModelInspectoras a parameter. - The public method of
Validator.IsBindeableFhirTypehas been removed. - The type of property
TranslateParameters.ConceptMaphas been changed fromConceptMaptoResource. - The type of the parameter
conceptMapinTranslateParametershas been changed fromConceptMaptoResource. - The public method
ElementDefinitionExtensions.PrimaryTypeCodehas been changed toGetTypeCode()and the return type is nowstring?. - FhirPath's
ExpressionVisitorhas been simplified, it no longer requires aSymbolTablearguments toAcceptand theVisitmethods. - The public class
SemVersionhas been made internal. If you want to keep using this functionality we recommend to use the externalSemverNuGet package. - The public class
ProfileReferencehas been removed. All functionality has been moved toCanonical. - UriParamList.FromUri has been removed - it always returned null
- The regex pattern for
Base64Binarywas updated. - The regex pattern for
FhirDateTime,Instant,Timewas updated. - the regex pattern for
Markdownwas updated. - CodeSystemContentMode has been moved out of the CodeSystem class and is now a top-level enum (it is re-used in TerminologyCapabilities).
- When you serialize a FHIR resource with the option
summary != SummaryType.Falsethen we add now 2 Meta tags in the resource: one for the context STU3 and one for the context R4 and higher.
The FhirClient is one of the oldest parts of the SDK and is showing its age (both on the public interface and inside). We have started a gradual renovation process, which includes the following:
- Adding support for CancellationTokens (done)
- Better alignment with HttpMessageHandler/HttpMessageContent and testability (scheduled for 5.1)
- Making it possible to mock the FhirClient (done - we have made all its methods now virtual).
- Making it possible to switch to another (read: the newer) serializer.
These members have been removed, you can use the FhirClient.Settings property or the settings argument in the constructor instead:
VerifyFhirVersionPreferredFormatUseFormatParamTimeoutReturnFullResourcePreferredReturnPreferredParameterHandlingPreferCompressedResponsesCompressRequestBodyParserSettings-
OnBeforeRequest: add aHttpClientEventHandleror anotherHttpMessageHandlerto the constructor to use this functionality -
OnAfterResponseRequest: add aHttpClientEventHandleror anotherHttpMessageHandlerto the constructor to use this functionality
Obsolete class LegacyFhirClient has been removed.
Some classes were exposed that are blocking us from refactoring the client, while at the same time they don't provide a lot of functionality for general use:
- BaseFhirClient's property HttpClientRequester Requester { get; init; } went from protected to internal.
- Its protected constructor has been replaced by multiple public constructor.
- BaseFhirClient is no longer abstract.
- BundleToEntryRequest, EntryRequest, EntryRequestHeaders, EntryResponse and TypedEntryResponse are now internal.
- Extension classes EntryToTypedEntryExtensions, HttpToEntryExtensions and TypedEntryResponseToBundle are now internal
- WebRequestExtensions has been removed (all methods were already internal)
Over the last year we have discovered that we have generated enum names that were not capitalized. This has been corrected. This means the following enums have had their names capitalized:
- (R3) Sequence.qualityType, Sequence.repositoryType
- (R4 and higher) MolecularSequence.orientationType, qualityType, repositoryType, sequenceType, strandType,
- (R4 and higher) medicationRequestIntent, medicationRequestStatus
- (R4 and higher) v3-ConfidentialityClassification has been renamed to ConfidentialityClassification
- (R4 and higher) VerificationResult.status
- (R4 and higher) messageheader_response_request has been renamed to MessageHeaderResponseRequest
The names of the following valuesets clashed with properties within the classes, which meant we had properties which names ended with an underscore. This has been corrected for the following valuesets:
| ValueSet | Corresponding (new) enum |
|---|---|
| http://hl7.org/fhir/ValueSet/characteristic-combination | CharacteristicCombinationCode |
| http://hl7.org/fhir/ValueSet/claim-use | ClaimUseCode |
| http://hl7.org/fhir/ValueSet/content-type | ContentTypeCode |
| http://hl7.org/fhir/ValueSet/exposure-state | ExposureStateCode |
| http://hl7.org/fhir/ValueSet/verificationresult-status | StatusCode |
| http://terminology.hl7.org/ValueSet/v3-Confidentiality | ConfidentialityCode |
| http://hl7.org/fhir/ValueSet/variable-type | VariableTypeCode |
| http://hl7.org/fhir/ValueSet/group-measure | GroupMeasureCode |
The following obsolete member are removed in this version:
| Namespace | Element | Alternative |
|---|---|---|
| Hl7.Fhir.ElementModel | ElementNode.Clone() | ElementNode.ShallowCopy( |
| Hl7.Fhir.ElementModel.Types | DateTime.FromDateTime(DateTimeOffset) | DateTime.FromDateTimeOffset(DateTimeOffset) |
| Hl7.Fhir.Introspection | ClassMapping.AddMappingForType(Type. FhirRelease, ClassMapping) | |
| ClassMapping.DeclaredType | ||
| ClassMapping.Create(Type) | ClassMapping.TryCreate(Type, ClassMapping, FhirRelease) | |
| ClassMapping.IsMappableType(Type) | ClassMapping.TryCreate(Type, ClassMapping, FhirRelease) | |
| FhirVersionDependentExtensions.AppliesToVersion(IFhirVersionDependent, FhirRelease) | FhirVersionDependentExtensions.AppliesToRelease(Attribute, FhirRelease) | |
| PropertyMapping.ElementType | PropertyMapping.ImplementingType | |
| PropertyMapping.IsResourceChoice | ||
| PropertyMapping.Create(PropertyInfo, ClassMapping, FhirRelease) | PropertyMapping.TryCreate(PropertyInfo, out PropertyMapping?, ClassMapping, FhirRelease) | |
| Hl7.Fhir.Model | ElementDefinitionExtensions.GetDeclaredProfiles(TypeRefComponent) | ElementDefinition.TypeRefComponent.GetTypeProfile() |
| Date.ToDateTime() | Date.ToDateTimeOffset() | |
| FhirDateTime.FhirDateTime(DateTime) | FhirDateTime.FhirDateTime(DateTimeOffset) | |
| FhirDateTime.FhirDateTime(int, int, int, int, int, int) | FhirDateTime.FhirDateTime(int, int, int, int, int, int, TimeSpan) | |
| FhirDateTime.ToDateTimeOffset(TimeSpan?) | FhirDateTime.ToDateTimeOffset(TimeSpan) | |
| FhirDateTime.ToDateTime() | FhirDateTime.ToDateTimeOffset(TimeSpan) | |
| XHtml.IsValidValue(string) | XHtml.IsValidNarrativeXhtml(string) (or IsValidXml if that is more appropriate) | |
| Hl7.Fhir.Rest | EntryToHttpExtensions.ToHttpWebRequest(EntryRequest, Uri, FhirClientSettings) | EntryToHttpExtensions.ToHttpRequestMessage(EntryRequest, Uri, FhirClientSettings) |
| SearchParams.FromParameters(object) | Parameters.ToSearchParameters() | |
| ResourceIdentity.Endpoint | ResourceIdentity.BaseUri | |
| Hl7.Fhir.Serialization | FhirXmlSerializationSettings.SkipUnknownElements | FhirXmlSerializationSettings.IgnoreUnknownElements |
| ParserSettings.Default | ParserSettings.CreateDefault() | |
| Hl7.Fhir.Specification.Source | OriginInformation | OriginAnnotation |
| ConformanceSummaryProperties.GetConformanceStatus(IArtifactSummaryPropertyBag) | ConformanceSummaryProperties.GetPublicationStatus(IArtifactSummaryPropertyBag) | |
| DirectorySource(bool) | DirectorySource(DirectorySourceSettings) | |
| DirectorySource(string, bool) | DirectorySource(DirectorySourceSettings) | |
| FhirPackageSource | Moved to Firely.Fhir.Packages | |
| CommonFhirPackageSource | Removed | |
| Hl7.Fhir.Specification.Terminology | ValueSetExpanderSettings.Default | ValueSetExpanderSettings.CreateDefault() |
| OperationValidCodeExtensions | ||
| Hl7.Fhir.Specification.Snapshot | SnapshotGeneratorSettings.Default | SnapshotGeneratorSettings.CreateDefault() |
| Hl7.Fhir.Support | DateExtensions.ToFhirDateTime(DateTime) | DateExtensions.ToFhirDateTime(DateTimeOffset) |
| DateExtensions.ToFhirDateTime(DateTime?) | DateExtensions.ToFhirDateTime(DateTimeOffset?) | |
| Issue.PROFILE_INCOMPLETE_BINDING | This issue will not be raised by the validator anymore. Use 'PROFILE_ELEMENTDEF_INCORRECT' instead | |
| ResourceReferenceNotFoundException | ||
| Hl7.Fhir.Utility | FhirReleaseParser.TryFhirReleaseFromMimeVersion(string, out FhirRelease?) | FhirReleaseParser.TryGetFhirReleaseFromMimeVersion(string, out FhirRelease?) |
| FhirReleaseParser.TryFhirReleaseFromCorePackageName(string, out FhirRelease?) | FhirReleaseParser.TryGetFhirReleaseFromCorePackageName(string, out FhirRelease?) | |
| ObjectListExtensions | This class has been removed | |
| Hl7.FhirPath | EvaluationContext.Default | EvaluationContext.CreateDefault() |