0.4.7 addendum
Additional instructions for update

createdAt (cts)

New column added to all resource tables - cts (createdAt) - a time of resource creation. All CRUD operations respect this column, but we do not include automatic migration for this column because of performance reasons. To set this column in the right value for existing data, you have to run the following statements manually on your box:
1
-- set cts to ts - right value for created resources
2
update "patient" set cts = ts;
3
4
-- take cts for updated resources from history
5
update "patient" set cts = h.ts
6
FROM "patient_history" h
7
WHERE h.id = "patient".id and h.status = 'created';
Copied!
Replace "patient" and "patient_history" with the lowercased name of resource types you want to update.
In API this column will be present as Resource.meta.createdAt in Aidbox Format and as Resource.meta.extension(url: 'ax:createdAt').valueInstant in FHIR.
Last modified 1yr ago
Copy link