Serve EzDent startup profile and recent acquisitions
This commit is contained in:
1 parent
a46a111d50
commit
aeefb0f7f0
2 files changed
+64
-7
No files matched your search
@@ -143,6 +143,18 @@ final class ServerStore {
|
||||
return records
|
||||
}
|
||||
|
||||
func recentlyAcquiredPatients(offset: Int, limit: Int) throws -> [PatientRecord] {
|
||||
lock.lock()
|
||||
defer { lock.unlock() }
|
||||
return try query("""
|
||||
SELECT patients.id, patients.name, patients.chart_number
|
||||
FROM patients JOIN images ON images.patient_id = patients.id
|
||||
GROUP BY patients.id
|
||||
ORDER BY MAX(images.imported_at) DESC, patients.id
|
||||
LIMIT ? OFFSET ?
|
||||
""", values: [.integer(limit), .integer(offset)], map: { try self.patient($0) })
|
||||
}
|
||||
|
||||
func patient(chartNumber: String) throws -> PatientRecord? {
|
||||
lock.lock()
|
||||
defer { lock.unlock() }
|
||||
|
||||
Reference in new issue
Block a user