// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: drug.proto

package com.ywt.gapi.drug;

/**
 * <pre>
 *药物使用信息
 * </pre>
 *
 * Protobuf type {@code com.ywt.gapi.drug.DrugUsage}
 */
public  final class DrugUsage extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:com.ywt.gapi.drug.DrugUsage)
    DrugUsageOrBuilder {
  // Use DrugUsage.newBuilder() to construct.
  private DrugUsage(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private DrugUsage() {
    drugId_ = 0;
    eachDose_ = 0D;
    usage_ = "";
    frequency_ = "";
    course_ = 0;
    quantity_ = 0;
    remark_ = "";
    frequencyCode_ = "";
    group_ = 0;
    orderIndex_ = 0;
    combination_ = 0;
    usageCode_ = "";
    spec_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
  }
  private DrugUsage(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    int mutable_bitField0_ = 0;
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!input.skipField(tag)) {
              done = true;
            }
            break;
          }
          case 8: {

            drugId_ = input.readInt32();
            break;
          }
          case 17: {

            eachDose_ = input.readDouble();
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();

            usage_ = s;
            break;
          }
          case 34: {
            java.lang.String s = input.readStringRequireUtf8();

            frequency_ = s;
            break;
          }
          case 40: {

            course_ = input.readInt32();
            break;
          }
          case 48: {

            quantity_ = input.readInt32();
            break;
          }
          case 58: {
            java.lang.String s = input.readStringRequireUtf8();

            remark_ = s;
            break;
          }
          case 66: {
            java.lang.String s = input.readStringRequireUtf8();

            frequencyCode_ = s;
            break;
          }
          case 144: {

            group_ = input.readInt32();
            break;
          }
          case 152: {

            orderIndex_ = input.readInt32();
            break;
          }
          case 160: {

            combination_ = input.readInt32();
            break;
          }
          case 170: {
            java.lang.String s = input.readStringRequireUtf8();

            usageCode_ = s;
            break;
          }
          case 178: {
            java.lang.String s = input.readStringRequireUtf8();

            spec_ = s;
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.ywt.gapi.drug.DrugOuterClass.internal_static_com_ywt_gapi_drug_DrugUsage_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.ywt.gapi.drug.DrugOuterClass.internal_static_com_ywt_gapi_drug_DrugUsage_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.ywt.gapi.drug.DrugUsage.class, com.ywt.gapi.drug.DrugUsage.Builder.class);
  }

  public static final int DRUGID_FIELD_NUMBER = 1;
  private int drugId_;
  /**
   * <pre>
   *药品Id
   * </pre>
   *
   * <code>int32 drugId = 1;</code>
   */
  public int getDrugId() {
    return drugId_;
  }

  public static final int EACHDOSE_FIELD_NUMBER = 2;
  private double eachDose_;
  /**
   * <pre>
   *每次剂量
   * </pre>
   *
   * <code>double eachDose = 2;</code>
   */
  public double getEachDose() {
    return eachDose_;
  }

  public static final int USAGE_FIELD_NUMBER = 3;
  private volatile java.lang.Object usage_;
  /**
   * <pre>
   *用法
   * </pre>
   *
   * <code>string usage = 3;</code>
   */
  public java.lang.String getUsage() {
    java.lang.Object ref = usage_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      usage_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *用法
   * </pre>
   *
   * <code>string usage = 3;</code>
   */
  public com.google.protobuf.ByteString
      getUsageBytes() {
    java.lang.Object ref = usage_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      usage_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int FREQUENCY_FIELD_NUMBER = 4;
  private volatile java.lang.Object frequency_;
  /**
   * <pre>
   *用药频率
   * </pre>
   *
   * <code>string frequency = 4;</code>
   */
  public java.lang.String getFrequency() {
    java.lang.Object ref = frequency_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      frequency_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *用药频率
   * </pre>
   *
   * <code>string frequency = 4;</code>
   */
  public com.google.protobuf.ByteString
      getFrequencyBytes() {
    java.lang.Object ref = frequency_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      frequency_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int COURSE_FIELD_NUMBER = 5;
  private int course_;
  /**
   * <pre>
   *疗程，单位：天
   * </pre>
   *
   * <code>int32 course = 5;</code>
   */
  public int getCourse() {
    return course_;
  }

  public static final int QUANTITY_FIELD_NUMBER = 6;
  private int quantity_;
  /**
   * <pre>
   *药品数量
   * </pre>
   *
   * <code>int32 quantity = 6;</code>
   */
  public int getQuantity() {
    return quantity_;
  }

  public static final int REMARK_FIELD_NUMBER = 7;
  private volatile java.lang.Object remark_;
  /**
   * <pre>
   *备注
   * </pre>
   *
   * <code>string remark = 7;</code>
   */
  public java.lang.String getRemark() {
    java.lang.Object ref = remark_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      remark_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *备注
   * </pre>
   *
   * <code>string remark = 7;</code>
   */
  public com.google.protobuf.ByteString
      getRemarkBytes() {
    java.lang.Object ref = remark_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      remark_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int FREQUENCYCODE_FIELD_NUMBER = 8;
  private volatile java.lang.Object frequencyCode_;
  /**
   * <pre>
   *用药频率编码
   * </pre>
   *
   * <code>string frequencyCode = 8;</code>
   */
  public java.lang.String getFrequencyCode() {
    java.lang.Object ref = frequencyCode_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      frequencyCode_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *用药频率编码
   * </pre>
   *
   * <code>string frequencyCode = 8;</code>
   */
  public com.google.protobuf.ByteString
      getFrequencyCodeBytes() {
    java.lang.Object ref = frequencyCode_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      frequencyCode_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int GROUP_FIELD_NUMBER = 18;
  private int group_;
  /**
   * <pre>
   *组号，组号相同表示它们为同组药
   * </pre>
   *
   * <code>int32 group = 18;</code>
   */
  public int getGroup() {
    return group_;
  }

  public static final int ORDERINDEX_FIELD_NUMBER = 19;
  private int orderIndex_;
  /**
   * <pre>
   *序号
   * </pre>
   *
   * <code>int32 orderIndex = 19;</code>
   */
  public int getOrderIndex() {
    return orderIndex_;
  }

  public static final int COMBINATION_FIELD_NUMBER = 20;
  private int combination_;
  /**
   * <pre>
   *是否组合
   * </pre>
   *
   * <code>int32 combination = 20;</code>
   */
  public int getCombination() {
    return combination_;
  }

  public static final int USAGECODE_FIELD_NUMBER = 21;
  private volatile java.lang.Object usageCode_;
  /**
   * <pre>
   * 用药频率编码
   * </pre>
   *
   * <code>string usageCode = 21;</code>
   */
  public java.lang.String getUsageCode() {
    java.lang.Object ref = usageCode_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      usageCode_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * 用药频率编码
   * </pre>
   *
   * <code>string usageCode = 21;</code>
   */
  public com.google.protobuf.ByteString
      getUsageCodeBytes() {
    java.lang.Object ref = usageCode_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      usageCode_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SPEC_FIELD_NUMBER = 22;
  private volatile java.lang.Object spec_;
  /**
   * <code>string spec = 22;</code>
   */
  public java.lang.String getSpec() {
    java.lang.Object ref = spec_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      spec_ = s;
      return s;
    }
  }
  /**
   * <code>string spec = 22;</code>
   */
  public com.google.protobuf.ByteString
      getSpecBytes() {
    java.lang.Object ref = spec_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      spec_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (drugId_ != 0) {
      output.writeInt32(1, drugId_);
    }
    if (eachDose_ != 0D) {
      output.writeDouble(2, eachDose_);
    }
    if (!getUsageBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, usage_);
    }
    if (!getFrequencyBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, frequency_);
    }
    if (course_ != 0) {
      output.writeInt32(5, course_);
    }
    if (quantity_ != 0) {
      output.writeInt32(6, quantity_);
    }
    if (!getRemarkBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, remark_);
    }
    if (!getFrequencyCodeBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, frequencyCode_);
    }
    if (group_ != 0) {
      output.writeInt32(18, group_);
    }
    if (orderIndex_ != 0) {
      output.writeInt32(19, orderIndex_);
    }
    if (combination_ != 0) {
      output.writeInt32(20, combination_);
    }
    if (!getUsageCodeBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 21, usageCode_);
    }
    if (!getSpecBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 22, spec_);
    }
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (drugId_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(1, drugId_);
    }
    if (eachDose_ != 0D) {
      size += com.google.protobuf.CodedOutputStream
        .computeDoubleSize(2, eachDose_);
    }
    if (!getUsageBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, usage_);
    }
    if (!getFrequencyBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, frequency_);
    }
    if (course_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(5, course_);
    }
    if (quantity_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(6, quantity_);
    }
    if (!getRemarkBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, remark_);
    }
    if (!getFrequencyCodeBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, frequencyCode_);
    }
    if (group_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(18, group_);
    }
    if (orderIndex_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(19, orderIndex_);
    }
    if (combination_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(20, combination_);
    }
    if (!getUsageCodeBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, usageCode_);
    }
    if (!getSpecBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, spec_);
    }
    memoizedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.ywt.gapi.drug.DrugUsage)) {
      return super.equals(obj);
    }
    com.ywt.gapi.drug.DrugUsage other = (com.ywt.gapi.drug.DrugUsage) obj;

    boolean result = true;
    result = result && (getDrugId()
        == other.getDrugId());
    result = result && (
        java.lang.Double.doubleToLongBits(getEachDose())
        == java.lang.Double.doubleToLongBits(
            other.getEachDose()));
    result = result && getUsage()
        .equals(other.getUsage());
    result = result && getFrequency()
        .equals(other.getFrequency());
    result = result && (getCourse()
        == other.getCourse());
    result = result && (getQuantity()
        == other.getQuantity());
    result = result && getRemark()
        .equals(other.getRemark());
    result = result && getFrequencyCode()
        .equals(other.getFrequencyCode());
    result = result && (getGroup()
        == other.getGroup());
    result = result && (getOrderIndex()
        == other.getOrderIndex());
    result = result && (getCombination()
        == other.getCombination());
    result = result && getUsageCode()
        .equals(other.getUsageCode());
    result = result && getSpec()
        .equals(other.getSpec());
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + DRUGID_FIELD_NUMBER;
    hash = (53 * hash) + getDrugId();
    hash = (37 * hash) + EACHDOSE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        java.lang.Double.doubleToLongBits(getEachDose()));
    hash = (37 * hash) + USAGE_FIELD_NUMBER;
    hash = (53 * hash) + getUsage().hashCode();
    hash = (37 * hash) + FREQUENCY_FIELD_NUMBER;
    hash = (53 * hash) + getFrequency().hashCode();
    hash = (37 * hash) + COURSE_FIELD_NUMBER;
    hash = (53 * hash) + getCourse();
    hash = (37 * hash) + QUANTITY_FIELD_NUMBER;
    hash = (53 * hash) + getQuantity();
    hash = (37 * hash) + REMARK_FIELD_NUMBER;
    hash = (53 * hash) + getRemark().hashCode();
    hash = (37 * hash) + FREQUENCYCODE_FIELD_NUMBER;
    hash = (53 * hash) + getFrequencyCode().hashCode();
    hash = (37 * hash) + GROUP_FIELD_NUMBER;
    hash = (53 * hash) + getGroup();
    hash = (37 * hash) + ORDERINDEX_FIELD_NUMBER;
    hash = (53 * hash) + getOrderIndex();
    hash = (37 * hash) + COMBINATION_FIELD_NUMBER;
    hash = (53 * hash) + getCombination();
    hash = (37 * hash) + USAGECODE_FIELD_NUMBER;
    hash = (53 * hash) + getUsageCode().hashCode();
    hash = (37 * hash) + SPEC_FIELD_NUMBER;
    hash = (53 * hash) + getSpec().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.ywt.gapi.drug.DrugUsage parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.ywt.gapi.drug.DrugUsage parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.ywt.gapi.drug.DrugUsage parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.ywt.gapi.drug.DrugUsage parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.ywt.gapi.drug.DrugUsage parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.ywt.gapi.drug.DrugUsage parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.ywt.gapi.drug.DrugUsage parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.ywt.gapi.drug.DrugUsage parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.ywt.gapi.drug.DrugUsage parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.ywt.gapi.drug.DrugUsage parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.ywt.gapi.drug.DrugUsage parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.ywt.gapi.drug.DrugUsage parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.ywt.gapi.drug.DrugUsage prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   *药物使用信息
   * </pre>
   *
   * Protobuf type {@code com.ywt.gapi.drug.DrugUsage}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:com.ywt.gapi.drug.DrugUsage)
      com.ywt.gapi.drug.DrugUsageOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.ywt.gapi.drug.DrugOuterClass.internal_static_com_ywt_gapi_drug_DrugUsage_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.ywt.gapi.drug.DrugOuterClass.internal_static_com_ywt_gapi_drug_DrugUsage_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.ywt.gapi.drug.DrugUsage.class, com.ywt.gapi.drug.DrugUsage.Builder.class);
    }

    // Construct using com.ywt.gapi.drug.DrugUsage.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      drugId_ = 0;

      eachDose_ = 0D;

      usage_ = "";

      frequency_ = "";

      course_ = 0;

      quantity_ = 0;

      remark_ = "";

      frequencyCode_ = "";

      group_ = 0;

      orderIndex_ = 0;

      combination_ = 0;

      usageCode_ = "";

      spec_ = "";

      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.ywt.gapi.drug.DrugOuterClass.internal_static_com_ywt_gapi_drug_DrugUsage_descriptor;
    }

    public com.ywt.gapi.drug.DrugUsage getDefaultInstanceForType() {
      return com.ywt.gapi.drug.DrugUsage.getDefaultInstance();
    }

    public com.ywt.gapi.drug.DrugUsage build() {
      com.ywt.gapi.drug.DrugUsage result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.ywt.gapi.drug.DrugUsage buildPartial() {
      com.ywt.gapi.drug.DrugUsage result = new com.ywt.gapi.drug.DrugUsage(this);
      result.drugId_ = drugId_;
      result.eachDose_ = eachDose_;
      result.usage_ = usage_;
      result.frequency_ = frequency_;
      result.course_ = course_;
      result.quantity_ = quantity_;
      result.remark_ = remark_;
      result.frequencyCode_ = frequencyCode_;
      result.group_ = group_;
      result.orderIndex_ = orderIndex_;
      result.combination_ = combination_;
      result.usageCode_ = usageCode_;
      result.spec_ = spec_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.ywt.gapi.drug.DrugUsage) {
        return mergeFrom((com.ywt.gapi.drug.DrugUsage)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.ywt.gapi.drug.DrugUsage other) {
      if (other == com.ywt.gapi.drug.DrugUsage.getDefaultInstance()) return this;
      if (other.getDrugId() != 0) {
        setDrugId(other.getDrugId());
      }
      if (other.getEachDose() != 0D) {
        setEachDose(other.getEachDose());
      }
      if (!other.getUsage().isEmpty()) {
        usage_ = other.usage_;
        onChanged();
      }
      if (!other.getFrequency().isEmpty()) {
        frequency_ = other.frequency_;
        onChanged();
      }
      if (other.getCourse() != 0) {
        setCourse(other.getCourse());
      }
      if (other.getQuantity() != 0) {
        setQuantity(other.getQuantity());
      }
      if (!other.getRemark().isEmpty()) {
        remark_ = other.remark_;
        onChanged();
      }
      if (!other.getFrequencyCode().isEmpty()) {
        frequencyCode_ = other.frequencyCode_;
        onChanged();
      }
      if (other.getGroup() != 0) {
        setGroup(other.getGroup());
      }
      if (other.getOrderIndex() != 0) {
        setOrderIndex(other.getOrderIndex());
      }
      if (other.getCombination() != 0) {
        setCombination(other.getCombination());
      }
      if (!other.getUsageCode().isEmpty()) {
        usageCode_ = other.usageCode_;
        onChanged();
      }
      if (!other.getSpec().isEmpty()) {
        spec_ = other.spec_;
        onChanged();
      }
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.ywt.gapi.drug.DrugUsage parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.ywt.gapi.drug.DrugUsage) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int drugId_ ;
    /**
     * <pre>
     *药品Id
     * </pre>
     *
     * <code>int32 drugId = 1;</code>
     */
    public int getDrugId() {
      return drugId_;
    }
    /**
     * <pre>
     *药品Id
     * </pre>
     *
     * <code>int32 drugId = 1;</code>
     */
    public Builder setDrugId(int value) {
      
      drugId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *药品Id
     * </pre>
     *
     * <code>int32 drugId = 1;</code>
     */
    public Builder clearDrugId() {
      
      drugId_ = 0;
      onChanged();
      return this;
    }

    private double eachDose_ ;
    /**
     * <pre>
     *每次剂量
     * </pre>
     *
     * <code>double eachDose = 2;</code>
     */
    public double getEachDose() {
      return eachDose_;
    }
    /**
     * <pre>
     *每次剂量
     * </pre>
     *
     * <code>double eachDose = 2;</code>
     */
    public Builder setEachDose(double value) {
      
      eachDose_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *每次剂量
     * </pre>
     *
     * <code>double eachDose = 2;</code>
     */
    public Builder clearEachDose() {
      
      eachDose_ = 0D;
      onChanged();
      return this;
    }

    private java.lang.Object usage_ = "";
    /**
     * <pre>
     *用法
     * </pre>
     *
     * <code>string usage = 3;</code>
     */
    public java.lang.String getUsage() {
      java.lang.Object ref = usage_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        usage_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *用法
     * </pre>
     *
     * <code>string usage = 3;</code>
     */
    public com.google.protobuf.ByteString
        getUsageBytes() {
      java.lang.Object ref = usage_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        usage_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *用法
     * </pre>
     *
     * <code>string usage = 3;</code>
     */
    public Builder setUsage(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      usage_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *用法
     * </pre>
     *
     * <code>string usage = 3;</code>
     */
    public Builder clearUsage() {
      
      usage_ = getDefaultInstance().getUsage();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *用法
     * </pre>
     *
     * <code>string usage = 3;</code>
     */
    public Builder setUsageBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      usage_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object frequency_ = "";
    /**
     * <pre>
     *用药频率
     * </pre>
     *
     * <code>string frequency = 4;</code>
     */
    public java.lang.String getFrequency() {
      java.lang.Object ref = frequency_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        frequency_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *用药频率
     * </pre>
     *
     * <code>string frequency = 4;</code>
     */
    public com.google.protobuf.ByteString
        getFrequencyBytes() {
      java.lang.Object ref = frequency_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        frequency_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *用药频率
     * </pre>
     *
     * <code>string frequency = 4;</code>
     */
    public Builder setFrequency(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      frequency_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *用药频率
     * </pre>
     *
     * <code>string frequency = 4;</code>
     */
    public Builder clearFrequency() {
      
      frequency_ = getDefaultInstance().getFrequency();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *用药频率
     * </pre>
     *
     * <code>string frequency = 4;</code>
     */
    public Builder setFrequencyBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      frequency_ = value;
      onChanged();
      return this;
    }

    private int course_ ;
    /**
     * <pre>
     *疗程，单位：天
     * </pre>
     *
     * <code>int32 course = 5;</code>
     */
    public int getCourse() {
      return course_;
    }
    /**
     * <pre>
     *疗程，单位：天
     * </pre>
     *
     * <code>int32 course = 5;</code>
     */
    public Builder setCourse(int value) {
      
      course_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *疗程，单位：天
     * </pre>
     *
     * <code>int32 course = 5;</code>
     */
    public Builder clearCourse() {
      
      course_ = 0;
      onChanged();
      return this;
    }

    private int quantity_ ;
    /**
     * <pre>
     *药品数量
     * </pre>
     *
     * <code>int32 quantity = 6;</code>
     */
    public int getQuantity() {
      return quantity_;
    }
    /**
     * <pre>
     *药品数量
     * </pre>
     *
     * <code>int32 quantity = 6;</code>
     */
    public Builder setQuantity(int value) {
      
      quantity_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *药品数量
     * </pre>
     *
     * <code>int32 quantity = 6;</code>
     */
    public Builder clearQuantity() {
      
      quantity_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object remark_ = "";
    /**
     * <pre>
     *备注
     * </pre>
     *
     * <code>string remark = 7;</code>
     */
    public java.lang.String getRemark() {
      java.lang.Object ref = remark_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        remark_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *备注
     * </pre>
     *
     * <code>string remark = 7;</code>
     */
    public com.google.protobuf.ByteString
        getRemarkBytes() {
      java.lang.Object ref = remark_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        remark_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *备注
     * </pre>
     *
     * <code>string remark = 7;</code>
     */
    public Builder setRemark(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      remark_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *备注
     * </pre>
     *
     * <code>string remark = 7;</code>
     */
    public Builder clearRemark() {
      
      remark_ = getDefaultInstance().getRemark();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *备注
     * </pre>
     *
     * <code>string remark = 7;</code>
     */
    public Builder setRemarkBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      remark_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object frequencyCode_ = "";
    /**
     * <pre>
     *用药频率编码
     * </pre>
     *
     * <code>string frequencyCode = 8;</code>
     */
    public java.lang.String getFrequencyCode() {
      java.lang.Object ref = frequencyCode_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        frequencyCode_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *用药频率编码
     * </pre>
     *
     * <code>string frequencyCode = 8;</code>
     */
    public com.google.protobuf.ByteString
        getFrequencyCodeBytes() {
      java.lang.Object ref = frequencyCode_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        frequencyCode_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *用药频率编码
     * </pre>
     *
     * <code>string frequencyCode = 8;</code>
     */
    public Builder setFrequencyCode(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      frequencyCode_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *用药频率编码
     * </pre>
     *
     * <code>string frequencyCode = 8;</code>
     */
    public Builder clearFrequencyCode() {
      
      frequencyCode_ = getDefaultInstance().getFrequencyCode();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *用药频率编码
     * </pre>
     *
     * <code>string frequencyCode = 8;</code>
     */
    public Builder setFrequencyCodeBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      frequencyCode_ = value;
      onChanged();
      return this;
    }

    private int group_ ;
    /**
     * <pre>
     *组号，组号相同表示它们为同组药
     * </pre>
     *
     * <code>int32 group = 18;</code>
     */
    public int getGroup() {
      return group_;
    }
    /**
     * <pre>
     *组号，组号相同表示它们为同组药
     * </pre>
     *
     * <code>int32 group = 18;</code>
     */
    public Builder setGroup(int value) {
      
      group_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *组号，组号相同表示它们为同组药
     * </pre>
     *
     * <code>int32 group = 18;</code>
     */
    public Builder clearGroup() {
      
      group_ = 0;
      onChanged();
      return this;
    }

    private int orderIndex_ ;
    /**
     * <pre>
     *序号
     * </pre>
     *
     * <code>int32 orderIndex = 19;</code>
     */
    public int getOrderIndex() {
      return orderIndex_;
    }
    /**
     * <pre>
     *序号
     * </pre>
     *
     * <code>int32 orderIndex = 19;</code>
     */
    public Builder setOrderIndex(int value) {
      
      orderIndex_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *序号
     * </pre>
     *
     * <code>int32 orderIndex = 19;</code>
     */
    public Builder clearOrderIndex() {
      
      orderIndex_ = 0;
      onChanged();
      return this;
    }

    private int combination_ ;
    /**
     * <pre>
     *是否组合
     * </pre>
     *
     * <code>int32 combination = 20;</code>
     */
    public int getCombination() {
      return combination_;
    }
    /**
     * <pre>
     *是否组合
     * </pre>
     *
     * <code>int32 combination = 20;</code>
     */
    public Builder setCombination(int value) {
      
      combination_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *是否组合
     * </pre>
     *
     * <code>int32 combination = 20;</code>
     */
    public Builder clearCombination() {
      
      combination_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object usageCode_ = "";
    /**
     * <pre>
     * 用药频率编码
     * </pre>
     *
     * <code>string usageCode = 21;</code>
     */
    public java.lang.String getUsageCode() {
      java.lang.Object ref = usageCode_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        usageCode_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * 用药频率编码
     * </pre>
     *
     * <code>string usageCode = 21;</code>
     */
    public com.google.protobuf.ByteString
        getUsageCodeBytes() {
      java.lang.Object ref = usageCode_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        usageCode_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * 用药频率编码
     * </pre>
     *
     * <code>string usageCode = 21;</code>
     */
    public Builder setUsageCode(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      usageCode_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 用药频率编码
     * </pre>
     *
     * <code>string usageCode = 21;</code>
     */
    public Builder clearUsageCode() {
      
      usageCode_ = getDefaultInstance().getUsageCode();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 用药频率编码
     * </pre>
     *
     * <code>string usageCode = 21;</code>
     */
    public Builder setUsageCodeBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      usageCode_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object spec_ = "";
    /**
     * <code>string spec = 22;</code>
     */
    public java.lang.String getSpec() {
      java.lang.Object ref = spec_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        spec_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>string spec = 22;</code>
     */
    public com.google.protobuf.ByteString
        getSpecBytes() {
      java.lang.Object ref = spec_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        spec_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>string spec = 22;</code>
     */
    public Builder setSpec(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      spec_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>string spec = 22;</code>
     */
    public Builder clearSpec() {
      
      spec_ = getDefaultInstance().getSpec();
      onChanged();
      return this;
    }
    /**
     * <code>string spec = 22;</code>
     */
    public Builder setSpecBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      spec_ = value;
      onChanged();
      return this;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }


    // @@protoc_insertion_point(builder_scope:com.ywt.gapi.drug.DrugUsage)
  }

  // @@protoc_insertion_point(class_scope:com.ywt.gapi.drug.DrugUsage)
  private static final com.ywt.gapi.drug.DrugUsage DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.ywt.gapi.drug.DrugUsage();
  }

  public static com.ywt.gapi.drug.DrugUsage getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<DrugUsage>
      PARSER = new com.google.protobuf.AbstractParser<DrugUsage>() {
    public DrugUsage parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
        return new DrugUsage(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<DrugUsage> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<DrugUsage> getParserForType() {
    return PARSER;
  }

  public com.ywt.gapi.drug.DrugUsage getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

