Create EHR with id
Create a new EHR with the specified ehr_id identifier.
The value of the ehr_id unique identifier MUST be valid HIER_OBJECT_ID value.
It is strongly RECOMMENDED that an UUID always be used for this.
An EHR_STATUS resource needs to be always created and committed in the new EHR. This resource MAY be also supplied by the client as the request body. If not supplied, a default EHR_STATUS will be used by the service with following attributes:
is_queryable: trueis_modifiable: truesubject: a PARTY_SELF object
All other required EHR attributes and resources will be automatically created as needed by the EHR creation semantics.
- Type: string
ehr _id requiredEHR identifier taken from EHR.ehr_id.value.
- Type: stringenum
Prefer Request header to indicate the preference over response details. The response will contain the entire resource when the
Preferheader has a value ofreturn=representation.valuesreturn=representation return=minimal
An EHR_STATUS resource MAY be also supplied by the client as the request body.
An EHR_STATUS resource
- Type: string
archetype _node _id required - Type: boolean
is _modifiable required - Type: boolean
is _queryable required name required_type Discriminatorenumconst:DV_TEXTrequiredvaluesD V _ T E X T
- Type: string
value required - Type: object · CODE_PHRASE
encoding - Type: string
formatting hyperlink - Type: object · CODE_PHRASE
language - Type: array object[] · TERM_MAPPING[]
mappings
subject required_type Discriminatorenumconst:PARTY_SELFrequiredvaluesP A R T Y _ S E L F
- Type: object · PARTY_REF
external _ref Identifier for parties in a demographic or identity service.
- Type: string
_type - Type: object · ARCHETYPED
archetype _details - Type: object · FEEDER_AUDIT
feeder _audit - Type: array object[] · LINK[]
links other _details _type DiscriminatorType: string- Type: string
archetype _node _id required - Type: object · ELEMENT
item required name required- Type: object · ARCHETYPED
archetype _details - Type: object · FEEDER_AUDIT
feeder _audit - Type: array object[] · LINK[]
links uid
- application/json
400 400 Bad Requestis returned when the request URL or body (if provided) could not be parsed or has invalid content.409 409 ConflictUnable to create a new EHR due to a conflict with an already existing EHR. Can happen when the suppliedehr_idis already used by an existing EHR.
curl https://cataniamc.prod.cadasto.com/openehr/v1/ehr/7d44b88c-4199-4bad-97dc-d78268e01398 \
--request PUT \
--header 'Prefer: return=minimal' \
--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
}'
{
"system_id": {
"value": "9624982A-9F42-41A5-9318-AE13D5F5031F"
},
"ehr_id": {
"value": "7d44b88c-4199-4bad-97dc-d78268e01398"
},
"ehr_status": {
"id": {
"_type": "OBJECT_VERSION_ID",
"value": "8849182c-82ad-4088-a07f-48ead4180515::cataniamc.prod.cadasto.com::1"
},
"namespace": "local",
"type": "EHR_STATUS"
},
"ehr_access": {
"id": {
"_type": "OBJECT_VERSION_ID",
"value": "59a8d0ac-140e-4feb-b2d6-af99f8e68af8::cataniamc.prod.cadasto.com::1"
},
"namespace": "local",
"type": "EHR_ACCESS"
},
"time_created": {
"value": "2015-01-20T19:30:22.765+01:00"
}
}