From c06ea9a373cd765c92972c57fc0531dc4864d4c0 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 27 Dec 2023 04:39:49 +1100 Subject: [PATCH] improve code system validation message handling --- library/ftx/ftx_sct_services.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/library/ftx/ftx_sct_services.pas b/library/ftx/ftx_sct_services.pas index 308b0a1e2..0aa069b21 100644 --- a/library/ftx/ftx_sct_services.pas +++ b/library/ftx/ftx_sct_services.pas @@ -5420,15 +5420,18 @@ function TSnomedProvider.locate(code: String; altOpt : TAlternateCodeOptions; va try result := TSnomedExpressionContext.Create(code, FSct.parseExpression(code)) except - Message := 'Unable to find code '+code+' in '+systemUri(nil)+' (version '+version(nil)+')'; - result := nil; + on e : Exception do + begin + Message := 'Code '+code+' is not a SNOMED CT Term, and neither could it be parsed as an expression ('+e.message+')'; + result := nil; + end; end end else if FSct.Concept.FindConcept(iId, index) Then result := TSnomedExpressionContext.create(code, index) else begin - Message := 'Unable to find code '+code+' in '+systemUri(nil)+' (version '+version(nil)+')'; + Message := ''; // 'Unable to find code '+code+' in '+systemUri(nil)+' (version '+version(nil)+')'; it's not useful to say anything more result := nil; end; end;