Skip to content

DiagnosticReport Profile

Canonicalhttps://fhir.apps.health/StructureDefinition/nexus-emr-core-diagnosticreport
Statusdraft · 1.33.0
BaseDiagnosticReport (constraint)
SourceFSH · JSON

Defines the Nexus EMR FHIR profile for DiagnosticReport resources, based on CA-Core constraints, for aggregating diagnostic reports (e.g., Lab, Imaging) from multiple EMRs. Today Nexus EMR writes every report received over HRM, of any class, and every laboratory feed with coded results here; documents uploaded or scanned are a DocumentReference. Which resource a received report should become is not yet settled, so a reader should expect a received report on either. See Incoming reports.

FSH

The authored source of truth: resources/StructureDefinition-nexus-emr-core-diagnosticreport.fsh (edit on GitHub). One FSH file may define several related artifacts.

// NexusEmrCoreDiagnosticReport.fsh
// DIAGNOSTIC-SERVICE REPORTS -- laboratory, pathology, imaging, cardio-respiratory and other
// diagnostic tests, whether they arrive as structured results, as a rendered report, or both.
//
// WHERE A RECEIVED REPORT LANDS IS OPEN. Today Nexus EMR writes every report received over HRM, of
// any class, and every laboratory feed with coded results here; documents uploaded or scanned are a
// DocumentReference. Which resource a received report should become, by channel or by content, and
// how its later versions and duplicates are represented, are not yet settled. See the Incoming
// reports page in the guide.

Alias: $NexusEmrCoreDiagnosticReport = https://fhir.apps.health/StructureDefinition/nexus-emr-core-diagnosticreport

// A LOINC CODE IS WRITTEN UNDER http://loinc.org, WHATEVER SYSTEM IT ARRIVED UNDER. The rule, and
// why it is a warning, is with LoincSystemRule in rulesets.fsh; this key applies it to `code`.
Invariant:     nexus-diagnosticreport-code-loinc-system
* insert LoincSystemRule(code)

// Profile Definition
Profile:        NexusEmrCoreDiagnosticReport
Parent:         DiagnosticReport
Id:             nexus-emr-core-diagnosticreport
Title:          "DiagnosticReport Profile"
Description:    "Defines the Nexus EMR FHIR profile for DiagnosticReport resources, based on CA-Core constraints, for aggregating diagnostic reports (e.g., Lab, Imaging) from multiple EMRs. Today Nexus EMR writes every report received over HRM, of any class, and every laboratory feed with coded results here; documents uploaded or scanned are a DocumentReference. Which resource a received report should become is not yet settled, so a reader should expect a received report on either. See [Incoming reports](../guide/patterns/incoming-reports.md)."
* insert UniversalProfile
* ^url = $NexusEmrCoreDiagnosticReport // Canonical URL from alias
* ^status = #draft
* obeys nexus-diagnosticreport-code-loinc-system
// A report awaiting a patient match has no subject (see AwaitingPatientSubject in rulesets.fsh).
* insert AwaitingPatientSubject

// THE effective date for this profile (see the EffectiveDate / NoEffectiveDate
// RuleSets): one date concept per resource, declared here rather than guessed.
* insert EffectiveDate([[effectiveDateTime | effectivePeriod.start | issued]])

// Salient fields — the reader/render surface (see SalientField + the Salient RuleSet).
* insert Salient(code, code, coded)
* insert Salient(status, status, code)
* insert Salient(category, category, coded)
* insert Salient(effective, [[effectiveDateTime | effectivePeriod.start]], dateTime)
* insert Salient(issued, issued, dateTime)
* insert Salient(conclusion, conclusion, string)
// The report's attached narrative (the rendered lab/imaging report). Same `base64Binary` kind as
// DocumentReference.data: decoded on read, long-form for rendering and the prose budget. Without
// this a report's own text never reaches a reader — only its coded conclusion does. Rendered as
// `prose` (reader-facing) while the accessor stays `data` (element-faithful).
* insert SalientAs(data, [[presentedForm.first().data]], base64Binary, prose)

// SMART on FHIR exposure -- this resource is reachable by an app, and these are the
// permissions each operation costs (see SmartExposed + the SmartExposed RuleSet).
* insert SmartExposed(diagnosticreport)

* . ^short      = "Nexus EMR Diagnostic Report Core"
* . ^definition = """
  Represents diagnostic test results and findings, capturing key details
  like report status, code, subject, and result references using standard
  Nexus EMR references. Uses instance-specific identifiers for tracking
  diagnostic reports across systems.
  """

