             birthDate: birthDate,
             heightInMeters: heightInMeters,
             sex: sex,
-            bloodPressureMeasurements: bloodPressureMeasurements
+            bloodPressureMeasurements: bloodPressureMeasurementsSorted
         )
     }
 }

        encoder.encode(birthDate, forKey: PropertyKey.birthDate)
        encoder.encode(heightInMeters, forKey: PropertyKey.heightInMeters)
        encoder.encode(sexInBoolean, forKey: PropertyKey.sexInBoolean)
        encoder.encode(bloodPressureMeasurements, forKey: PropertyKey.bloodPressureMeasurements)
    }
    
    public required convenience init?(coder decoder: NSCoder) {

        static let birthDate = "birthDate"
        static let heightInMeters = "heightInMeters"
        static let sexInBoolean = "sexInBoolean"
        static let bloodPressureMeasurementsSorted = "bloodPressureMeasurementsSorted"
    }
    
    // Create a new patient
