Create CONTRIBUTION

We will use the relaxed CONTRIBUTION with the following optional attributes:

  • uid: when provided, it will be accepted in case is not in-use, otherwise error will be returned
  • audit.time_committed: server will always set it
  • audit.system_id: when provided, it will be validated
Path Parameters
  • ehr_id
    Type: string
    required

    EHR identifier taken from EHR.ehr_id.value.

Headers
  • Prefer
    Type: stringenum

    Request header to indicate the preference over response details. The response will contain the entire resource when the Prefer header has a value of return=representation.

    values
    • return=representation
    • return=minimal
Body
required
application/json

The CONTRIBUTION.

A new (un-committed) CONTRIBUTION resource

  • audit
    Type: object · UPDATE_AUDIT
    required

    The set of attributes required to document the committal of an information item to a repository. Used by the server to create an AUDIT_DETAILS object.

  • versions
    Type: array object[] · UPDATE_VERSION[]
    required
  • uid
    Type: object · HIER_OBJECT_ID
Responses
  • application/json
  • application/json
  • 404

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

  • 409

    409 Conflict is returned when a resource with same identifier(s) already exists.

Request Example for post/ehr/{ehr_id}/contribution
curl https://cataniamc.prod.cadasto.com/openehr/v1/ehr/7d44b88c-4199-4bad-97dc-d78268e01398/contribution \
  --request POST \
  --header 'Prefer: return=minimal' \
  --header 'Content-Type: application/json' \
  --data '{
  "uid": {
    "_type": "UID_BASED_ID",
    "value": "6cb19121-4307-4648-9da0-d62e4d51f19b"
  },
  "versions": [
    {
      "preceding_version_uid": {
        "_type": "UID_BASED_ID",
        "value": "6cb19121-4307-4648-9da0-d62e4d51f19b::cataniamc.prod.cadasto.com::2"
      },
      "signature": "",
      "lifecycle_state": {
        "terminology_id": "snomed_ct",
        "code_string": "308335008"
      },
      "attestations": [
        {
          "change_type": {
            "value": "creation",
            "defining_code": {
              "terminology_id": "openehr",
              "code_string": "249"
            }
          },
          "description": "Description text",
          "committer": {
            "_type": "PARTY_IDENTIFIED",
            "name": "A user name"
          }
        }
      ],
      "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": []
      },
      "commit_audit": {
        "change_type": {
          "value": "creation",
          "defining_code": {
            "terminology_id": "openehr",
            "code_string": "249"
          }
        },
        "description": "Description text",
        "committer": {
          "_type": "PARTY_IDENTIFIED",
          "name": "A user name"
        }
      }
    }
  ],
  "audit": {
    "change_type": {
      "value": "creation",
      "defining_code": {
        "terminology_id": "openehr",
        "code_string": "249"
      }
    },
    "description": "Description text",
    "committer": {
      "_type": "PARTY_IDENTIFIED",
      "name": "A user name"
    }
  }
}'
{
  "uid": {
    "value": "0826851c-c4c2-4d61-92b9-410fb8275ff0"
  },
  "versions": [
    {
      "_type": "OBJECT_REF",
      "id": {
        "_type": "OBJECT_VERSION_ID",
        "value": "fb458d9c-1323-42bc-b7f8-787f3660a0b5::cataniamc.prod.cadasto.com::1"
      },
      "namespace": "local",
      "type": "COMPOSITION"
    },
    {
      "_type": "OBJECT_REF",
      "id": {
        "_type": "OBJECT_VERSION_ID",
        "value": "abcdefgh-1323-42bc-b7f8-787f3660a0ba::cataniamc.prod.cadasto.com::1"
      },
      "namespace": "local",
      "type": "FOLDER"
    }
  ],
  "audit": {
    "system_id": "9624982A-9F42-41A5-9318-AE13D5F5031F",
    "committer": {
      "_type": "PARTY_IDENTIFIED",
      "name": "A user name"
    },
    "time_committed": {
      "value": "2017-08-15T10:37:15.422+02:00"
    },
    "change_type": {
      "value": "creation",
      "defining_code": {
        "terminology_id": {
          "value": "openehr"
        },
        "code_string": "249"
      }
    },
    "description": {
      "value": "Description text"
    }
  }
}