Overview for REST API todos - for Release 1.1.0 (or 2.0.0)
EHR
Add
/ehr/{ehr_id}/folder
and/ehr/{ehr_id}/versioned_folder
https://openehr.atlassian.net/browse/SPECITS-63Add missing EHR_ACCESS, similar to EHR_STATUS
we will mention in specs that this resource is created automatically by the system when the EHR is created, and is not possible to add it in the payload of EHR creation (like we do for EHR_STATUS)
consider HEAD for EHR with subject_id and subject_namespace
Definitions
should we support also archetypes? => no, or at least is low prio, perhaps next version
are we going to support (reading) terminology / value sets? => no, this is the job of terminology service
add alternative /definition/adl2/{archetype_id_matcher} and deprecate /definition/adl2/{template_id}/{version_pattern} - potentially breaking change
query type => add “formalism” in text
Demographics
https://openehr.atlassian.net/browse/SPECPR-406 and https://openehr.atlassian.net/browse/SPECITS-70
TAGs
https://openehr.atlassian.net/browse/SPECITS-77
Admin
how should we deal with admin required functionality, e.g. destroy EHR, Compositions, Actors, etc ? Need a specific endpoint /admin or use DELETE action over resources, assuming ACL permits ?
DELETE /admin/ehr/{:ehr_id} https://openehr.atlassian.net/browse/SPECITS-80
DELETE /admin/ehr/{:ehr_id}/composition/{:composition_id} - this would delete the whole container not just a particular version
see https://ehrbase.readthedocs.io/en/latest/03_development/07_admin/index.html
shredding Person/EHR (partial, cohort) Use case: e.g. after archiving them elsewhere based on some (AQL) selection criteria.
POST https://{baseUrl}/v1/admin/ehr/$destroy?query={stored_query_name}&target={ehrs|compositions} - still need to think about this. (Query should, depending on target parameter, return either a list of ehr ids or a list of composition ids)
delete contribution:
@Alex Vidrean is not possible in EHRbase as leads to inconsistencies; instead there might be a need to support roll-back
conclusion: this functionality (hard-delete) will not be supported, but consider to discuss in the future about a roll-back
delete template is problematic, if is “in use”
templates not in-use can be deleted without problems
if in-use, a template can be only deleted with a special flag (consider a header)
otherwise consider active/deactivate templates instead of hard-delete
POST https://{baseUrl}/v1/admin/definition/template/adl1.4/{template_id}/$deactivate - meaning: deactivated templates are not usable to create or modify data, but getting existing composition should be still working
POST https://{baseUrl}/v1/admin/definition/template/adl1.4/{template_id}/$activate
consider also a list template admin operation to list all templates, including those deactivated
delete stored query, including delete stored query at version
export / import
/admin/ehr/exports
/admin/ehr/import
configure the export/import task scope with a payload (e.g. all-ehrs, subset of ehrs based on their ehrIds, “some compositions”)
background tasks - consider polling
need to define what will be the format for this dump - zip?
we will need to define schema for this export format
@Severin Kohler what should be the resource format? for data scientists would be better as flat-format, perhaps based on a parameter on the export-time
@Erik Sundvall If looking for database-like dumps it could be worth comparing https://www.sqlite.org/ to https://parquet.apache.org/ (that is often used in data lakes etc.)
@Seref Arikan sqlite would be a good interop file format, but the content (data) needs to be discussed
@Severin Kohler csv or json?
Ian: see Josh Mandel on dumping ehr-data
do we need something like ehr_extract ?
self-contained package, including templates, archetypes; maintaining cross references, versioning, contribution
import should work on existing populated CDR
what if template or other data already exists?
Alex: consider keycloak import/export strategies
consider flag to anonymize data upon export
can be used for data migration from one CDR to another, or another version
consider POST https://{baseUrl}/v1/admin/ehr/{source_ehr_id}/$export ?
merging EHRs
parameters: source ehr-id and target ehr-id
Sebastian: it will move data from old ehr to new ehr
Sebastian: might be possible to use ehr_status to indicate that source ehr was merged, perhaps use folders or tags to mark the merged content
Alex: use ehr_status other_details or feeder_audit to indicate merging information
see also Linking and Merging EHR IDs
Erik: I wonder if merge is a variant action of moving data
better has also
unmerge
andmove
operationshow to deal with merge-conflicts ? imagine merging persisting compositions, episodes, demographic data, duplicates tags, etc
POST https://{baseUrl}/v1/ehr/{target_ehr_id}/$merge?source={ehr_id} not very clear, a more clear suggestion is POST https://{baseUrl}/v1/admin/ehr/$merge?source={ehr_id}&target={ehr_id}
system?
Query
looking to federative-AQL issues, the result-set needs perhaps an extra name column. can the AQL return named columns in result-set (as now is just an array).
think about adding views
this is most likely related to stored query, with a new type (not AQL), e.g. view
Bugs
https://openehr.atlassian.net/browse/SPECITS-46 - might be a breaking change
https://openehr.atlassian.net/browse/SPECITS-44 but also to other places
fix EHR summary - not “very” restful => this is a breaking change
Headers
Audit headers with JSON Simplified Format https://openehr.atlassian.net/browse/SPECITS-64
If possible add explicitly all the supported headers to all operations (not only in the overview), otherwise make the reference more obvious
audit_details on response side can be reached by using the versioned_composition endpoint which returns also audit_details and version data besides composition
Erik: idea: consider adding prefer header to ask extra (response) headers to expose audit_details - but these will pollute the the response
Missing (specification) details
https://openehr.atlassian.net/browse/SPECITS-48 discussed on discourse, we should allow it (todo check), no need to do anything on REST level
serializing errors:
investigate if RFC is in use -https://datatracker.ietf.org/doc/html/rfc7807 (https://github.com/zalando/problem is also using it)
try to align if possible with FHIR
we should not use RM type
Others
Conformance info
Reformat and reorganize https://openehr.atlassian.net/browse/SPECITS-36
sync with SM, add UV models (relaxed RM) https://openehr.atlassian.net/browse/SPECITS-34
authentication endpoint => (still) no needed
audit service endpoint => not prio, perhaps not part of rest api
(cds) hooks => if Cambio can help with a proposal then it can be included, but we should also look into generalized triggers
Priority tickets:
https://openehr.atlassian.net/browse/SPECITS-50 @Ian McNicoll and https://openehr.atlassian.net/browse/SPECITS-74 @Sebastian Iancu
https://openehr.atlassian.net/browse/SPECITS-77 @Alex Vidrean
https://openehr.atlassian.net/browse/SPECITS-58 @Ian McNicoll
admin/export and admin/import @Severin Kohler @Seref Arikan
https://openehr.atlassian.net/browse/SPECITS-80 @Severin Kohler
flat-format @Severin Kohler
https://openehr.atlassian.net/browse/SPECITS-35@Sebastian Iancu
During the SEC meeting today we decided that the SEC REST (sub)workgroup gets the task to clarify the specification regarding that client supplied UIDs should be used (not changed) by the recieving...
All issues
The followings are all Jira issues scheduled for REST API Release 1.1.0: