Update directory
Updates directory FOLDER associated with the EHR identified by ehr_id.
The existing latest version_uid of directory FOLDER resource (i.e. the preceding_version_uid) must be specified in the If-Match header.
- Type: stringehr
_id requiredEHR identifier taken from EHR.ehr_id.value.
- Type: stringIf
- Match requiredHeader to make the request conditional. Together with
ETagrequest tag, it helps to prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). The format is always anversion_uididentifier enclosed by double quotes. The operation will be performed only if the existing latestversion_uidof the resource (i.e. thepreceding_version_uid) matches this header's value. - Type: stringPrefer
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=representationwrite 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-tagheaderEmit the openehr-item-tagresponse header with the current tags. On writes that shipopenehr-item-tagin 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-Appliedresponse header echoes the tokens the server actually honoured (return=, plusinclude_item_tags/resolve_refswhen applied).
The new directory.
A FOLDER resource
- Type: stringarchetype
_node _id required - namerequired
- _typeDiscriminatorenumconst:DV_TEXTrequiredvalues
- D
V _ T E X T
- valueType: stringrequired
- encodingType: object ·
- formattingType: string
- hyperlink
- languageType: object ·
- mappingsType: array object[] ·
- Type: string_type
- Type: object ·archetype
_details - details
- _typeDiscriminatorType: string
- archetypeType: string
_node _id required - itemType: object ·required
- namerequired
- archetypeType: object ·
_details - feederType: object ·
_audit - linksType: array object[] ·
- uid
- Type: object ·feeder
_audit - Type: array object[] ·folders
A FOLDER resource
- Type: array object[] ·items
- Type: array object[] ·links
- uid
- _typeDiscriminatorenumconst:HIER_OBJECT_IDrequiredvalues
- H
I E R _ O B J E C T _ I D
- valueType: string Format: uuidrequired
- application/json
- 400
400 Bad Requestis returned when the request URL or body (if provided) could not be parsed or has invalid content (e.g. invalidehr_id, or either the body of the request could not be read, or could not be converted to a valid FOLDER object). - 404
404 Not Foundis returned when an EHR withehr_iddoes not exist.
curl https://cataniamc.prod.cadasto.com/openehr/v1/ehr/7d44b88c-4199-4bad-97dc-d78268e01398/directory \
--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-FOLDER.directory.v1",
"name": {
"value": "Directory"
},
"uid": {
"_type": "OBJECT_VERSION_ID",
"value": "8849182c-82ad-4088-a07f-48ead4180515::cataniamc.prod.cadasto.com::1"
},
"items": [],
"folders": []
}'
{
"archetype_node_id": "openEHR-EHR-FOLDER.directory.v1",
"name": {
"value": "Directory"
},
"uid": {
"_type": "OBJECT_VERSION_ID",
"value": "8849182c-82ad-4088-a07f-48ead4180515::cataniamc.prod.cadasto.com::1"
},
"items": [],
"folders": []
}