Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public StructureDefinitionCorrectionsResolver(ISyncOrAsyncResourceResolver neste
correctStringTextRegex("markdown", sd.Differential); correctStringTextRegex("markdown", sd.Snapshot);
}

if (new[] { "StructureDefinition", "ElementDefinition", "Reference", "Questionnaire", "Bundle", "CareTeam", "OperationDefinition", "Observation" }.Contains(sd.Type))
if (new[] { "StructureDefinition", "ElementDefinition", "Reference", "Questionnaire", "Bundle", "CareTeam", "OperationDefinition", "Observation", "Coverage" }.Contains(sd.Type))
{
correctConstraints(sd.Differential); correctConstraints(sd.Snapshot);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,12 @@ public static OperationOutcome ToOperationOutcome(this ResultReport result)
{
var issue = Issue.Create(item.IssueNumber, item.Severity, item.Type ?? IssueType.Unknown);

var location =
item.DefinitionPath is not null && item.DefinitionPath.HasDefinitionChoiceInformation ?
item.Location + ", element " + item.DefinitionPath.ToString()
: item.Location;

var newIssueComponent = outcome.AddIssue(item.Message, issue, location);
var newIssueComponent = outcome.AddIssue(item.Message, issue, item.Location);

// The definition path is always added to the outcome.
if (item.DefinitionPath is not null)
{
newIssueComponent.SetStructureDefinitionPath(item.DefinitionPath.ToString());
newIssueComponent.Diagnostics = $"ElementDefinition trace: {item.DefinitionPath}";

var q = item.DefinitionPath.Current;
while (q is not null)
Expand Down
3 changes: 2 additions & 1 deletion src/Firely.Fhir.Validation/Schema/PathStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public ChildNavEvent(PathStackEvent? previous, string childName, string? choiceT

protected internal override string Render() => this switch
{
{ ChoiceType: not null } => $".{ChildName[..^3]}{ChoiceType.Capitalize()}",
// do not render choice type to keep location a valid FHIRPath
{ ChoiceType: not null } => $".{ChildName[..^3]}",
_ => $".{ChildName}"
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Overall result: FAILURE (13 errors and 1 warnings)
[ERROR] Instance failed constraint bdl-1 "total only when a search or history" (at Bundle, element Bundle(http://example.org/StructureDefinition/DocumentBundle))
[ERROR] Instance count is 1, which is not within the specified cardinality of 0..0 (at Bundle.total, element Bundle(http://example.org/StructureDefinition/DocumentBundle).total)
[ERROR] Encountered a reference (http://example.org/fhir/Practitioner/Hippocrates) of kind 'Referenced', which is not one of the allowed kinds (Bundled). (at Bundle.entry[0].resource[0].author[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).author)
[ERROR] Element does not validate against any of the expected profiles (http://example.org/StructureDefinition/WeightQuantity, http://example.org/StructureDefinition/HeightQuantity). (at Bundle.entry[1].resource[0].valueQuantity[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity])
[ERROR] Value '75600' is larger than 200. (at Bundle.entry[1].resource[0].valueQuantity[0].value[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/WeightQuantity).value)
[ERROR] Value 'http://unitsofmeasurex.org' is not exactly equal to fixed value 'http://unitsofmeasure.org' (at Bundle.entry[1].resource[0].valueQuantity[0].system[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/WeightQuantity).system)
[ERROR] Value 'g' is not exactly equal to fixed value 'kg' (at Bundle.entry[1].resource[0].valueQuantity[0].code[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/WeightQuantity).code)
[ERROR] Value '75600' is larger than 350. (at Bundle.entry[1].resource[0].valueQuantity[0].value[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/HeightQuantity).value)
[ERROR] Value 'g' is not exactly equal to fixed value 'cm' (at Bundle.entry[1].resource[0].valueQuantity[0].code[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/HeightQuantity).code)
[ERROR] Element is of type 'boolean', which is not one of the allowed choice types ('string','Quantity') (at Bundle.entry[2].resource[0].valueBoolean[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][@default])
[WARNING] Code '10154-3' from system 'http://loinc.org' has incorrect display 'Hoofdklacht', should be 'Chief complaint' (at Bundle.entry[0].resource[0].section[2].code[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.code)
[ERROR] Value 'Misc internal annotations' is too long (maximum length is 20) (at Bundle.entry[0].resource[0].section[4].title[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.title)
[ERROR] Code 'internal notes' from system 'http://example.org/fhir/demo-section-titles' does not exist in the value set 'MainBundle Section title codes' (http://example.org/ValueSet/SectionTitles) (at Bundle.entry[0].resource[0].section[4].code[0], element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.code)
[ERROR] Instance count is 2, which is not within the specified cardinality of 1..1 (at Bundle.entry[0].resource[0].section, element Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section[vitalSigns])
[ERROR] Instance failed constraint bdl-1 "total only when a search or history"(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle)) (at Bundle)
[ERROR] Instance count is 1, which is not within the specified cardinality of 0..0(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).total) (at Bundle.total)
[ERROR] Encountered a reference (http://example.org/fhir/Practitioner/Hippocrates) of kind 'Referenced', which is not one of the allowed kinds (Bundled).(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).author) (at Bundle.entry[0].resource[0].author[0])
[ERROR] Element does not validate against any of the expected profiles (http://example.org/StructureDefinition/WeightQuantity, http://example.org/StructureDefinition/HeightQuantity).(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]) (at Bundle.entry[1].resource[0].value[0])
[ERROR] Value '75600' is larger than 200.(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/WeightQuantity).value) (at Bundle.entry[1].resource[0].value[0].value[0])
[ERROR] Value 'http://unitsofmeasurex.org' is not exactly equal to fixed value 'http://unitsofmeasure.org'(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/WeightQuantity).system) (at Bundle.entry[1].resource[0].value[0].system[0])
[ERROR] Value 'g' is not exactly equal to fixed value 'kg'(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/WeightQuantity).code) (at Bundle.entry[1].resource[0].value[0].code[0])
[ERROR] Value '75600' is larger than 350.(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/HeightQuantity).value) (at Bundle.entry[1].resource[0].value[0].value[0])
[ERROR] Value 'g' is not exactly equal to fixed value 'cm'(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][Quantity]->Quantity(http://example.org/StructureDefinition/HeightQuantity).code) (at Bundle.entry[1].resource[0].value[0].code[0])
[ERROR] Element is of type 'boolean', which is not one of the allowed choice types ('string','Quantity')(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.entry->Observation(http://example.org/StructureDefinition/WeightHeightObservation).value[x][@default]) (at Bundle.entry[2].resource[0].value[0])
[WARNING] Code '10154-3' from system 'http://loinc.org' has incorrect display 'Hoofdklacht', should be 'Chief complaint'(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.code) (at Bundle.entry[0].resource[0].section[2].code[0])
[ERROR] Value 'Misc internal annotations' is too long (maximum length is 20)(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.title) (at Bundle.entry[0].resource[0].section[4].title[0])
[ERROR] Code 'internal notes' from system 'http://example.org/fhir/demo-section-titles' does not exist in the value set 'MainBundle Section title codes' (http://example.org/ValueSet/SectionTitles)(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section.code) (at Bundle.entry[0].resource[0].section[4].code[0])
[ERROR] Instance count is 2, which is not within the specified cardinality of 1..1(further diagnostics: ElementDefinition trace: Bundle(http://example.org/StructureDefinition/DocumentBundle).entry.resource->Composition(http://example.org/StructureDefinition/DocumentComposition).section[vitalSigns]) (at Bundle.entry[0].resource[0].section)
Loading