For notes on REST APIs during the 2017 Alkmaar SEC meeting.
Items to revisit / refine:
REST API publishing:
Validation errors of a COMPOSITION from a POST needs a structure defined in BASE - Pablo has suggestions
class ErrorAccumulator errors : List<Error> end class Error location: Integer code: String text: DV_TEXT end |
Also define set of standard error codes / tokens in openEHR similar to ADL V-codes which are defined in the AOM2 spec - See Veratech validation errors.
Other Qs:
copy header commit audit from Heath's email
BL: to commit lifecycle state in audit, want to be able to specify code or rubric string;
need to add a copy of the lifecycle states from XML terminology to the REST overview documentation commit audit header.
Question of whether Composition uids should be supplied from the client side;
Reason to supply Uid is when it is to be used in FOLDERs referencing the COMPOSITION - this enables a single Contribution to contain FOLDER updates in the same CONTRIBUTION as COMPOSITION.
POST doesn't allow Uid; can use PUT without match-if header, and a supplied Uid.
Split PUT Composition into 2 calls - one with Version Uid supplied; other without; simplify documentation.
If Version Uid is supplied: it should all be there, including version = 1
Heath: add a last-updated: date_time header (formatted according to HTTP rules, i.e. no milliseconds). For all GETs; ?POST response as well.
discussions about versioning definitions
/definition/template and /definition/query should include either a semver identifier or an openehr version identifier - more requirements should be gather here on how vendors are dealing currently with versioning or proposals on this topic.
Uid can be provided by client, but if not unique, the server will return an error
Committer id in the version audit is trusted as being correct due to client app authentication
Audit time field must be overwritten by the server.
Bostjan: prefers 'relaxed XSD' approach
Add a standard stored query to get all comps of an ehr with parameters:
- time (context/start_time)
- template_id
- name (name/value)
+ paging
with a pre-defined order: desc time