Skip to content

.NET and Java validator comparison

Marten Smits edited this page Feb 4, 2021 · 18 revisions

We are in the process of comparing the Java and .NET validators to achieve better alignment between the two. As input we use: https://github.com/FHIR/fhir-test-cases/tree/master/validator

STU3 files:

Filename Differences Comment Relates Issue
bug824/bug824-resource.json Java code thows errors about unknown extensions (should it?) and false codes from unitsofmeasure.org
bundle-documentation-miss-last-updated.json Java throws warning about a code that isn't in the valueset (extensible), should we too? separate rules defined from Bundle text #1621
bundle.document.json Java throws errors on not being able to resolve references, instead of warnings in .NET separate rules defined from Bundle text #1621
qr-ex.json "Unable to resolve profile" is an error in .NET and two warnings in Java
bad-display.json Bad display name, and code not in valueset, both warnings
message-infinite-loop.xml .NET validator breaks at parsing, Java throws 22 errors about about extensions and codes, then 5 about bundle references
valueset-slicing-meds.xml Values matched to multiple slices, but Java return 0 errors….
valueset-slicing-meds-bad.xml Values matched to multiple slices, which is correct, but we throw two, while java only returns a single No fix needed
qr-required-missing.json Java validates QuestionnaireResponses to Questionnaires, .NET doesn't support that
bundle-ref.xml Java Validator should throw "unknown unit", .NET just succeeds.
q-coepi.json Parsing throws exception on "TODO", java validator also return 43 other errors.
nl/nl-patient-date.json Fails on finding multiple profiles with the same canonical URL Should fix in test engine

R4 files:

Filename Differences Comment Related Issue
allergy.json .Net validator throws an error that .category is missing a value from a required binding. However, there is a "data-absent-reason" extension present on .category, so you don't have to provide a value at all. Should be fixed in .NET #1622
attachment-with-invalid-binary.json .Net parser already fails on incorrect base-64, the Java validator throws an error"
attachment-with-wrong-size.json Java checks the stated size of the attachment against the actual size. .NET validator doesn't throw an error
synthea.json .NET parser already fails on incorrect enum. Java throws an extra error, the other is about reason being an object, not an array
practictioner-role-example.json .NET throws an error about not being able to find the profile. Java throws a warning instead.
slice-by-polymorphic-type.xml Java throws warning: Communication.payload[1].content.ofType(Attachment): Attachments have data and/or url, or else must have either contentType and/oor language", .NET passes without warnings or errors
patient-bad-gender.xml .NET parser already breaks on incorrect enum. Java also states another error: ck-1: 'conformsToCheck' failed
patient-translated-codes .NET validator produces 2 warnings, because it cannot resolve contained Valuesets from StructureDefinitions #1620
Clone this wiki locally