phenopackets/schema/v2/core/individual_pb.js

// source: phenopackets/schema/v2/core/individual.proto
/**
 * @fileoverview
 * @enhanceable
 * @suppress {missingRequire} reports error on implicit type usages.
 * @suppress {messageConventions} JS Compiler reports an error if a variable or
 *     field starts with 'MSG_' and isn't a translatable message.
 * @public
 */
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck

var jspb = require('google-protobuf');
var goog = jspb;
var global =
    (typeof globalThis !== 'undefined' && globalThis) ||
    (typeof window !== 'undefined' && window) ||
    (typeof global !== 'undefined' && global) ||
    (typeof self !== 'undefined' && self) ||
    (function () { return this; }).call(null) ||
    Function('return this')();

var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var phenopackets_schema_v2_core_base_pb = require('../../../../phenopackets/schema/v2/core/base_pb.js');
goog.object.extend(proto, phenopackets_schema_v2_core_base_pb);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.Individual', null, global);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.KaryotypicSex', null, global);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.Sex', null, global);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.VitalStatus', null, global);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.VitalStatus.Status', null, global);
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.org.phenopackets.schema.v2.core.Individual = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, proto.org.phenopackets.schema.v2.core.Individual.repeatedFields_, null);
};
goog.inherits(proto.org.phenopackets.schema.v2.core.Individual, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.org.phenopackets.schema.v2.core.Individual.displayName = 'proto.org.phenopackets.schema.v2.core.Individual';
}
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.org.phenopackets.schema.v2.core.VitalStatus = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.org.phenopackets.schema.v2.core.VitalStatus, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.org.phenopackets.schema.v2.core.VitalStatus.displayName = 'proto.org.phenopackets.schema.v2.core.VitalStatus';
}

/**
 * List of repeated fields within this message type.
 * @private {!Array<number>}
 * @const
 */
proto.org.phenopackets.schema.v2.core.Individual.repeatedFields_ = [2];



if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.toObject = function(opt_includeInstance) {
  return proto.org.phenopackets.schema.v2.core.Individual.toObject(opt_includeInstance, this);
};


/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.org.phenopackets.schema.v2.core.Individual} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.org.phenopackets.schema.v2.core.Individual.toObject = function(includeInstance, msg) {
  var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
alternateIdsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f,
dateOfBirth: (f = msg.getDateOfBirth()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
timeAtLastEncounter: (f = msg.getTimeAtLastEncounter()) && phenopackets_schema_v2_core_base_pb.TimeElement.toObject(includeInstance, f),
vitalStatus: (f = msg.getVitalStatus()) && proto.org.phenopackets.schema.v2.core.VitalStatus.toObject(includeInstance, f),
sex: jspb.Message.getFieldWithDefault(msg, 6, 0),
karyotypicSex: jspb.Message.getFieldWithDefault(msg, 7, 0),
gender: (f = msg.getGender()) && phenopackets_schema_v2_core_base_pb.OntologyClass.toObject(includeInstance, f),
taxonomy: (f = msg.getTaxonomy()) && phenopackets_schema_v2_core_base_pb.OntologyClass.toObject(includeInstance, f)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}


/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.org.phenopackets.schema.v2.core.Individual}
 */
proto.org.phenopackets.schema.v2.core.Individual.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.org.phenopackets.schema.v2.core.Individual;
  return proto.org.phenopackets.schema.v2.core.Individual.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.org.phenopackets.schema.v2.core.Individual} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.org.phenopackets.schema.v2.core.Individual}
 */
