I have a CarePlan resource with extension artifact-effectivePeriod. The extension is modified to set period.start cardinality to 1..1.
When submitting a CarePlan resource with period.start > period.end in the extension, there is no error generated in the validation result, which is unexpected.
CarePlan resource:
{
"resourceType": "CarePlan",
"status": "active",
"intent": "plan",
"subject": {
"reference": "Patient/example",
"display": "Peter James Chalmers"
},
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/artifact-effectivePeriod",
"valuePeriod": {
"start": "2017-06-02",
"end": "2017-06-01"
}
}
]
}
Extension structure definition:
Download the artifact-effectivePeriod from simplifer.net here.
Modify the extension to restrict period.start cardinality to 1.
{
"differential": {
"element": [
// Add following rule will make the checking end > start fail
{
"id": "Extension.value[x].start",
"path": "Extension.value[x].start",
"min": 1
}
]
}
}
The validation result:
{
"resourceType": "OperationOutcome"
}