* meta.source 0..1 MS
* meta.source ^short = "Identifies EMR instance & pipeline version the resource came from"
* meta.source ^definition = "A URI that identifies the EMR pipeline and version from which this resource originated.  This tells you which EMR instance (recommend using the instance identifier), and the version of the pipeline code/transformations."

* text 0..1 MS // Narrative element with human-readable summary
* text ^short = "Narrative"
* text ^definition = "A human-readable narrative summary of the NexusEmrCoreDiagnosticReport resource for human interpretation."  

// Identifier: A business identifier is recommended but not required (any system).
* identifier 0..* MS
* identifier.system 1..1
* identifier.value 1..1
* identifier ^short = "Business identifier(s) for diagnostic report"
* identifier ^definition = """
Unique identifiers for the diagnostic report.

A business identifier is recommended but not required (identifier is 0..*). Where available, carry the source-system identifier using the most appropriate system URI. No specific canonical system is mandated.

A source system's own identifier SHOULD be carried alongside this one, flagged `use = secondary`. See [Carrying the raw code](../guide/patterns/raw-codes.md).
"""


// Status: final, preliminary, amended, etc. Mandatory and MS.
* status 1..1 MS
* status ^short = "Where the report is in its lifecycle"
* status ^definition = "The status of the diagnostic report. Indicates whether the report is complete and verified."
* status ^comment = "This is a modifier element. Preliminary reports should be interpreted with caution."
* status from http://hl7.org/fhir/ValueSet/diagnostic-report-status (required)

// Code: Specific type of report (CBC, Chest X-ray). Mandatory and MS.
* code 1..1 MS
* code ^short = "Diagnostic report type with raw code support"
* insert SourceCoding(code)
* code ^definition = """
Type of diagnostic report (e.g., CBC, Chest X-ray, Lipid Panel).

REQUIRED: text element for human readability
RECOMMENDED: LOINC or other standard terminology when available
OPTIONAL: Raw EMR codes for source system preservation

Nexus EMR does not mandate a specific coding system for diagnostic report types.
The text element ensures human readability even when coded values are not recognized.
"""
* code.text 1..1 MS
* code.text ^short = "Human-readable report type description (required)"
* code.text ^definition = "Plain text representation of the diagnostic report type, required for all entries"


// Category: Service category with raw code support
* category 0..* MS
* category ^short = "Service category with raw code support"
* category ^definition = """
Classification of the clinical discipline, department or diagnostic service that created the report.

RECOMMENDED: Standard terminology codes (e.g., HL7 Diagnostic Service Section Codes)
OPTIONAL: Raw EMR codes for source system preservation

Multiple categories may be specified to classify the report in different ways.
"""


// Subject: Who the report is about. MS. Use identifier.
//
// `0..1` rather than `1..1`, guarded by `nexus-subject-unless-awaiting-patient`:
// a report AWAITING A PATIENT MATCH is about a patient not yet identified. Read the cardinality with
// that invariant, not on its own -- for every other report the requirement is exactly what it was.
* subject 0..1 MS
* subject ^short = "The patient the report is about"
* subject ^definition = """
The patient who is the subject of the diagnostic report. Required for every report EXCEPT one
awaiting a patient match, which carries the `awaiting-patient` tag under
CodeSystem/nexus-filing-state until it is matched; `nexus-subject-unless-awaiting-patient`
states that rule in evaluable form, and `nexus-awaiting-patient-has-no-subject`
forbids a subject alongside the tag. Matching sets this element and removes the tag in the same
write, on the report and on every Observation in `result`.
"""
* subject ^comment = "Required unless the report is awaiting a patient match. References should use identifier-based references following Nexus EMR patterns."
* subject only Reference(NexusEmrCorePatient)

// Encounter: Associated healthcare event. Optional. Use identifier.
* encounter 0..1 MS
* encounter ^short = "Healthcare event when report was generated"
* encounter ^definition = "The encounter during which this diagnostic report was generated. Optional but provides important clinical context."
* encounter ^comment = "Linking to encounter helps establish the clinical context and timing of the diagnostic testing."
* encounter only Reference(NexusEmrCoreEncounter)

// Effective[x]: Clinically relevant time. Mandatory and MS.
* effective[x] 1..1 MS
* effective[x] ^short = "Clinically relevant time/time-period for report"
* effective[x] ^definition = "The time or time-period the observed values are related to. This is usually the time specimen was collected or imaging was performed."
* effective[x] ^comment = "For lab reports, this is typically when specimen was collected. For imaging, when the images were taken."
* effective[x] only dateTime or Period

