         }
         
         // Blood pressure log is required.
-        guard let bloodPressureMeasurements = decoder.decodeObject(forKey: PropertyKey.bloodPressureMeasurements) as? [BloodPressureMeasurement] else {
+        guard let bloodPressureMeasurementsSorted = decoder.decodeObject(forKey: PropertyKey.bloodPressureMeasurementsSorted) as? [BloodPressureMeasurement] else {
+            
             os_log("Unable to decode the blood pressure log for a Patient object.", log: OSLog.default, type: .debug)
             return nil
         }

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

            case .female: self.sexInBoolean = false
        }
        
        self.bloodPressureMeasurementsSorted = bloodPressureMeasurements.sorted {
            return $0.measurementDate < $1.measurementDate
        }
    }
    
    // Encoder used to store a patient.
