Nexus EMR profile for an ATTACHED DOCUMENT -- a clinical document that exists as a file:
scanned paper, incoming faxes, external consult letters received as PDF, signed consent forms,
patient-uploaded files. FHIR holds the metadata and clinical context; the bytes live in
document storage and are reached through content.attachment.url.
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
attachment-has-data-or-url
this profile
error
DocumentReference
Each attachment must have either inline data (base64) or a url (blob storage URI), or both content.all(attachment.data.exists() or attachment.url.exists())
nexus-awaiting-patient-has-no-subject
this profile
error
DocumentReference
A record awaiting a patient match (the awaiting-patient tag under CodeSystem/nexus-filing-state) SHALL NOT carry a subject: matching it to a patient sets the subject and removes the tag together. meta.tag.where(system = 'https://fhir.apps.health/CodeSystem/nexus-filing-state' and code = 'awaiting-patient').exists() implies subject.empty()
A field mapping SHALL appear only on a form template (an identifier under NamingSystem/nexus-form-template): it names the fillable fields of the template's file that a chart value pre-fills, and a filed form carries the values themselves extension.where(url = 'https://fhir.apps.health/StructureDefinition/nexus-form-template-field-mapping').exists() implies identifier.where(system = 'https://fhir.apps.health/NamingSystem/nexus-form-template').exists()
nexus-documentreference-subject-unless-template
this profile
error
DocumentReference
A DocumentReference SHALL carry a subject unless it is a form template, is awaiting a patient match, or is the terms and conditions. A template (an identifier under NamingSystem/nexus-form-template) is the tenant-wide blank of a form type and is about no patient; a document awaiting a match (the awaiting-patient tag under CodeSystem/nexus-filing-state) has arrived before its patient was identified; the terms and conditions (an identifier under NamingSystem/nexus-terms-and-conditions) are what every user accepts at sign-in and are about no patient. Every other document is about one. subject.exists() or identifier.where(system = 'https://fhir.apps.health/NamingSystem/nexus-form-template').exists() or identifier.where(system = 'https://fhir.apps.health/NamingSystem/nexus-terms-and-conditions').exists() or meta.tag.where(system = 'https://fhir.apps.health/CodeSystem/nexus-filing-state' and code = 'awaiting-patient').exists()
nexus-documentreference-type-loinc-system
this profile
warning
DocumentReference
A LOINC-shaped code under a system other than http://loinc.org SHOULD be accompanied by a coding with system http://loinc.org and the same code: a LOINC code is always written under http://loinc.org, and the arrived coding is kept beside it as a raw code type.coding.where(system.exists() and system != 'http://loinc.org' and code.matches('^[0-9]{1,7}-[0-9]$')).all(code in %resource.type.coding.where(system = 'http://loinc.org').code)
dom-2
inherited
error
DocumentReference
If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3
inherited
error
DocumentReference
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
DocumentReference
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
DocumentReference
If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6
inherited
warning
DocumentReference
A resource should have narrative for robust management text.div.exists()
ele-1
inherited
error
DocumentReference.meta
All FHIR elements must have a @value or children hasValue() or (children().count() > id.count())
ext-1
inherited
error
DocumentReference.meta.extension
Must have either extensions or value[x], not both extension.exists() != value.exists()