proto.org.phenopackets.schema.v2.core.Individual.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = /** @type {string} */ (reader.readString());
      msg.setId(value);
      break;
    case 2:
      var value = /** @type {string} */ (reader.readString());
      msg.addAlternateIds(value);
      break;
    case 3:
      var value = new google_protobuf_timestamp_pb.Timestamp;
      reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
      msg.setDateOfBirth(value);
      break;
    case 4:
      var value = new phenopackets_schema_v2_core_base_pb.TimeElement;
      reader.readMessage(value,phenopackets_schema_v2_core_base_pb.TimeElement.deserializeBinaryFromReader);
      msg.setTimeAtLastEncounter(value);
      break;
    case 5:
      var value = new proto.org.phenopackets.schema.v2.core.VitalStatus;
      reader.readMessage(value,proto.org.phenopackets.schema.v2.core.VitalStatus.deserializeBinaryFromReader);
      msg.setVitalStatus(value);
      break;
    case 6:
      var value = /** @type {!proto.org.phenopackets.schema.v2.core.Sex} */ (reader.readEnum());
      msg.setSex(value);
      break;
    case 7:
      var value = /** @type {!proto.org.phenopackets.schema.v2.core.KaryotypicSex} */ (reader.readEnum());
      msg.setKaryotypicSex(value);
      break;
    case 8:
      var value = new phenopackets_schema_v2_core_base_pb.OntologyClass;
      reader.readMessage(value,phenopackets_schema_v2_core_base_pb.OntologyClass.deserializeBinaryFromReader);
      msg.setGender(value);
      break;
    case 9:
      var value = new phenopackets_schema_v2_core_base_pb.OntologyClass;
      reader.readMessage(value,phenopackets_schema_v2_core_base_pb.OntologyClass.deserializeBinaryFromReader);
      msg.setTaxonomy(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.org.phenopackets.schema.v2.core.Individual.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.org.phenopackets.schema.v2.core.Individual} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.org.phenopackets.schema.v2.core.Individual.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getId();
  if (f.length > 0) {
    writer.writeString(
      1,
      f
    );
  }
  f = message.getAlternateIdsList();
  if (f.length > 0) {
    writer.writeRepeatedString(
      2,
      f
    );
  }
  f = message.getDateOfBirth();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
    );
  }
  f = message.getTimeAtLastEncounter();
  if (f != null) {
    writer.writeMessage(
      4,
      f,
      phenopackets_schema_v2_core_base_pb.TimeElement.serializeBinaryToWriter
    );
  }
  f = message.getVitalStatus();
  if (f != null) {
    writer.writeMessage(
      5,
      f,
      proto.org.phenopackets.schema.v2.core.VitalStatus.serializeBinaryToWriter
    );
  }
  f = message.getSex();
  if (f !== 0.0) {
    writer.writeEnum(
      6,
      f
    );
  }
  f = message.getKaryotypicSex();
  if (f !== 0.0) {
    writer.writeEnum(
      7,
      f
    );
  }
  f = message.getGender();
  if (f != null) {
    writer.writeMessage(
      8,
      f,
      phenopackets_schema_v2_core_base_pb.OntologyClass.serializeBinaryToWriter
    );
  }
  f = message.getTaxonomy();
  if (f != null) {
    writer.writeMessage(
      9,
      f,
      phenopackets_schema_v2_core_base_pb.OntologyClass.serializeBinaryToWriter
    );
  }
};


/**
 * optional string id = 1;
 * @return {string}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.getId = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


/**
 * @param {string} value
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.setId = function(value) {
  return jspb.Message.setProto3StringField(this, 1, value);
};


/**
 * repeated string alternate_ids = 2;
 * @return {!Array<string>}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.getAlternateIdsList = function() {
  return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
};


/**
 * @param {!Array<string>} value
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.setAlternateIdsList = function(value) {
  return jspb.Message.setField(this, 2, value || []);
};


/**
 * @param {string} value
 * @param {number=} opt_index
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.addAlternateIds = function(value, opt_index) {
  return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
};


/**
 * Clears the list making it empty but non-null.
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.clearAlternateIdsList = function() {
  return this.setAlternateIdsList([]);
};


/**
 * optional google.protobuf.Timestamp date_of_birth = 3;
 * @return {?proto.google.protobuf.Timestamp}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.getDateOfBirth = function() {
  return /** @type{?proto.google.protobuf.Timestamp} */ (
    jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
};


