Skip to content

Task Profile

Canonical../StructureDefinition/nexus-emr-core-clinical-task
Statusdraft · 1.26.0
BaseTask (constraint)
SourceFSH · JSON

A unit of work in the chart: who asked for it, who owns it now, what has been said about it, and which chart element it concerns. Inbox items, to-dos, follow-ups, a result that needs review -- deliberately one kind of work item.

Invariants

Every rule in force on a conforming instance. This profile rows are stated here; inherited rows come from the base resource and are listed so that a constraint named on an element is findable. Invariant keys elsewhere on this page link into this table.

Key Source Severity On Rule
nexus-note-extension-not-where-native this profile error Task The resource-note extension is not used on a resource that has a native note element -- that element is the home
extension('../StructureDefinition/nexus-emr-resource-note').empty()
nexus-sugg-1 this profile error Task A suggested-resource input SHALL reference a CONTAINED resource (a local #id reference). A suggested resource is never a first-class chart resource before someone accepts it.
input.where(type.coding.where(system = '../CodeSystem/nexus-task-input-type' and code = 'suggested-resource').exists()).all(value.reference.startsWith('#'))
nexus-sugg-2 this profile error Task A suggested-resource input SHALL resolve to a Bundle contained in this Task. The suggested resources are that Bundle's entries.
input.where(type.coding.where(system = '../CodeSystem/nexus-task-input-type' and code = 'suggested-resource').exists()).all(value.reference.substring(1) in %resource.contained.where($this is Bundle).id)
nexus-sugg-3 this profile error Task A contained prototype Bundle SHALL be type transaction: instantiating it writes its entries, and entry.request is what says how each one is written.
contained.where($this is Bundle).all(type = 'transaction')
nexus-task-bizstatus-scope this profile error Task A correction business status SHALL only appear on a task filed under privacy-request. The correction lifecycle is the statutory record of a request to amend a chart; on any other task it is a status nobody can act on and a reader cannot distinguish from ordinary workflow state.
businessStatus.coding.where(system = 'http://hl7.org/fhir/uv/patient-corrections/CodeSystem/PatientCorrectionBusinessStatus').exists() implies code.coding.where(system = '../CodeSystem/nexus-task-code' and code = 'privacy-request').exists()
nexus-task-focus-not-contained this profile error Task Task.focus SHALL NOT be a local (#) reference. Focus names a resource that already exists in the chart; contained content is referenced from input.
focus.reference.exists() implies focus.reference.startsWith('#').not()
nexus-task-priority-detail-1 this profile error Task When the priority-detail extension is present, Task.priority SHALL be routine, so a consumer that does not read the extension sorts the task as routine rather than mis-sorting it.
priority.extension.where(url = '../StructureDefinition/nexus-task-priority-detail').exists() implies priority = 'routine'
dom-2 inherited error Task If the resource is contained in another resource, it SHALL NOT contain nested Resources
contained.contained.empty()
dom-3 inherited error Task If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource
contained.where((('#'+id in (%resource.descendants().reference
dom-4 inherited error Task If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated
contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
dom-5 inherited error Task If a resource is contained in another resource, it SHALL NOT have a security label
contained.meta.security.empty()
dom-6 inherited warning Task A resource should have narrative for robust management
text.div.exists()
ele-1 inherited error Task.meta All FHIR elements must have a @value or children
hasValue() or (children().count() > id.count())
ext-1 inherited error Task.extension Must have either extensions or value[x], not both
extension.exists() != value.exists()
inv-1 inherited error Task Last modified date must be greater than or equal to authored-on date.
lastModified.exists().not() or authoredOn.exists().not() or lastModified >= authoredOn