Skip to content

The extension for valuePeriod with additional constraints failed the validation check that requires the end date to be greater than start date #491

@bruce4000www

Description

@bruce4000www

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"
}

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions