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-11-17 | 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 |
Three operations are supported in addition to the interactions above, $CanCreateDocument, $initDocument and $inithometreatment, along with nine named queries invoked through the _query parameter. All are documented below.
Home treatment (DHO) documents are documents linked to a remote monitoring period (see DIPS Remote Monitoring). They are created through the ordinary create interaction; the service recognises them and fills in the monitoring period, document type, author and department. See the Create Operation and $inithometreatment notes 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
Create a home treatment document for a patient's remote monitoring period, or first preview it with $inithometreatment
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: 5 elements(4 nested mandatory 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: 5 elements(4 nested mandatory 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 (for a home treatment document the service fills in author, custodian and type, see below), 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.
The document content does not have to be the first content entry: the first attachment carrying data is taken as the document. An encounter or referral of 0 means none, the same as leaving it out. A document type that does not exist is rejected with 400 ERR077. An identifier with system http://dips.no/fhir/namingsystem/dips-externalId is the document's external id: if it is already mapped to a document of the same patient, the create saves a new version of that document; if it belongs to another patient, the create is rejected with 422 ERR075.
Home treatment (DHO) documents: a document is a home treatment document when context.encounter is EpisodeOfCare/[monitoring period id] (the period's GUID, see DIPS Remote Monitoring), or when a type.coding matches a document type configured with ContactType: EpisodeOfCare in the service's DocMetadataMappings. Every other document is created as described above. For a home treatment document the service:
context.encounter, which must belong to the patient in subject; otherwise by the patient and the document type. Several periods are narrowed by active status and the posted department.type.coding; other posted codings are kept.author when none is posted: the configured default author, then the period's responsible health care party.custodian (the department) and the Section and Ward extensions from the period when none are posted.The create response carries context.encounter = EpisodeOfCare/[period id]. This is not stored with the document, so a later read or search does not show it. context.encounter = EpisodeOfCare/ followed by anything other than a monitoring period id (for example an Arena episode of care id) is rejected. Rejections are 400 with one of these codes in the OperationOutcome: ERR061 (the period id does not match a period of this patient), ERR063 (more than one period matches), ERR064, ERR065 and ERR066 (the document type could not be resolved from the monitoring type), ERR067 (the remote monitoring service call failed), ERR072 (EpisodeOfCare/ without a period id), ERR078 (no patient that can be resolved) and ERR079 (no period for the patient and document type).
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.
DIPSDocumentReferenceLastUpdatedTime extension must carry the last updated time that was read. If the document has been changed since, the update is rejected with 409 Conflict and ERR074: read the document again and reapply the change.subject naming another patient than the stored document's is rejected with 422 ERR076; a document cannot be moved to another patient.context.encounter) or referral (DIPSDocumentReferenceReferralId) of 0, as a reference (Encounter/agy0, ServiceRequest/ahr0) or as an identifier value, removes it from the document. Leaving the element out keeps the stored value.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 and template, for the client to fill in and create. The input is a Parameters resource:
documentTypeId (Coding with both a system and a code; a system other than http://dips.no/fhir/namingsystem/dips-documenttypeid is resolved through the service's external document type mapping), templateId, patientId, departmentId (strings holding numeric ids) and eventTime (dateTime).authorId (when left out, the default author configured for the document type is used), plannedContactId, episodeofcareId, referralId and description.A missing or invalid parameter is rejected with 422 and its own error code: ERR011 documentTypeId, ERR012 templateId, ERR042 patientId, ERR013 authorId (also when it is left out and no default author is configured), ERR014 departmentId, ERR015 plannedContactId, ERR016 episodeofcareId, ERR073 referralId, ERR017 eventTime. A template that does not belong to the given document type is also rejected with 422. The department is returned as custodian.
SHALL support the $inithometreatment operation:
POST [base]/DocumentReference/$inithometreatment
Implementation Notes: Returns a home treatment (DHO) document as the create interaction would save it, without saving anything. The input is the DocumentReference as it would be posted to create, sent either as the request body or as the resource parameter of a Parameters resource. The output (return) is that DocumentReference with the values the create would fill in: context.encounter = EpisodeOfCare/[monitoring period id], the DIPS document type first in type.coding (other posted codings kept), author, custodian (the period's department, unless one was posted) and the Section and Ward extensions. Posting the result unchanged to create saves the document.
It works out these values exactly as the create does for a home treatment document (see the Create Operation notes), except that the document does not need to pass the home treatment check: calling the operation is enough. Errors are the same 400 codes. If the external id is already mapped to a document of the same patient, the result carries that document's id (the create will then save a new version of it); if it belongs to another patient, the operation is rejected with 422 ERR075. If home treatment is turned off in the service, the operation returns 400.
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.