DIPS Core Implementation Guide
0.1.0 - ci-build
Norway
DIPS Core Implementation Guide - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
| Official URL: http://dips.no/fhir/StructureDefinition/DIPSR4DocumentReference | Version: 0.1.0 | |||
| Draft as of 2026-09-29 | Computable Name: DIPSR4DocumentReference | |||
The DIPS R4 DocumentReference Profile inherits from the FHIR DocumentReference resource; refer to it for scope and usage definitions
The profile covers clinical documents (journal entries) in DIPS Arena - dictations, PDFs, rich text and CDA documents alike. A document's resource id carries the ako prefix.
Supported interactions:
| Interaction | Supported |
|---|---|
| Read | Yes |
| Search | Yes |
| Create | Yes |
| Update | Yes |
| VRead | No |
| History | No |
| Delete | No |
| Patch | No |
Two operations are supported in addition to the interactions above, $CanCreateDocument and $initDocument, along with nine named queries invoked through the _query parameter. Both are documented below.
Example Usage Scenarios:
The following are example usage scenarios for this profile:
Query by patient identifier, episode of care, hospital stay or event time period
Create a document or a dictation, and update an existing one
Check whether the current user may create documents, and obtain an initial document template for a document type
Usages:
You can also check for usages in the FHIR IG Statistics
Description of Profiles, Differentials, Snapshots and how the different presentations work.
| Path | Status | Usage | ValueSet | Version | Source |
| DocumentReference.status | Base | required | DocumentReferenceStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.docStatus | Base | required | CompositionStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.type | Base | preferred | Document Type Value Set | 📍4.0.1 | FHIR Std. |
| DocumentReference.content.attachment.contentType | Base | required | MimeType | 📦4.0.1 | FHIR Std. |
| Id | Grade | Path(s) | Description | Expression |
| dom-2 | error | DocumentReference | If the resource is contained in another resource, it SHALL NOT contain nested Resources |
contained.contained.empty()
|
| dom-3 | 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 | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()
|
| dom-4 | 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 | error | DocumentReference | If a resource is contained in another resource, it SHALL NOT have a security label |
contained.meta.security.empty()
|
| dom-6 | best practice | DocumentReference | A resource should have narrative for robust management |
text.`div`.exists()
|
| ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children |
hasValue() or (children().count() > id.count())
|
| ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both |
extension.exists() != value.exists()
|
This structure is derived from DocumentReference
| Path | Status | Usage | ValueSet | Version | Source |
| DocumentReference.status | Base | required | DocumentReferenceStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.docStatus | Base | required | CompositionStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.content.attachment.contentType | Base | required | MimeType | 📦4.0.1 | FHIR Std. |
| Path | Status | Usage | ValueSet | Version | Source |
| DocumentReference.status | Base | required | DocumentReferenceStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.docStatus | Base | required | CompositionStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.type | Base | preferred | Document Type Value Set | 📍4.0.1 | FHIR Std. |
| DocumentReference.relatesTo.code | Base | required | DocumentRelationshipType | 📍4.0.1 | FHIR Std. |
| DocumentReference.content.attachment.contentType | Base | required | MimeType | 📦4.0.1 | FHIR Std. |
| Id | Grade | Path(s) | Description | Expression |
| dom-2 | error | DocumentReference | If the resource is contained in another resource, it SHALL NOT contain nested Resources |
contained.contained.empty()
|
| dom-3 | 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 | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()
|
| dom-4 | 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 | error | DocumentReference | If a resource is contained in another resource, it SHALL NOT have a security label |
contained.meta.security.empty()
|
| dom-6 | best practice | DocumentReference | A resource should have narrative for robust management |
text.`div`.exists()
|
| ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children |
hasValue() or (children().count() > id.count())
|
| ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both |
extension.exists() != value.exists()
|
This structure is derived from DocumentReference
Summary
Mandatory: 10 elements
Prohibited: 24 elements
Structures
This structure refers to these other structures:
Extensions
This structure refers to these extensions:
Slices
This structure defines the following Slices:
Key Elements View
| Path | Status | Usage | ValueSet | Version | Source |
| DocumentReference.status | Base | required | DocumentReferenceStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.docStatus | Base | required | CompositionStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.type | Base | preferred | Document Type Value Set | 📍4.0.1 | FHIR Std. |
| DocumentReference.content.attachment.contentType | Base | required | MimeType | 📦4.0.1 | FHIR Std. |
| Id | Grade | Path(s) | Description | Expression |
| dom-2 | error | DocumentReference | If the resource is contained in another resource, it SHALL NOT contain nested Resources |
contained.contained.empty()
|
| dom-3 | 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 | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()
|
| dom-4 | 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 | error | DocumentReference | If a resource is contained in another resource, it SHALL NOT have a security label |
contained.meta.security.empty()
|
| dom-6 | best practice | DocumentReference | A resource should have narrative for robust management |
text.`div`.exists()
|
| ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children |
hasValue() or (children().count() > id.count())
|
| ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both |
extension.exists() != value.exists()
|
Differential View
This structure is derived from DocumentReference
| Path | Status | Usage | ValueSet | Version | Source |
| DocumentReference.status | Base | required | DocumentReferenceStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.docStatus | Base | required | CompositionStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.content.attachment.contentType | Base | required | MimeType | 📦4.0.1 | FHIR Std. |
Snapshot View
| Path | Status | Usage | ValueSet | Version | Source |
| DocumentReference.status | Base | required | DocumentReferenceStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.docStatus | Base | required | CompositionStatus | 📦4.0.1 | FHIR Std. |
| DocumentReference.type | Base | preferred | Document Type Value Set | 📍4.0.1 | FHIR Std. |
| DocumentReference.relatesTo.code | Base | required | DocumentRelationshipType | 📍4.0.1 | FHIR Std. |
| DocumentReference.content.attachment.contentType | Base | required | MimeType | 📦4.0.1 | FHIR Std. |
| Id | Grade | Path(s) | Description | Expression |
| dom-2 | error | DocumentReference | If the resource is contained in another resource, it SHALL NOT contain nested Resources |
contained.contained.empty()
|
| dom-3 | 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 | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()
|
| dom-4 | 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 | error | DocumentReference | If a resource is contained in another resource, it SHALL NOT have a security label |
contained.meta.security.empty()
|
| dom-6 | best practice | DocumentReference | A resource should have narrative for robust management |
text.`div`.exists()
|
| ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children |
hasValue() or (children().count() > id.count())
|
| ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both |
extension.exists() != value.exists()
|
This structure is derived from DocumentReference
Summary
Mandatory: 10 elements
Prohibited: 24 elements
Structures
This structure refers to these other structures:
Extensions
This structure refers to these extensions:
Slices
This structure defines the following Slices:
Other representations of profile: CSV, Excel, Schematron
Read Operation:
SHALL support reading DocumentReference using its resource id:
GET [base]/DocumentReference/[id]
Example:
Implementation Notes: Fetches the clinical document that matches the given resource reference id. DIPS document ids carry the ako prefix.
Search Parameters:
The following search parameters and search parameter combinations SHALL be supported:
SHALL support searching DocumentReference using the _id search parameter:
GET [base]/DocumentReference?_id=[id]
Example:
Implementation Notes: Fetches a bundle of DocumentReference resources matching the given logical id. The service matches this parameter name case-insensitively and reads the numeric part of the value, so the ako prefix is optional.
SHALL support searching DocumentReference using the patient search parameter:
GET [base]/DocumentReference?patient=[id]
Example:
Implementation Notes: Fetches a bundle of all documents for the patient referenced by the given logical id ([how to search by reference]). The value must carry the cdp or Patient/cdp prefix; any other value is rejected with a 400 error.
SHALL support searching DocumentReference using the patient.identifier search parameter, where the value is the patient identifier qualified with its system:
GET [base]/DocumentReference?patient.identifier=[system]|[value]
Example:
| GET [base]/DocumentReference?patient.identifier=urn:oid:2.16.578.1.12.4.1.4.1 | 15076500565 |
Implementation Notes: Fetches a bundle of all documents for the patient with the given system-qualified identifier ([how to search by token]). Accepted systems are the DIPS patient id (http://dips.no/fhir/namingsystem/dips-patientid), the national identity number, the D-number and the temporary identity number ("Hjelpenummer"). An unqualified value is accepted only when it is a valid national identity number. Any other system is rejected with a 400 error.
SHALL support searching DocumentReference using the encounter.episodeofcare search parameter:
GET [base]/DocumentReference?encounter.episodeofcare=[id]
Example:
Implementation Notes: Fetches a bundle of all documents recorded on the given episode of care ("Omsorgsepisode"). Supports a comma separated list of numeric ids. The value may also be an empty string, or null to match documents with no episode of care. A value containing letters is rejected.
SHALL support searching DocumentReference using the encounter.hospitalization search parameter:
GET [base]/DocumentReference?encounter.hospitalization=[id]
Example:
Implementation Notes: Fetches a bundle of all documents recorded on the given hospital stay. Supports a comma separated list of numeric ids, an empty string, or null. A value containing letters is rejected.
SHALL support searching DocumentReference using the period.start search parameter:
GET [base]/DocumentReference?period.start=[date]
Example:
Implementation Notes: Restricts the result to documents whose event time falls on or after the given date. The value must be formatted as yyyy-MM-dd or yyyy-MM-ddTHH:mm:ss; any other format is rejected. Note this is not a standard FHIR date search - prefixes such as gt and ge are not supported.
SHALL support searching DocumentReference using the period.end search parameter:
GET [base]/DocumentReference?period.end=[date]
Example:
Implementation Notes: Restricts the result to documents whose event time falls on or before the given date, using the same two formats as period.start. A date-only value is widened to the end of that day (T23:59:59), so the day itself is included.
SHALL support searching DocumentReference using the includebinary search parameter:
GET [base]/DocumentReference?patient=[id]&includebinary=true
Example:
Implementation Notes: When set to true (matched case-insensitively), the attachment content is embedded in each returned document's content.attachment rather than being left as a Binary URL to fetch separately. Any other value, or omitting the parameter, leaves the attachments as URLs.
Search Result Parameters:
The _count, _sort and page parameters are supported for paging and ordering, and _summary=count returns the number of matching documents without the documents themselves.
Create Operation:
SHALL support creating a DocumentReference:
POST [base]/DocumentReference
Implementation Notes: Creates a clinical document. subject, author, custodian, type and content.attachment are required, and the document metadata is carried in this profile's extensions. Creating a dictation additionally requires DIPSDocumentReferenceTemplateIdExtension and DIPSDocumentReferenceDictatedTime. The extensions are matched on their exact URL, so an extension sent under any other URL is ignored rather than rejected.
Update Operation:
SHALL support updating a DocumentReference using its resource id:
PUT [base]/DocumentReference/[id]
Example:
Implementation Notes: Updates an existing document. Both the resource id and a request body are required; either being absent is rejected with a 400 error.
Operations:
SHALL support the $CanCreateDocument operation:
POST [base]/DocumentReference/$CanCreateDocument
Implementation Notes: Reports whether the current user may create documents. The optional UserRoleId input parameter checks a specific user role rather than the one carried on the JWT or DIPS ticket. Returns CanCreateDocument (boolean, always present) and, when access is denied, Reason (OperationOutcome).
SHALL support the $initDocument operation:
POST [base]/DocumentReference/$initDocument
Implementation Notes: Returns an initial document built from a document type. The documentTypeId input parameter is required and must be a Coding with both a system and a code; an optional templateId selects the template. A document type that does not exist, or a template that does not belong to the given document type, is rejected with a 422 error.
Named Queries:
The following named queries are supported through the _query parameter. An unrecognised value is rejected.
SHALL support the documenttype named query:
GET [base]/DocumentReference?_query=documenttype&documenttypeids=[ids]&patient=[id]
Implementation Notes: Filters a patient's documents by document type. Accepts a comma separated list of document type ids.
SHALL support the DepartmentId named query:
GET [base]/DocumentReference?_query=DepartmentId&DepartmentId=[ids]&period.start=[date]&period.end=[date]
Implementation Notes: Filters documents by department over a date range.
SHALL support the documentTypeandDepartmentid named query:
GET [base]/DocumentReference?_query=documentTypeandDepartmentid&DepartmentId=[ids]&documenttypeids=[ids]&period.start=[date]&period.end=[date]
Implementation Notes: Filters documents by both document type and department over a date range.
SHALL support the eprgroupprofile named query:
GET [base]/DocumentReference?_query=eprgroupprofile&eprgroups=[ids]&patient=[id]
Implementation Notes: Filters a patient's documents by EPR group. Accepts a comma separated list of numeric group ids; a value containing letters is rejected.
SHALL support the showtechnicaldocumentstatus named query:
GET [base]/DocumentReference?_query=showtechnicaldocumentstatus&showdocumentstatus=[value]&patient=[id]
Implementation Notes: Controls whether technical documents are included. Supported values are showboth, showonlytechnical and HideTechnical. Ordinary searches hide technical documents by default.
SHALL support the booleanfilters named query:
GET [base]/DocumentReference?_query=booleanfilters&showdeleted=[bool]&showactivedocument=[bool]&showoldversions=[bool]&patient=[id]
Implementation Notes: Controls whether deleted documents, active documents and superseded versions are included. Each parameter takes true or false. Ordinary searches return active, non-deleted documents only.
SHALL support the viewdocumenttypestemplate named query:
GET [base]/DocumentReference?_query=viewdocumenttypestemplate&text=[name]
Implementation Notes: Returns document types and the templates connected to each. Query by name with text (starts-with), text:contains or text:exact, or by id with documenttypeid. These four parameters work only with this named query - an ordinary search containing any of them is rejected.
SHALL support the journalgroupsprofile named query:
GET [base]/DocumentReference?_query=journalgroupsprofile&patient=[id]
Implementation Notes: Filters a patient's documents by journal group.
SHALL support the pagesummary named query:
GET [base]/DocumentReference?_query=pagesummary&patient=[id]
Implementation Notes: Returns a page summary over the matching documents.
Interactions that are not supported:
vread, history and delete return 404, and patch returns 501.