/**
 * @param {?proto.google.protobuf.Timestamp|undefined} value
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
*/
proto.org.phenopackets.schema.v2.core.Individual.prototype.setDateOfBirth = function(value) {
  return jspb.Message.setWrapperField(this, 3, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.clearDateOfBirth = function() {
  return this.setDateOfBirth(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.hasDateOfBirth = function() {
  return jspb.Message.getField(this, 3) != null;
};


/**
 * optional TimeElement time_at_last_encounter = 4;
 * @return {?proto.org.phenopackets.schema.v2.core.TimeElement}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.getTimeAtLastEncounter = function() {
  return /** @type{?proto.org.phenopackets.schema.v2.core.TimeElement} */ (
    jspb.Message.getWrapperField(this, phenopackets_schema_v2_core_base_pb.TimeElement, 4));
};


/**
 * @param {?proto.org.phenopackets.schema.v2.core.TimeElement|undefined} value
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
*/
proto.org.phenopackets.schema.v2.core.Individual.prototype.setTimeAtLastEncounter = function(value) {
  return jspb.Message.setWrapperField(this, 4, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.clearTimeAtLastEncounter = function() {
  return this.setTimeAtLastEncounter(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.hasTimeAtLastEncounter = function() {
  return jspb.Message.getField(this, 4) != null;
};


/**
 * optional VitalStatus vital_status = 5;
 * @return {?proto.org.phenopackets.schema.v2.core.VitalStatus}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.getVitalStatus = function() {
  return /** @type{?proto.org.phenopackets.schema.v2.core.VitalStatus} */ (
    jspb.Message.getWrapperField(this, proto.org.phenopackets.schema.v2.core.VitalStatus, 5));
};


/**
 * @param {?proto.org.phenopackets.schema.v2.core.VitalStatus|undefined} value
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
*/
proto.org.phenopackets.schema.v2.core.Individual.prototype.setVitalStatus = function(value) {
  return jspb.Message.setWrapperField(this, 5, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.clearVitalStatus = function() {
  return this.setVitalStatus(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.hasVitalStatus = function() {
  return jspb.Message.getField(this, 5) != null;
};


/**
 * optional Sex sex = 6;
 * @return {!proto.org.phenopackets.schema.v2.core.Sex}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.getSex = function() {
  return /** @type {!proto.org.phenopackets.schema.v2.core.Sex} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};


/**
 * @param {!proto.org.phenopackets.schema.v2.core.Sex} value
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.setSex = function(value) {
  return jspb.Message.setProto3EnumField(this, 6, value);
};


/**
 * optional KaryotypicSex karyotypic_sex = 7;
 * @return {!proto.org.phenopackets.schema.v2.core.KaryotypicSex}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.getKaryotypicSex = function() {
  return /** @type {!proto.org.phenopackets.schema.v2.core.KaryotypicSex} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
};


/**
 * @param {!proto.org.phenopackets.schema.v2.core.KaryotypicSex} value
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.setKaryotypicSex = function(value) {
  return jspb.Message.setProto3EnumField(this, 7, value);
};


/**
 * optional OntologyClass gender = 8;
 * @return {?proto.org.phenopackets.schema.v2.core.OntologyClass}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.getGender = function() {
  return /** @type{?proto.org.phenopackets.schema.v2.core.OntologyClass} */ (
    jspb.Message.getWrapperField(this, phenopackets_schema_v2_core_base_pb.OntologyClass, 8));
};


/**
 * @param {?proto.org.phenopackets.schema.v2.core.OntologyClass|undefined} value
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
*/
proto.org.phenopackets.schema.v2.core.Individual.prototype.setGender = function(value) {
  return jspb.Message.setWrapperField(this, 8, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.clearGender = function() {
  return this.setGender(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.hasGender = function() {
  return jspb.Message.getField(this, 8) != null;
};


/**
 * optional OntologyClass taxonomy = 9;
 * @return {?proto.org.phenopackets.schema.v2.core.OntologyClass}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.getTaxonomy = function() {
  return /** @type{?proto.org.phenopackets.schema.v2.core.OntologyClass} */ (
    jspb.Message.getWrapperField(this, phenopackets_schema_v2_core_base_pb.OntologyClass, 9));
};


/**
 * @param {?proto.org.phenopackets.schema.v2.core.OntologyClass|undefined} value
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
*/
proto.org.phenopackets.schema.v2.core.Individual.prototype.setTaxonomy = function(value) {
  return jspb.Message.setWrapperField(this, 9, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.org.phenopackets.schema.v2.core.Individual} returns this
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.clearTaxonomy = function() {
  return this.setTaxonomy(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.org.phenopackets.schema.v2.core.Individual.prototype.hasTaxonomy = function() {
  return jspb.Message.getField(this, 9) != null;
};





if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.toObject = function(opt_includeInstance) {
  return proto.org.phenopackets.schema.v2.core.VitalStatus.toObject(opt_includeInstance, this);
};


/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.org.phenopackets.schema.v2.core.VitalStatus} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.toObject = function(includeInstance, msg) {
  var f, obj = {
status: jspb.Message.getFieldWithDefault(msg, 1, 0),
timeOfDeath: (f = msg.getTimeOfDeath()) && phenopackets_schema_v2_core_base_pb.TimeElement.toObject(includeInstance, f),
causeOfDeath: (f = msg.getCauseOfDeath()) && phenopackets_schema_v2_core_base_pb.OntologyClass.toObject(includeInstance, f),
survivalTimeInDays: jspb.Message.getFieldWithDefault(msg, 4, 0)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}


/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.org.phenopackets.schema.v2.core.VitalStatus}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.org.phenopackets.schema.v2.core.VitalStatus;
  return proto.org.phenopackets.schema.v2.core.VitalStatus.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.org.phenopackets.schema.v2.core.VitalStatus} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.org.phenopackets.schema.v2.core.VitalStatus}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = /** @type {!proto.org.phenopackets.schema.v2.core.VitalStatus.Status} */ (reader.readEnum());
      msg.setStatus(value);
      break;
    case 2:
      var value = new phenopackets_schema_v2_core_base_pb.TimeElement;
      reader.readMessage(value,phenopackets_schema_v2_core_base_pb.TimeElement.deserializeBinaryFromReader);
      msg.setTimeOfDeath(value);
      break;
    case 3:
      var value = new phenopackets_schema_v2_core_base_pb.OntologyClass;
      reader.readMessage(value,phenopackets_schema_v2_core_base_pb.OntologyClass.deserializeBinaryFromReader);
      msg.setCauseOfDeath(value);
      break;
    case 4:
      var value = /** @type {number} */ (reader.readUint32());
      msg.setSurvivalTimeInDays(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.org.phenopackets.schema.v2.core.VitalStatus.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.org.phenopackets.schema.v2.core.VitalStatus} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getStatus();
  if (f !== 0.0) {
    writer.writeEnum(
      1,
      f
    );
  }
  f = message.getTimeOfDeath();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      phenopackets_schema_v2_core_base_pb.TimeElement.serializeBinaryToWriter
    );
  }
  f = message.getCauseOfDeath();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      phenopackets_schema_v2_core_base_pb.OntologyClass.serializeBinaryToWriter
    );
  }
  f = message.getSurvivalTimeInDays();
  if (f !== 0) {
    writer.writeUint32(
      4,
      f
    );
  }
};


/**
 * @enum {number}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.Status = {
  UNKNOWN_STATUS: 0,
  ALIVE: 1,
  DECEASED: 2
};

/**
 * optional Status status = 1;
 * @return {!proto.org.phenopackets.schema.v2.core.VitalStatus.Status}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.getStatus = function() {
  return /** @type {!proto.org.phenopackets.schema.v2.core.VitalStatus.Status} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};


/**
 * @param {!proto.org.phenopackets.schema.v2.core.VitalStatus.Status} value
 * @return {!proto.org.phenopackets.schema.v2.core.VitalStatus} returns this
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.setStatus = function(value) {
  return jspb.Message.setProto3EnumField(this, 1, value);
};


/**
 * optional TimeElement time_of_death = 2;
 * @return {?proto.org.phenopackets.schema.v2.core.TimeElement}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.getTimeOfDeath = function() {
  return /** @type{?proto.org.phenopackets.schema.v2.core.TimeElement} */ (
    jspb.Message.getWrapperField(this, phenopackets_schema_v2_core_base_pb.TimeElement, 2));
};


/**
 * @param {?proto.org.phenopackets.schema.v2.core.TimeElement|undefined} value
 * @return {!proto.org.phenopackets.schema.v2.core.VitalStatus} returns this
*/
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.setTimeOfDeath = function(value) {
  return jspb.Message.setWrapperField(this, 2, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.org.phenopackets.schema.v2.core.VitalStatus} returns this
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.clearTimeOfDeath = function() {
  return this.setTimeOfDeath(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.hasTimeOfDeath = function() {
  return jspb.Message.getField(this, 2) != null;
};


/**
 * optional OntologyClass cause_of_death = 3;
 * @return {?proto.org.phenopackets.schema.v2.core.OntologyClass}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.getCauseOfDeath = function() {
  return /** @type{?proto.org.phenopackets.schema.v2.core.OntologyClass} */ (
    jspb.Message.getWrapperField(this, phenopackets_schema_v2_core_base_pb.OntologyClass, 3));
};


/**
 * @param {?proto.org.phenopackets.schema.v2.core.OntologyClass|undefined} value
 * @return {!proto.org.phenopackets.schema.v2.core.VitalStatus} returns this
*/
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.setCauseOfDeath = function(value) {
  return jspb.Message.setWrapperField(this, 3, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.org.phenopackets.schema.v2.core.VitalStatus} returns this
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.clearCauseOfDeath = function() {
  return this.setCauseOfDeath(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.hasCauseOfDeath = function() {
  return jspb.Message.getField(this, 3) != null;
};


/**
 * optional uint32 survival_time_in_days = 4;
 * @return {number}
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.getSurvivalTimeInDays = function() {
  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};


/**
 * @param {number} value
 * @return {!proto.org.phenopackets.schema.v2.core.VitalStatus} returns this
 */
proto.org.phenopackets.schema.v2.core.VitalStatus.prototype.setSurvivalTimeInDays = function(value) {
  return jspb.Message.setProto3IntField(this, 4, value);
};


/**
 * @enum {number}
 */
proto.org.phenopackets.schema.v2.core.Sex = {
  UNKNOWN_SEX: 0,
  FEMALE: 1,
  MALE: 2,
  OTHER_SEX: 3
};

/**
 * @enum {number}
 */
proto.org.phenopackets.schema.v2.core.KaryotypicSex = {
  UNKNOWN_KARYOTYPE: 0,
  XX: 1,
  XY: 2,
  XO: 3,
  XXY: 4,
  XXX: 5,
  XXYY: 6,
  XXXY: 7,
  XXXX: 8,
  XYY: 9,
  OTHER_KARYOTYPE: 10
};

goog.object.extend(exports, proto.org.phenopackets.schema.v2.core);