Update COMPOSITION

Updates COMPOSITION identified by uid_based_id and associated with the EHR identified by ehr_id.

The uid_based_id can take only a form of an HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a versioned_object_uid).

If the request body already contains a COMPOSITION.uid.value, it must match the uid_based_id in the URL.

The existing latest version_uid of COMPOSITION resource (i.e. the preceding_version_uid) must be specified in the If-Match header.

The optional openehr-item-tag request header replaces all ITEM_TAG resources associated with the target in the same transaction as the update.

Path Parameters
  • ehr_id
    Type: string
    required

    EHR identifier taken from EHR.ehr_id.value.

  • uid_based_id
    Type: string
    required

    An identifier in a form of a HIER_OBJECT_ID identifier taken from VERSIONED_OBJECT.uid.value (i.e. a versioned_object_uid).

Headers
  • If-Match
    Type: string
    required

    Header to make the request conditional. Together with ETag request tag, it helps to prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). The format is always an version_uid identifier enclosed by double quotes. The operation will be performed only if the existing latest version_uid of the resource (i.e. the preceding_version_uid) matches this header's value.

  • Prefer
    Type: string

    RFC 7240 preference header. Multiple tokens may be sent in a single header as a comma-separated list (e.g. Prefer: return=representation, include_item_tags) or as repeated headers. Cadasto recognises the following tokens:

    Token Where it applies Effect
    return=representation write endpoints Return the full updated resource in the response body.
    return=minimal (default on writes) write endpoints Empty response body.
    include_item_tags (Cadasto extension) read endpoints, and write endpoints when the request does not already carry an openehr-item-tag header Emit the openehr-item-tag response header with the current tags. On writes that ship openehr-item-tag in the request, the token is implied — the response always echoes the tags. Omitted by default on reads. See the ITEM_TAG guide for details.

    The Preference-Applied response header echoes the tokens the server actually honoured (return=, plus include_item_tags / resolve_refs when applied).

  • openehr-item-tag
    Type: array object[] ·

    The list of ITEM_TAG resources to associate with the current versioned object, committed in the same transaction as the create/update.

    Two interchangeable formats are accepted:

    • JSON (recommended) — same shape as the /tags endpoint body
    • Spec semicolon formatkey="...",value="..."; key="...",value="...",target_path="..."

    Cadasto exception: the openehr-version-item-tag request header — used by upstream openEHR to scope tags to a single VERSION — is not supported by Cadasto and will be rejected with 400 Bad Request. Tags are always scoped to the versioned object. See the item_tags guide for details and error formats.

    • key
      Type: string
      required

      Tag key (identifier). Stored case-insensitively.

    • target_path
      Type: string
      max length:  
      500

      Optional pointer into the target resource (AQL path). Maximum length 500 characters.

    • value
      Type: string

      Optional tag value.

Body·
required
application/json

The new COMPOSITION.

A COMPOSITION resource

  • archetype_node_id
    Type: string
    required
  • category
    Type: object ·
    required
  • composer
    required
    • _type
      Discriminator
      enum
      const:  
      PARTY_SELF
      required
      values
      • PARTY_SELF
    • external_ref
      Type: object ·

      Identifier for parties in a demographic or identity service.

  • content
    Type: array ·
    required
  • context
    Type: object ·
    required
  • language
    Type: object ·
    required
  • name
    required
    • _type
      Discriminator
      enum
      const:  
      DV_TEXT
      required
      values
      • DV_TEXT
    • value
      Type: string
      required
    • encoding
      Type: object ·
    • formatting
      Type: string
    • hyperlink
    • language
      Type: object ·
    • mappings
      Type: array object[] ·
  • territory
    Type: object ·
    required
  • _type
    Type: string
  • archetype_details
    Type: object ·
  • feeder_audit
    Type: object ·
  • Type: array object[] ·
Responses
  • application/json
  • application/json
  • 404

    404 Not Found is returned when an EHR with ehr_id does not exist, or when the uid_based_id does not exist.

  • 422

    422 Unprocessable Entity is returned when the content could be converted to a COMPOSITION, but there are semantic validation errors, such as the underlying template is not known or is not validating the supplied COMPOSITION.

