Release 5 Ballot

This page is part of the FHIR Specification (v5.0.0: (v5.0.0-ballot: R5 Ballot - STU see ballot notes ). This is the The current published version in it's permanent home (it will always be available at which supercedes this URL). version is 5.0.0 . For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R2

Example OperationDefinition/Patient-merge (Turtle)

8.17 Resource Substance - Content

Patient Administration Biomedical Research and Regulation icon Work Group Maturity Level : N/A 2   Trial Use Standards Status : Informative Security Category : Business Compartments : Not linked to any defined compartments

A homogeneous material with a definite composition.

This is a base resource that represents raw materials used to represent a packaged or measured amount of a known substance (e.g. bottle, jar, packet, drum) that is not in a consumable form nor associated directly with a patient. For example, the materials used for a medication that are not yet in an administrable form.

The resource can be used to represent either a kind of a substance - e.g. a formulation commonly used for treating patients (a "definitional" use of Substance), or it can be used to describe a particular package of a known substance (an "instance" use of Substance).

The composition of the material can be specified in terms of a mix of other materials, including with precise amounts if required.

A Substance may be identifiable as precise as the specific container it is stored in, while more commonly it would be based on a combination of lot number, quantity, and package type.

A medication is a substance that is packaged and used as an administered medication. The medication resource uses the substance resource to represent the actual ingredients of a medication. This resource can represent an instance of a substance or a definition (type, kind) of one. See also the SubstanceDefinition resource, which is purely definitional.

A SubstanceDefinition describes the common characteristics of the substance, including those needed for regulatory agencies.

A NutritionProduct distinguishes from a Substance in that a nutrition product is primary consumable purpose is for its nutritional effect.

A BiologicallyDerivedProduct distinguishes from a Substance in that a BiologicallyDerivedProduct has its origins in a biological entity and needs to carry the source’s characteristics to enable matching and compatibility with the biological target to which it will be transfused or implanted, as well as traceability to the source.

Raw Turtle Structure

Name (+ also see Turtle/RDF Format Specification Flags Card. Type Description & Constraints doco
.. Substance TU DomainResource A homogeneous material with a definite composition

Elements defined in Ancestors: id , meta , implicitRules , language , text , contained , extension , modifierExtension
... identifier Σ 0..* Identifier Unique identifier

... instance ?! Σ 1..1 boolean Is this an instance of a substance or a kind of one
... status ?! Σ 0..1 code active | inactive | entered-in-error
FHIRSubstanceStatus ( Required )
... code Σ 1..1 CodeableReference ( SubstanceDefinition ) What substance this is
Substance Code ( Example )
... description Σ 0..1 string Textual description of the substance, comments
... expiry Σ 0..1 dateTime When no longer valid to use
... quantity Σ 0..1 SimpleQuantity Amount of substance in the package
... ingredient Σ 0..* BackboneElement Composition information about the substance

.... quantity Σ 0..1 Ratio Optional amount (concentration)
.... substance[x] Σ 1..1 A component of the substance
Substance Code ( Example )
..... substanceCodeableConcept CodeableConcept
..... substanceReference Reference ( Substance )

doco Documentation for this format

See the Extensions for this resource

Operation Definition UML Diagram ( Legend )

@prefix fhir: <http://hl7.org/fhir/> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . # - resource ------------------------------------------------------------------- [] a fhir:OperationDefinition ; fhir:id [ fhir:v "Patient-merge"] ; fhir:text [ fhir:status [ fhir:v "extensions" ] ] ; fhir:extension ( [ fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" ] ; fhir:value [ fhir:v "0" ] ] [ fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" ] ; fhir:value [ fhir:v "trial-use" ] ] ) ; fhir:url [ fhir:v "http://hl7.org/fhir/OperationDefinition/Patient-merge"], [ fhir:v "http://hl7.org/fhir/OperationDefinition/Patient-merge"] ; fhir:version [ fhir:v "5.0.0"], [ fhir:v "5.0.0"] ; fhir:name [ fhir:v "Merge"], [ fhir:v "Merge"] ; fhir:title [ fhir:v "Patient Merge"], [ fhir:v "Patient Merge"] ; fhir:status [ fhir:v "draft"], [ fhir:v "draft"] ; fhir:experimental [ fhir:v "false"], [ fhir:v "false"] ; fhir:date [ fhir:v "2023-03-26T15:21:02+11:00"], [ fhir:v "2023-03-26T15:21:02+11:00"] ; fhir:publisher [ fhir:v "HL7 (FHIR Project)"], [ fhir:v "HL7 (FHIR Project)"] ; fhir:contact ( [ fhir:telecom ( [ fhir:system [ fhir:v "url" ] ; fhir:value [ fhir:v "http://hl7.org/fhir" ] ] [ fhir:system [ fhir:v "email" ] ; fhir:value [ fhir:v "fhir@lists.hl7.org" ] ] ) ] [ fhir:telecom ( [ fhir:system [ fhir:v "url" ] ; fhir:value [ fhir:v "http://hl7.org/fhir" ] ] [ fhir:system [ fhir:v "email" ] ; fhir:value [ fhir:v "fhir@lists.hl7.org" ] ] ) ] ) ; fhir:description [ fhir:v "The merge operation is used to request two patient resources be merged. One of the two patients is identified as the source and one as the target. The data from the source patient will be merged with the data of the target patient.\r\rThe source Patient resource will be updated to add a new Patient.link reference to the target Patient resource with a link-type of replaced-by. The source Patient will also be updated to have a status of inactive, unless the source Patient resource was deleted.\r\rThe target Patient resource will be updated to add a new Patient.link reference to the source Patient resource with a link-type of replaces unless the source Patient resource is deleted. The target Patient resource must be included in the result-patient parameter if used."], [ fhir:v "The merge operation is used to request two patient resources be merged. One of the two patients is identified as the source and one as the target. The data from the source patient will be merged with the data of the target patient.\r\rThe source Patient resource will be updated to add a new Patient.link reference to the target Patient resource with a link-type of replaced-by. The source Patient will also be updated to have a status of inactive, unless the source Patient resource was deleted.\r\rThe target Patient resource will be updated to add a new Patient.link reference to the source Patient resource with a link-type of replaces unless the source Patient resource is deleted. The target Patient resource must be included in the result-patient parameter if used."] ; fhir:jurisdiction ( [ fhir:coding ( [ fhir:system [ fhir:v "http://unstats.un.org/unsd/methods/m49/m49.htm" ] ; fhir:code [ fhir:v "001" ] ; fhir:display [ fhir:v "World" ] ] ) ] [ fhir:coding ( [ fhir:system [ fhir:v "http://unstats.un.org/unsd/methods/m49/m49.htm" ] ; fhir:code [ fhir:v "001" ] ; fhir:display [ fhir:v "World" ] ] ) ] ) ; fhir:kind [ fhir:v "operation"] ; fhir:affectsState [ fhir:v "true"] ; fhir:code [ fhir:v "merge"] ; fhir:comment [ fhir:v "There must be exactly 1 source patient, which may be identified by either the source-patient or source-patient-identifier parameters. Similarly, there must be exactly 1 target patient, identified by either the target-patient or target-patient-identifier parameters. In both cases, either a reference to the patient or a list of identifiers that can be used to identify the patient may be provided, but not both.\r\rThe result-patient.id must be the same as the target patient reference (if the patient reference is provided as an input parameter).\r\rIf a client needs the server to create a new patient merged from the 2 patient resources, the client should create a new patient record and then call the merge operation to merge each source patient resource into the newly created patient resource.\r\rA server may decide to delete the source record, but this is not defined by the standard merge operation, and if this occurs then the target patient's link property will remain unchanged.\r"] ; fhir:resource ( [ fhir:v "Patient"] ) ; fhir:system [ fhir:v "false"] ; fhir:type [ fhir:v "true"] ; fhir:instance [ fhir:v "false"] ; fhir:parameter ( [ fhir:name [ fhir:v "source-patient" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0" ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "A direct resource reference to the **source** patient resource (this may include an identifier)." ] ; fhir:type [ fhir:v "Reference" ] ; fhir:targetProfile ( [ fhir:v "http://hl7.org/fhir/StructureDefinition/Patient" ] ) ] [ fhir:name [ fhir:v "source-patient-identifier" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0" ] ; fhir:max [ fhir:v "*" ] ; fhir:documentation [ fhir:v "When source-patient-identifiers are provided, the server is expected to perform an internal lookup to identify the source patient record. The server SHALL reject the request if the provided identifiers do not resolve to a single patient record. This resolution MAY occur asynchronously, for example, as part of a review by a user." ] ; fhir:type [ fhir:v "Identifier" ] ] [ fhir:name [ fhir:v "target-patient" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0" ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "A direct resource reference to the **target** patient resource.\r\rThis is the surviving patient resource, the target for the merge." ] ; fhir:type [ fhir:v "Reference" ] ; fhir:targetProfile ( [ fhir:v "http://hl7.org/fhir/StructureDefinition/Patient" ] ) ] [ fhir:name [ fhir:v "target-patient-identifier" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0" ] ; fhir:max [ fhir:v "*" ] ; fhir:documentation [ fhir:v "When target-patient-identifiers are provided, the server is expected to perform an internal lookup to identify the target patient record. The server SHALL reject the request if the provided identifiers do not resolve to a single patient record. This resolution MAY occur asynchronously, for example, as part of a review by a user." ] ; fhir:type [ fhir:v "Identifier" ] ] [ fhir:name [ fhir:v "result-patient" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0" ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "The details of the Patient resource that is expected to be updated to complete with and must have the same patient.id and provided identifiers included.\r\rThis resource MUST have the link property included referencing the source patient resource.\r\rIt will be used to perform an update on the target patient resource.\r\rIn the absence of this parameter the servers should copy all identifiers from the source patient into the target patient, and include the link property (as shown in the example below).\r\rThis is often used when properties from the source patient are desired to be included in the target resource.\r\rThe receiving system may also apply other internal business rules onto the merge which may make the resource different from what is provided here." ] ; fhir:type [ fhir:v "Patient" ] ] [ fhir:name [ fhir:v "preview" ] ; fhir:use [ fhir:v "in" ] ; fhir:min [ fhir:v "0" ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "If this is set to true then the merge will not be actually performed; an OperationOutcome will be returned in the Parameters response that will indicate that no merge has occurred and may include other diagnostic info if desired, such as the scale of the merge.\r\re.g. Issue.details.text \"Preview only Patient merge - no issues detected\"\r\re.g. Issue.diagnostics \"Merge would update: 10 years of content or 120 resources\"\r\rThe resulting target patient resource will also be returned in the result." ] ; fhir:type [ fhir:v "boolean" ] ] [ fhir:name [ fhir:v "return" ] ; fhir:use [ fhir:v "out" ] ; fhir:min [ fhir:v "1" ] ; fhir:max [ fhir:v "1" ] ; fhir:documentation [ fhir:v "The status of the response will be one of:\r\r* 200 OK - If the merge request doesn't expect any issues (although warning may be present) for a preview, or was completed without issues if not a preview\r* 202 Accepted - The merge request has been accepted and does not expect any issues and will continue processing the merge in the background, and you can monitor the Task for completion\r* 400 Bad Request - There are errors in the input parameters that need to corrected\r* 422 Unprocessable Entity - Business rules prevent this merge from completing\r\rThe Parameters resource will include:\r\r* The Input parameters to the operation\r* An OperationOutcome containing errors, warnings, and information messages\r* The resulting merged Patient resource (or a patient reference if the patient is not committed)\r* Optionally a Task resource to track any additional processing that was required." ] ; fhir:type [ fhir:v "Parameters" ] ] ) .
Substance ( DomainResource ) Unique identifier for the substance. For an instance, an identifier associated with the package/container (usually a label affixed directly) identifier : Identifier [0..*] A boolean to indicate if this an instance of a substance or a kind of one (a definition) (this element modifies the meaning of other elements) instance : boolean [1..1] A code to indicate if the substance is actively used (this element modifies the meaning of other elements) status : code [0..1] « null (Strength=Required) FHIRSubstanceStatus ! » A code that classifies the general type of substance. This is used for searching, sorting and display purposes category : CodeableConcept [0..*] « null (Strength=Extensible) SubstanceCategoryCodes + » A code (or set of codes) that identify this substance code : CodeableReference [1..1] « SubstanceDefinition ; null (Strength=Example) SubstanceCode ?? » A description of the substance - its appearance, handling requirements, and other usage notes description : string [0..1] When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry expiry : dateTime [0..1] The amount of the substance quantity : Quantity ( SimpleQuantity ) [0..1] Ingredient The amount of the ingredient in the substance - a concentration ratio quantity : Ratio [0..1] Another substance that is a component of this substance substance[x] : DataType [1..1] « CodeableConcept | Reference ( Substance ); null (Strength=Example) SubstanceCode ?? » A substance can be composed of other substances ingredient [0..*]

XML Template


<Substance xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <identifier><!-- 0..* Identifier Unique identifier --></identifier>
 <instance value="[boolean]"/><!-- 1..1 Is this an instance of a substance or a kind of one -->
 <status value="[code]"/><!-- 0..1 active | inactive | entered-in-error -->
 <category><!-- 0..* CodeableConcept What class/type of substance this is --></category>
 <code><!-- 1..1 CodeableReference(SubstanceDefinition) What substance this is --></code>
 <description value="[string]"/><!-- 0..1 Textual description of the substance, comments -->
 <expiry value="[dateTime]"/><!-- 0..1 When no longer valid to use -->
 <quantity><!-- 0..1 Quantity(SimpleQuantity) Amount of substance in the package --></quantity>
 <ingredient>  <!-- 0..* Composition information about the substance -->
  <quantity><!-- 0..1 Ratio Optional amount (concentration) --></quantity>
  <substance[x]><!-- 1..1 CodeableConcept|Reference(Substance) A component of the substance --></substance[x]>
 </ingredient>
</Substance>

Turtle Template


@prefix fhir: <http://hl7.org/fhir/> .doco


# -------------------------------------------------------------------------------------


[ a fhir:Substance;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root


  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:Substance.identifier [ Identifier ], ... ; # 0..* Unique identifier
  fhir:Substance.instance [ boolean ]; # 1..1 Is this an instance of a substance or a kind of one
  fhir:Substance.status [ code ]; # 0..1 active | inactive | entered-in-error
  fhir:Substance.category [ CodeableConcept ], ... ; # 0..* What class/type of substance this is
  fhir:Substance.code [ CodeableReference(SubstanceDefinition) ]; # 1..1 What substance this is
  fhir:Substance.description [ string ]; # 0..1 Textual description of the substance, comments
  fhir:Substance.expiry [ dateTime ]; # 0..1 When no longer valid to use
  fhir:Substance.quantity [ Quantity(SimpleQuantity) ]; # 0..1 Amount of substance in the package
  fhir:Substance.ingredient [ # 0..* Composition information about the substance
    fhir:Substance.ingredient.quantity [ Ratio ]; # 0..1 Optional amount (concentration)
    # Substance.ingredient.substance[x] : 1..1 A component of the substance. One of these 2
      fhir:Substance.ingredient.substanceCodeableConcept [ CodeableConcept ]
      fhir:Substance.ingredient.substanceReference [ Reference(Substance) ]
  ], ...;
]

Usage note: every effort has been made Changes since R4

Substance
Substance.instance
  • Min Cardinality changed from 0 to ensure that 1
  • Max Cardinality changed from * to 1
  • Type changed from BackboneElement to boolean
  • Now marked as Modifier
  • Now marked as Modifier
Substance.code
  • Type changed from CodeableConcept to CodeableReference
  • Type changed from CodeableConcept to CodeableReference
Substance.expiry
  • Added Element
Substance.quantity
  • Added Element
Substance.instance.identifier
  • deleted
Substance.instance.expiry
  • deleted
Substance.instance.quantity
  • deleted

See the examples are correct Full Difference for further information

This analysis is available as XML or JSON .

See R3 <--> R4 Conversion Maps (status = 6 tests that all execute ok. All tests pass round-trip testing and useful, but they 1 r3 resources are not invalid (0 errors). )

Structure

Name Flags Card. Type Description & Constraints doco
.. Substance TU DomainResource A homogeneous material with a normative part definite composition

Elements defined in Ancestors: id , meta , implicitRules , language , text , contained , extension , modifierExtension
... identifier Σ 0..* Identifier Unique identifier

... instance ?! Σ 1..1 boolean Is this an instance of a substance or a kind of one
... status ?! Σ 0..1 code active | inactive | entered-in-error
FHIRSubstanceStatus ( Required )
... code Σ 1..1 CodeableReference ( SubstanceDefinition ) What substance this is
Substance Code ( Example )
... description Σ 0..1 string Textual description of the specification. substance, comments
... expiry Σ 0..1 dateTime When no longer valid to use
... quantity Σ 0..1 SimpleQuantity Amount of substance in the package
... ingredient Σ 0..* BackboneElement Composition information about the substance

.... quantity Σ 0..1 Ratio Optional amount (concentration)
.... substance[x] Σ 1..1 A component of the substance
Substance Code ( Example )
..... substanceCodeableConcept CodeableConcept
..... substanceReference Reference ( Substance )

doco Documentation for this format

See the Extensions for this resource

UML Diagram ( Legend )

Substance ( DomainResource ) Unique identifier for the substance. For an instance, an identifier associated with the package/container (usually a label affixed directly) identifier : Identifier [0..*] A boolean to indicate if this an instance of a substance or a kind of one (a definition) (this element modifies the meaning of other elements) instance : boolean [1..1] A code to indicate if the substance is actively used (this element modifies the meaning of other elements) status : code [0..1] « null (Strength=Required) FHIRSubstanceStatus ! » A code that classifies the general type of substance. This is used for searching, sorting and display purposes category : CodeableConcept [0..*] « null (Strength=Extensible) SubstanceCategoryCodes + » A code (or set of codes) that identify this substance code : CodeableReference [1..1] « SubstanceDefinition ; null (Strength=Example) SubstanceCode ?? » A description of the substance - its appearance, handling requirements, and other usage notes description : string [0..1] When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry expiry : dateTime [0..1] The amount of the substance quantity : Quantity ( SimpleQuantity ) [0..1] Ingredient The amount of the ingredient in the substance - a concentration ratio quantity : Ratio [0..1] Another substance that is a component of this substance substance[x] : DataType [1..1] « CodeableConcept | Reference ( Substance ); null (Strength=Example) SubstanceCode ?? » A substance can be composed of other substances ingredient [0..*]

XML Template


<Substance xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <identifier><!-- 0..* Identifier Unique identifier --></identifier>
 <instance value="[boolean]"/><!-- 1..1 Is this an instance of a substance or a kind of one -->
 <status value="[code]"/><!-- 0..1 active | inactive | entered-in-error -->
 <category><!-- 0..* CodeableConcept What class/type of substance this is --></category>
 <code><!-- 1..1 CodeableReference(SubstanceDefinition) What substance this is --></code>
 <description value="[string]"/><!-- 0..1 Textual description of the substance, comments -->
 <expiry value="[dateTime]"/><!-- 0..1 When no longer valid to use -->
 <quantity><!-- 0..1 Quantity(SimpleQuantity) Amount of substance in the package --></quantity>
 <ingredient>  <!-- 0..* Composition information about the substance -->
  <quantity><!-- 0..1 Ratio Optional amount (concentration) --></quantity>
  <substance[x]><!-- 1..1 CodeableConcept|Reference(Substance) A component of the substance --></substance[x]>
 </ingredient>
</Substance>

Turtle Template


@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:Substance;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:Substance.identifier [ Identifier ], ... ; # 0..* Unique identifier
  fhir:Substance.instance [ boolean ]; # 1..1 Is this an instance of a substance or a kind of one
  fhir:Substance.status [ code ]; # 0..1 active | inactive | entered-in-error
  fhir:Substance.category [ CodeableConcept ], ... ; # 0..* What class/type of substance this is
  fhir:Substance.code [ CodeableReference(SubstanceDefinition) ]; # 1..1 What substance this is
  fhir:Substance.description [ string ]; # 0..1 Textual description of the substance, comments
  fhir:Substance.expiry [ dateTime ]; # 0..1 When no longer valid to use
  fhir:Substance.quantity [ Quantity(SimpleQuantity) ]; # 0..1 Amount of substance in the package
  fhir:Substance.ingredient [ # 0..* Composition information about the substance
    fhir:Substance.ingredient.quantity [ Ratio ]; # 0..1 Optional amount (concentration)
    # Substance.ingredient.substance[x] : 1..1 A component of the substance. One of these 2
      fhir:Substance.ingredient.substanceCodeableConcept [ CodeableConcept ]
      fhir:Substance.ingredient.substanceReference [ Reference(Substance) ]
  ], ...;
]

Changes since Release 4

Substance
Substance.instance
  • Min Cardinality changed from 0 to 1
  • Max Cardinality changed from * to 1
  • Type changed from BackboneElement to boolean
  • Now marked as Modifier
  • Now marked as Modifier
Substance.code
  • Type changed from CodeableConcept to CodeableReference
  • Type changed from CodeableConcept to CodeableReference
Substance.expiry
  • Added Element
Substance.quantity
  • Added Element
Substance.instance.identifier
  • deleted
Substance.instance.expiry
  • deleted
Substance.instance.quantity
  • deleted

See the Full Difference for further information

This analysis is available as XML or JSON .

See R3 <--> R4 Conversion Maps (status = 6 tests that all execute ok. All tests pass round-trip testing and 1 r3 resources are invalid (0 errors). )

 

Additional definitions: Master Definition XML + JSON , XML Schema / Schematron + JSON Schema , ShEx (for Turtle ) + see the extensions , the spreadsheet version & the dependency analysis

Path Definition Type Reference
Substance.status

A code to indicate if the substance is actively used.

Required FHIRSubstanceStatus
Substance.category

Substance category codes

Extensible SubstanceCategoryCodes
Substance.code

This value set contains concept codes for specific substances. It includes codes from SNOMED icon where concept is-a 105590001 (Substance (substance))

Example SubstanceCode
Substance.ingredient.substance[x]

This value set contains concept codes for specific substances. It includes codes from SNOMED icon where concept is-a 105590001 (Substance (substance))

Example SubstanceCode

Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.

Name Type Description Expression In Common
category token The category of the substance Substance.category
code D token The code of the substance or ingredient Substance.code.concept | (Substance.ingredient.substance as CodeableConcept)
code-reference D reference A reference to the defining substance Substance.code.reference
expiry N date Expiry date of package or container of substance Substance.expiry
identifier token Unique identifier for the substance Substance.identifier
quantity quantity Amount of substance in the package Substance.quantity
status N token active | inactive | entered-in-error Substance.status
substance-reference reference A component of the substance (Substance.ingredient.substance as Reference)
( Substance )