Skip to content

Commit

Permalink
improve code system validation message handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Dec 26, 2023
1 parent beaa99a commit c06ea9a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions library/ftx/ftx_sct_services.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c06ea9a

Please sign in to comment.