Skip to content
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

Conversation

mmsmits
Copy link
Member

@mmsmits mmsmits commented Mar 29, 2021

  • Validator adds context to coded elements
  • Local- and ExternalTerminologyServer check input parameters before adding

fixes: #1651

mmsmits added 3 commits April 12, 2021 11:54
…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
@mmsmits mmsmits requested review from ewoutkramer and removed request for marcovisserFurore April 12, 2021 14:34
ewoutkramer
ewoutkramer previously approved these changes Apr 16, 2021
Copy link
Member

@ewoutkramer ewoutkramer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

ewoutkramer
ewoutkramer previously approved these changes Apr 16, 2021
@ewoutkramer ewoutkramer enabled auto-merge April 16, 2021 10:06
@mmsmits mmsmits disabled auto-merge May 3, 2021 13:31
@@ -25,16 +25,30 @@ public ExternalTerminologyService(BaseFhirClient client)

public BaseFhirClient Endpoint { get; set; }

/// <summary>
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method used?

Copy link
Member Author

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)
Copy link
Member

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
Copy link
Member

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.

@mmsmits mmsmits requested a review from ewoutkramer May 3, 2021 15:40
@marcovisserFurore marcovisserFurore merged commit 89265e2 into develop-stu3 May 5, 2021
@marcovisserFurore marcovisserFurore deleted the bugfix/1651-terminologyservice-should-check-parameters branch May 5, 2021 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LocalTerminologyService - ValueSetValidateCode should check system parameter
3 participants