Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for line numbers from Java validator #466

Merged
merged 1 commit into from
Dec 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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