Skip to content

Commit

Permalink
Add support for line numbers from Java validator (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
vadi2 authored Dec 13, 2021
1 parent afe9e93 commit bb5a2a8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,17 @@ private List<Issue> convertIssues(List<OperationOutcome.IssueComponent> issues)
};
convertedIssues.Add(simplifiedIssue);

// read Java details
var javaLineNumber = issue.GetIntegerExtension("http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-line");
var javaLinePosition = issue.GetIntegerExtension("http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-col");
if (javaLineNumber.HasValue && javaLinePosition.HasValue)
{
simplifiedIssue.LineNumber = javaLineNumber.Value;
simplifiedIssue.LinePosition = javaLinePosition.Value;
continue;
}

// read .NET details
var serializationDetails = GetPositionInfo(issue);
if (serializationDetails == null)
{
Expand All @@ -515,6 +526,9 @@ private List<Issue> convertIssues(List<OperationOutcome.IssueComponent> issues)

simplifiedIssue.LineNumber = serializationDetails.LineNumber;
simplifiedIssue.LinePosition = serializationDetails.LinePosition;



}

return convertedIssues;
Expand Down

0 comments on commit bb5a2a8

Please # to comment.