-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate input parameters in terminology service #1670
Validate input parameters in terminology service #1670
Conversation
…d-check-parameters # Conflicts: # src/Hl7.Fhir.Specification.Tests/Source/TerminologyTests.cs # src/Hl7.Fhir.Specification/Specification/Terminology/ExternalTerminologyService.cs # src/Hl7.Fhir.Specification/Specification/Terminology/ValidateCodeParameters.cs
…urn false outcomes instead of throwing exceptions.
…erminologyService
…d-check-parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
src/Hl7.Fhir.Specification/Specification/Terminology/ExternalTerminologyService.cs
Outdated
Show resolved
Hide resolved
src/Hl7.Fhir.Specification/Specification/Terminology/ExternalTerminologyService.cs
Outdated
Show resolved
Hide resolved
…ain parameters checks
…e boolean instead of throwing an exception
src/Hl7.Fhir.Specification.Tests/Validation/BindingValidationTests.cs
Outdated
Show resolved
Hide resolved
…ocalterminologyservice
…lient error is detected
…erminologyservice-should-check-parameters
…erminologyservice-should-check-parameters
…d-check-parameters
@@ -25,16 +25,30 @@ public ExternalTerminologyService(BaseFhirClient client) | |||
|
|||
public BaseFhirClient Endpoint { get; set; } | |||
|
|||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is an implementation of the corresponding method on ITerminologyService. Move this comment there, and replace the comment here with <inheritdoc />
, otherwise, you'll find yourself having to repeat this comment on every implementation.
@@ -161,6 +183,14 @@ private Parameters falseOutcome(string message) | |||
return result; | |||
} | |||
|
|||
private Parameters warningOutcome(string message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha were too fast, already gone
|
||
//ValueSetExpander keeps throwing TerminologyService Exceptions to not change the public interface. | ||
#pragma warning disable 0618 | ||
|
||
public ValueSetExpanderSettings Settings { get; } | ||
|
||
public ValueSetExpander(ValueSetExpanderSettings settings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a #pragma warning restore
below the section to re-enable 0618.
{ | ||
string message = (cc?.Coding == null || cc.Coding.Count == 1) | ||
? $"Terminology service failed while validating code '{code ?? coding?.Code ?? cc?.Coding[0]?.Code}' (system '{system ?? coding?.System ?? cc?.Coding[0]?.System}'): {tse.Message}" | ||
: $"Terminology service failed while validating the codes: {tse.Message}"; | ||
|
||
return Issue.TERMINOLOGY_SERVICE_FAILED | ||
return Issue.TERMINOLOGY_OUTPUT_WARNING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text in the error messages says "terminology service failed", but the Issue
is now a TERMINOLOGY_OUTPUT_WARNING
. Since TERMINOLOGY_SERVICE_FAILED
was already an issue of level Warning
(which is what we want to achieve), I'd say we keep on using the TERM_SERVICE_FAILED
issue - it did return a 4xx after all.
…d-check-parameters
fixes: #1651