Update EHR_STATUS

Updates EHR_STATUS associated with the EHR identified by ehr_id.

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

The response will contain the updated EHR_STATUS resource when the Prefer header has a value of return=representation.

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

The optional cadasto-person-uid request header links the EHR to a PERSON in the same contribution. The link is append-only here: an EHR that already has a link cannot be re-linked via this header (409 Conflict). See the Cadasto demographic link guide.

Path Parameters
  • ehr_id
    Type: string
    required

    EHR identifier taken from EHR.ehr_id.value.

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.

  • cadasto-person-uid
    Type: string Format: uuid

    Links the EHR being created (or updated via EHR_STATUS) to an existing PERSON in the Demographic API. The link is written in the same contribution as the EHR/EHR_STATUS write.

    Cadasto extension: this header is not part of the openEHR ITS-REST specification. Standard openEHR clients can continue to use EHR_STATUS.subject.external_ref and GET /ehr?subject_id=…&subject_namespace=… instead; the two mechanisms are independent and can coexist. See the Cadasto demographic link guide.

    Value must be a bare PERSON UID in the HIER_OBJECT_ID form (no ::<system>::<version> suffix). Versioned forms are rejected with 400 Bad Request.

    On PUT /ehr/{ehr_id}/ehr_status the link is append-only — an EHR that already has a link cannot be re-linked via this header and the request is rejected with 409 Conflict.

Body·
required
application/json

The new EHR_STATUS.

An EHR_STATUS resource

  • archetype_node_id
    Type: string
    required
  • is_modifiable
    Type: boolean
    required
  • is_queryable
    Type: boolean
    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[] ·
  • subject
    required
    • _type
      Discriminator
      enum
      const:  
      PARTY_SELF
      required
      values
      • PARTY_SELF
    • external_ref
      Type: object ·

      Identifier for parties in a demographic or identity service.

  • _type
    Type: string
  • archetype_details
    Type: object ·
  • feeder_audit
    Type: object ·
  • Type: array object[] ·
  • other_details
    • _type
      Discriminator
      Type: string
    • archetype_node_id
      Type: string
      required
    • item
      Type: object ·
      required
    • name
      required
    • archetype_details
      Type: object ·
    • feeder_audit
      Type: object ·
    • links
      Type: array object[] ·
    • uid
Responses
  • application/json
  • 400

    400 Bad Request is returned when the request URL or body (if provided) could not be parsed or has invalid content.

  • 404

    404 Not Found is returned when an EHR with ehr_id does not exist.

  • 409

    409 Conflict is returned when the cadasto-person-uid header cannot be honoured on the update. Possible causes:

    • The target EHR already has a link to a PERSON. The header is append-only on PUT /ehr/{ehr_id}/ehr_status — to re-link, delete and recreate the EHR.
    • The supplied PERSON is already linked to another EHR.
  • 422

    422 Unprocessable Entity is returned when the supplied cadasto-person-uid does not resolve to an existing PERSON in the Demographic API, or resolves to a non-PERSON actor (Organisation, Agent, Group, Role).

Request Example for put/ehr/{ehr_id}/ehr_status
curl https://cataniamc.prod.cadasto.com/openehr/v1/ehr/7d44b88c-4199-4bad-97dc-d78268e01398/ehr_status \
  --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-EHR_STATUS.generic.v1",
  "name": {
    "value": "EHR status"
  },
  "subject": {
    "_type": "PARTY_SELF"
  },
  "is_queryable": true,
  "is_modifiable": true
}'
{
  "archetype_node_id": "openEHR-EHR-EHR_STATUS.generic.v1",
  "name": {
    "value": "EHR status"
  },
  "subject": {
    "_type": "PARTY_SELF"
  },
  "is_queryable": true,
  "is_modifiable": true
}