// // SaveUltrasoundObservationsRequest.swift // // Generated by openapi-generator // https://openapi-generator.tech // import Foundation #if canImport(AnyCodable) import AnyCodable #endif /** Post or put this to the server to save or create up to one of each observation type related to an ultrasound scan */ public struct SaveUltrasoundObservationsRequest: Codable, Hashable { public enum Flow: String, Codable, CaseIterable { case normal = "normal" case abnormal = "abnormal" case tobecontinued = "tobecontinued" } /** time of the measurement (shall be able to be put back in time) will default to now */ public var date: Date? /** time of the conception. This field is needed to calculate gestation age */ public var offsetDate: Date? /** the ID of the careplan activity that these observations are pointing to (using a cross reference) */ public var activityId: String? /** the unique uuid of the cda document */ public var documentUniqueId: String? public var amnioticFluid: Double? public var flow: Flow? public var cervix: Double? public var dvp: Double? public var fetuses: [SaveUltrasoundObservationsRequestFetuses]? public init(date: Date? = nil, offsetDate: Date? = nil, activityId: String? = nil, documentUniqueId: String? = nil, amnioticFluid: Double? = nil, flow: Flow? = nil, cervix: Double? = nil, dvp: Double? = nil, fetuses: [SaveUltrasoundObservationsRequestFetuses]? = nil) { self.date = date self.offsetDate = offsetDate self.activityId = activityId self.documentUniqueId = documentUniqueId self.amnioticFluid = amnioticFluid self.flow = flow self.cervix = cervix self.dvp = dvp self.fetuses = fetuses } public enum CodingKeys: String, CodingKey, CaseIterable { case date case offsetDate case activityId case documentUniqueId case amnioticFluid case flow case cervix case dvp case fetuses } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(date, forKey: .date) try container.encodeIfPresent(offsetDate, forKey: .offsetDate) try container.encodeIfPresent(activityId, forKey: .activityId) try container.encodeIfPresent(documentUniqueId, forKey: .documentUniqueId) try container.encodeIfPresent(amnioticFluid, forKey: .amnioticFluid) try container.encodeIfPresent(flow, forKey: .flow) try container.encodeIfPresent(cervix, forKey: .cervix) try container.encodeIfPresent(dvp, forKey: .dvp) try container.encodeIfPresent(fetuses, forKey: .fetuses) } }