// Issued: Date/time report was released
* issued ^short = "DateTime report was released"
* issued ^definition = "The date and time that this version of the report was made available to providers."
* issued ^comment = "May be different from the effective date, especially for amended reports. This is the report's own issue time, not when this clinic received it: a received report's received time is the extensions-pack `event-recorded` extension (http://hl7.org/fhir/StructureDefinition/event-recorded)."

// Result: Observations that are part of this report
* result ^short = "Observations that are part of this report"
* result ^definition = "References to the Observations that are part of this diagnostic report."
* result ^comment = "Individual results are represented as separate Observation resources."
* result only Reference(NexusEmrCoreObservation)

// Imaging linkage: the imaging half of results viewing. The patient cache
// already traverses this containment edge; the profile now names the target.
// `imagingStudy` IS DELIBERATELY UNPROFILED AND NO LONGER MUST-SUPPORT, as of 1.22.0. It was
// `0..* MS` pointing at a `NexusEmrCoreImagingStudy` profile that this guide withdrew: nothing in
// this estate produces DICOM acquisition metadata, so the profile described a shape with no
// producer and this element required consumers to support a reference that is never populated.
// The element survives at its base R4 definition -- a report that DOES come from a system holding
// studies may still carry it -- but this guide makes no claim about it and asks nothing of a
// consumer. The imaging REPORT is the modelled artifact; see the intro page.
* imagingStudy ^comment = "Left at base R4. This guide withdrew its ImagingStudy profile in 1.22.0 and models the imaging report rather than the DICOM acquisition, so nothing here produces this reference and no consumer is required to resolve it."

// Review state: who acknowledged this result and when; ABSENT = unreviewed.
// The Task inbox is the review workflow; this is the queryable state it stamps.
* extension contains NexusEmrReviewed named reviewed 0..1 MS
* extension[reviewed] ^short = "Review acknowledgement (absent = unreviewed)"
// MODALITY, on the report. R4 has no element for it here -- it is an `ImagingStudy` property, and
// this guide withdrew its ImagingStudy profile in 1.22.0 because nothing in this estate produces
// DICOM acquisition metadata. Imaging results are a required capability (ON RFP 1.5.4.2) and
// modality is one of the imaging report's expected fields, so without this the requirement has no
// home. It describes the DOCUMENT (this report came from a CT), which needs no PACS to be honest
// about. Absent on a laboratory report, which has no modality.
* extension contains NexusImagingModality named imagingModality 0..* MS
* extension[imagingModality] ^short = "Acquisition modality (imaging reports; repeats for PET-CT)"

// Recipients: who a received report was addressed to, primary or copied, as the sender stated it.
// R4 has no element for it; see the extension for why one extension with a role.
* extension contains NexusReportRecipient named recipient 0..* MS
* extension[recipient] ^short = "A recipient of the report, primary (PRCP) or copied (TRC)"

// Notes: R4 DiagnosticReport has no `note` (R5 adds one), so a clinic's comments on a report ride
// the resource-note extension, exactly as they do on a DocumentReference. Not the place for the
// laboratory's own report comment, which is part of the report as issued.
* extension contains ResourceNoteExtension named note 0..* MS
* extension[note] ^short = "A note on the report, in the Task Note turn shape (ordered by time)"


// Conclusion: Clinical conclusion of the report
* conclusion ^short = "Clinical conclusion (interpretation) of test results"
* conclusion ^definition = "Concise and clinically contextualized summary conclusion of the diagnostic report."
* conclusion ^comment = "The narrative conclusion shall only contain filtered information from the report."

// Conclusion Code: Coded conclusions
* conclusionCode ^short = "Codes for the clinical conclusion"
* insert SourceCoding(conclusionCode)
* conclusionCode ^definition = "Coded representation of the conclusion."
* conclusionCode from http://hl7.org/fhir/ValueSet/clinical-findings (example)

// Presented Form: Rendered report (e.g., PDF). Optional.
* presentedForm 0..*
* presentedForm ^short = "Entire report as issued"
* presentedForm ^definition = "Rich text representation of the entire result as issued by the diagnostic service."
* presentedForm ^comment = "Multiple formats of the same report may be provided (e.g., PDF and HTML)."
* presentedForm.contentType 1..1
* presentedForm.contentType ^short = "Mime type of the content (e.g., application/pdf)"
* presentedForm.data 0..1
* presentedForm.data ^short = "Data inline, base64 encoded"
* presentedForm.url 0..1