Request Example for put/ehr/{ehr_id}/composition/{uid_based_id}
curl https://cataniamc.prod.cadasto.com/openehr/v1/ehr/7d44b88c-4199-4bad-97dc-d78268e01398/composition/8849182c-82ad-4088-a07f-48ead4180515 \
  --request PUT \
  --header 'If-Match: "6cb19121-4307-4648-9da0-d62e4d51f19b::cataniamc.prod.cadasto.com::1"' \
  --header 'Content-Type: application/json' \
  --data '{
  "archetype_node_id": "openEHR-EHR-COMPOSITION.encounter.v1",
  "name": {
    "value": "Vital Signs"
  },
  "uid": {
    "_type": "OBJECT_VERSION_ID",
    "value": "8849182c-82ad-4088-a07f-48ead4180515::cataniamc.prod.cadasto.com::1"
  },
  "archetype_details": {
    "archetype_id": {
      "value": "openEHR-EHR-COMPOSITION.encounter.v1"
    },
    "template_id": {
      "value": "Example.v1::c7ec861c-c413-39ff-9965-a198ebf44747"
    },
    "rm_version": "1.0.2"
  },
  "language": {
    "terminology_id": {
      "value": "ISO_639-1"
    },
    "code_string": "en"
  },
  "territory": {
    "terminology_id": {
      "value": "ISO_3166-1"
    },
    "code_string": "NL"
  },
  "category": {
    "value": "event",
    "defining_code": {
      "terminology_id": {
        "value": "openehr"
      },
      "code_string": "433"
    }
  },
  "composer": {
    "_type": "PARTY_IDENTIFIED",
    "external_ref": {
      "id": {
        "_type": "GENERIC_ID",
        "value": "16b74749-e6aa-4945-b760-b42bdc07098a",
        "scheme": "pid"
      },
      "namespace": "cataniamc.prod.cadasto.com",
      "type": "PERSON"
    },
    "name": "A name"
  },
  "context": {
    "start_time": {
      "value": "2014-11-18T09:50:35.000+01:00"
    },
    "setting": {
      "value": "other care",
      "defining_code": {
        "terminology_id": {
          "value": "openehr"
        },
        "code_string": "238"
      }
    }
  },
  "content": []
}'
{
  "archetype_node_id": "openEHR-EHR-COMPOSITION.encounter.v1",
  "name": {
    "value": "Vital Signs"
  },
  "uid": {
    "_type": "OBJECT_VERSION_ID",
    "value": "8849182c-82ad-4088-a07f-48ead4180515::cataniamc.prod.cadasto.com::1"
  },
  "archetype_details": {
    "archetype_id": {
      "value": "openEHR-EHR-COMPOSITION.encounter.v1"
    },
    "template_id": {
      "value": "Example.v1::c7ec861c-c413-39ff-9965-a198ebf44747"
    },
    "rm_version": "1.0.2"
  },
  "language": {
    "terminology_id": {
      "value": "ISO_639-1"
    },
    "code_string": "en"
  },
  "territory": {
    "terminology_id": {
      "value": "ISO_3166-1"
    },
    "code_string": "NL"
  },
  "category": {
    "value": "event",
    "defining_code": {
      "terminology_id": {
        "value": "openehr"
      },
      "code_string": "433"
    }
  },
  "composer": {
    "_type": "PARTY_IDENTIFIED",
    "external_ref": {
      "id": {
        "_type": "GENERIC_ID",
        "value": "16b74749-e6aa-4945-b760-b42bdc07098a",
        "scheme": "pid"
      },
      "namespace": "cataniamc.prod.cadasto.com",
      "type": "PERSON"
    },
    "name": "A name"
  },
  "context": {
    "start_time": {
      "value": "2014-11-18T09:50:35.000+01:00"
    },
    "setting": {
      "value": "other care",
      "defining_code": {
        "terminology_id": {
          "value": "openehr"
        },
        "code_string": "238"
      }
    }
  },
  "content": []
}