Extract audit details (time committed) in AQL?

Hi,
We want to store the time the composition is stored in the CDR (ehrBase).
Is it possible to store and extract the audit details class which stores this information in time_committed . If so can you please provide the flat json and the aql for the same.
Note, we do not want to store the composition commit time in c/context/start_time. This is reserved to store the time of encounter.

Any guidance will help.

Thanks

On Better CDR you can do

SELECT
   c/name/value as compName,
    vo/uid/value as identifier,
    v/uid/value as versionId,
    v/preceding_version_uid/value as previousVersionId
FROM EHR e
CONTAINS VERSIONED_OBJECT vo
CONTAINS VERSION v[all_versions] 
CONTAINS COMPOSITION c
ORDER BY identifier ASC,
         v/commit_audit/time_created/value DESC

Iā€™m not sure if this is supported in Ehrbase or other CDRs.

1 Like

Also see AQL query for compositions that have been created/updated within a time period