42 lines
1.1 KiB
Swift
42 lines
1.1 KiB
Swift
import Foundation
|
|
|
|
package struct PatientRecord: Codable, Identifiable {
|
|
package let id: UUID
|
|
package var name: String
|
|
package var chartNumber: String
|
|
package var images: [PatientImage]
|
|
|
|
package init(id: UUID, name: String, chartNumber: String) {
|
|
self.id = id
|
|
self.name = name
|
|
self.chartNumber = chartNumber
|
|
self.images = []
|
|
}
|
|
}
|
|
|
|
package struct PatientImage: Codable, Identifiable {
|
|
package let id: UUID
|
|
package let name: String
|
|
package let importedAt: Date
|
|
package var dicomCount: Int?
|
|
|
|
package init(id: UUID, name: String, importedAt: Date, dicomCount: Int? = nil) {
|
|
self.id = id
|
|
self.name = name
|
|
self.importedAt = importedAt
|
|
self.dicomCount = dicomCount
|
|
}
|
|
}
|
|
|
|
package enum LibraryPaths {
|
|
package static let index = "patients.json"
|
|
|
|
package static func attachment(_ id: UUID, in directory: URL) -> URL {
|
|
directory.appendingPathComponent(id.uuidString)
|
|
}
|
|
|
|
package static func slice(_ number: Int, of id: UUID, in directory: URL) -> URL {
|
|
attachment(id, in: directory).appendingPathComponent("slice-\(number).dcm")
|
|
}
|
|
}
|