Skip to content

.NET and Java validator comparison

Marten Smits edited this page Jan 11, 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
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
bundle.document.json Java throws erros on not being able to resolve references, indead of warning in .NET separate rules defined from Bundle text
qr-ex.json "Unable to recolve profile" is an error in .NET and two warnings in Java
bad-display.json Bad displayname, 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
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
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
fixed-quantity-binding-observation.json Java throws an error: "ERROR: Observation: As specified by profile Profile https://bb/StructureDefinition/BBDemographicAge, Element 'Observation.value[x]', Element \"https://bb/StructureDefinition/BBDemographicAge\" must not be of type \"Observation.value[x]\"" , .NET throws no errors. Asked Grahame, error seems a bit weird
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 fails on incorrect enum. Java also states another error: Patient: conformsToCheck: conformsToCheck [conformsTo(\u0027http://hl7.org/fhir/StructureDefinition/Patient\u0027)] Asked Grahama the meaning of that
Clone this wiki locally