Validation not implemented in Spark
When this will be implemented?
This is not something that is immediate on my plan, but that said it is possible to implement by following the structure layed out in FhirController and FhirService class by using the https://github.com/FirelyTeam/fhir-net-api.
There are examples on how to do validation in the fhir-net-api and also a Validation Demo
Just to make sure, which of the following validation are implemented?
https://hl7.org/fhir/R4/validation.html
Structure: Check that all the content in the resource is described by the specification, and nothing extra is present
Cardinality: Check that the cardinality of all properties is correct (min & max)
Value Domains: Check that the values of all properties conform to the rules for the specified types (including checking that enumerated codes are valid)
Coding/CodeableConcept bindings: Check that codes/displays provided in the Coding/CodeableConcept types are valid
Invariants: Check that the invariants (co-occurrence rules, etc.) have been followed correctly
Profiles: Check that any rules in profiles have been followed (including those listed in the Resource.meta.profile, or in CapabilityStatement, or in an ImplementationGuide, or otherwise required by context)
Questionnaires: Check that a QuestionnaireResponse is valid against its matching Questionnaire
Business Rules: Business rules are made outside the specification, such as checking for duplicates, checking that references resolve, checking that a user is authorized to do what they want to do, etc.
The validation that exists in Spark today is enforced by the xml and json parsers and will validate Structure, Cardinality and Value Domains.