// 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.SavePrescriptionInfoRequest}
 */
public  final class SavePrescriptionInfoRequest extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:com.ywt.gapi.drug.SavePrescriptionInfoRequest)
    SavePrescriptionInfoRequestOrBuilder {
  // Use SavePrescriptionInfoRequest.newBuilder() to construct.
  private SavePrescriptionInfoRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private SavePrescriptionInfoRequest() {
    hospitalId_ = 0;
    patientName_ = "";
    patientSex_ = 0;
    patientAge_ = 0;
    patientMobile_ = "";
    diagnosis_ = "";
    allergicHistory_ = "";
    description_ = "";
    doctorId_ = 0;
    doctorSignId_ = 0;
    drugUsage_ = java.util.Collections.emptyList();
    doctorName_ = "";
    source_ = 0;
    deptName_ = "";
    userId_ = 0;
    idCardNo_ = "";
    flag_ = 0;
    patientNo_ = "";
    pharmacyId_ = 0;
    icdCode_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    writeBack2His_ = false;
    address_ = "";
    medRecordId_ = 0;
    prevPreId_ = 0;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
  }
  private SavePrescriptionInfoRequest(
      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: {

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

            patientName_ = s;
            break;
          }
          case 24: {

            patientSex_ = input.readInt32();
            break;
          }
          case 32: {

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

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

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

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

            description_ = s;
            break;
          }
          case 72: {

            doctorId_ = input.readInt32();
            break;
          }
          case 80: {

            doctorSignId_ = input.readInt32();
            break;
          }
          case 90: {
            if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
              drugUsage_ = new java.util.ArrayList<com.ywt.gapi.drug.DrugUsage>();
              mutable_bitField0_ |= 0x00000400;
            }
            drugUsage_.add(
                input.readMessage(com.ywt.gapi.drug.DrugUsage.parser(), extensionRegistry));
            break;
          }
          case 98: {
            java.lang.String s = input.readStringRequireUtf8();

            doctorName_ = s;
            break;
          }
          case 104: {

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

            deptName_ = s;
            break;
          }
          case 120: {

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

            idCardNo_ = s;
            break;
          }
          case 136: {

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

            patientNo_ = s;
            break;
          }
          case 152: {

            pharmacyId_ = input.readInt32();
            break;
          }
          case 162: {
            java.lang.String s = input.readStringRequireUtf8();
            if (!((mutable_bitField0_ & 0x00080000) == 0x00080000)) {
              icdCode_ = new com.google.protobuf.LazyStringArrayList();
              mutable_bitField0_ |= 0x00080000;
            }
            icdCode_.add(s);
            break;
          }
          case 168: {

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

            address_ = s;
            break;
          }
          case 184: {

            medRecordId_ = input.readInt32();
            break;
          }
          case 192: {

            prevPreId_ = input.readInt32();
            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 {
      if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
        drugUsage_ = java.util.Collections.unmodifiableList(drugUsage_);
      }
      if (((mutable_bitField0_ & 0x00080000) == 0x00080000)) {
        icdCode_ = icdCode_.getUnmodifiableView();
      }
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.ywt.gapi.drug.DrugOuterClass.internal_static_com_ywt_gapi_drug_SavePrescriptionInfoRequest_descriptor;
  }

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

  private int bitField0_;
  public static final int HOSPITALID_FIELD_NUMBER = 1;
  private int hospitalId_;
  /**
   * <pre>
   *处方医院Id
   * </pre>
   *
   * <code>int32 hospitalId = 1;</code>
   */
  public int getHospitalId() {
    return hospitalId_;
  }

  public static final int PATIENTNAME_FIELD_NUMBER = 2;
  private volatile java.lang.Object patientName_;
  /**
   * <pre>
   *患者姓名
   * </pre>
   *
   * <code>string patientName = 2;</code>
   */
  public java.lang.String getPatientName() {
    java.lang.Object ref = patientName_;
    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();
      patientName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *患者姓名
   * </pre>
   *
   * <code>string patientName = 2;</code>
   */
  public com.google.protobuf.ByteString
      getPatientNameBytes() {
    java.lang.Object ref = patientName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      patientName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PATIENTSEX_FIELD_NUMBER = 3;
  private int patientSex_;
  /**
   * <pre>
   *患者性别
   * </pre>
   *
   * <code>int32 patientSex = 3;</code>
   */
  public int getPatientSex() {
    return patientSex_;
  }

  public static final int PATIENTAGE_FIELD_NUMBER = 4;
  private int patientAge_;
  /**
   * <pre>
   *患者年龄
   * </pre>
   *
   * <code>int32 patientAge = 4;</code>
   */
  public int getPatientAge() {
    return patientAge_;
  }

  public static final int PATIENTMOBILE_FIELD_NUMBER = 5;
  private volatile java.lang.Object patientMobile_;
  /**
   * <pre>
   *患者手机号
   * </pre>
   *
   * <code>string patientMobile = 5;</code>
   */
  public java.lang.String getPatientMobile() {
    java.lang.Object ref = patientMobile_;
    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();
      patientMobile_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *患者手机号
   * </pre>
   *
   * <code>string patientMobile = 5;</code>
   */
  public com.google.protobuf.ByteString
      getPatientMobileBytes() {
    java.lang.Object ref = patientMobile_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      patientMobile_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DIAGNOSIS_FIELD_NUMBER = 6;
  private volatile java.lang.Object diagnosis_;
  /**
   * <pre>
   *诊断结果
   * </pre>
   *
   * <code>string diagnosis = 6;</code>
   */
  public java.lang.String getDiagnosis() {
    java.lang.Object ref = diagnosis_;
    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();
      diagnosis_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *诊断结果
   * </pre>
   *
   * <code>string diagnosis = 6;</code>
   */
  public com.google.protobuf.ByteString
      getDiagnosisBytes() {
    java.lang.Object ref = diagnosis_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      diagnosis_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ALLERGICHISTORY_FIELD_NUMBER = 7;
  private volatile java.lang.Object allergicHistory_;
  /**
   * <pre>
   *过敏史
   * </pre>
   *
   * <code>string allergicHistory = 7;</code>
   */
  public java.lang.String getAllergicHistory() {
    java.lang.Object ref = allergicHistory_;
    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();
      allergicHistory_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *过敏史
   * </pre>
   *
   * <code>string allergicHistory = 7;</code>
   */
  public com.google.protobuf.ByteString
      getAllergicHistoryBytes() {
    java.lang.Object ref = allergicHistory_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      allergicHistory_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DESCRIPTION_FIELD_NUMBER = 8;
  private volatile java.lang.Object description_;
  /**
   * <pre>
   *病情描述
   * </pre>
   *
   * <code>string description = 8;</code>
   */
  public java.lang.String getDescription() {
    java.lang.Object ref = description_;
    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();
      description_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *病情描述
   * </pre>
   *
   * <code>string description = 8;</code>
   */
  public com.google.protobuf.ByteString
      getDescriptionBytes() {
    java.lang.Object ref = description_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      description_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DOCTORID_FIELD_NUMBER = 9;
  private int doctorId_;
  /**
   * <pre>
   *医生Id
   * </pre>
   *
   * <code>int32 doctorId = 9;</code>
   */
  public int getDoctorId() {
    return doctorId_;
  }

  public static final int DOCTORSIGNID_FIELD_NUMBER = 10;
  private int doctorSignId_;
  /**
   * <pre>
   *医生签名Id
   * </pre>
   *
   * <code>int32 doctorSignId = 10;</code>
   */
  public int getDoctorSignId() {
    return doctorSignId_;
  }

  public static final int DRUGUSAGE_FIELD_NUMBER = 11;
  private java.util.List<com.ywt.gapi.drug.DrugUsage> drugUsage_;
  /**
   * <pre>
   *药物使用说明
   * </pre>
   *
   * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
   */
  public java.util.List<com.ywt.gapi.drug.DrugUsage> getDrugUsageList() {
    return drugUsage_;
  }
  /**
   * <pre>
   *药物使用说明
   * </pre>
   *
   * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
   */
  public java.util.List<? extends com.ywt.gapi.drug.DrugUsageOrBuilder> 
      getDrugUsageOrBuilderList() {
    return drugUsage_;
  }
  /**
   * <pre>
   *药物使用说明
   * </pre>
   *
   * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
   */
  public int getDrugUsageCount() {
    return drugUsage_.size();
  }
  /**
   * <pre>
   *药物使用说明
   * </pre>
   *
   * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
   */
  public com.ywt.gapi.drug.DrugUsage getDrugUsage(int index) {
    return drugUsage_.get(index);
  }
  /**
   * <pre>
   *药物使用说明
   * </pre>
   *
   * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
   */
  public com.ywt.gapi.drug.DrugUsageOrBuilder getDrugUsageOrBuilder(
      int index) {
    return drugUsage_.get(index);
  }

  public static final int DOCTORNAME_FIELD_NUMBER = 12;
  private volatile java.lang.Object doctorName_;
  /**
   * <pre>
   *医生姓名
   * </pre>
   *
   * <code>string doctorName = 12;</code>
   */
  public java.lang.String getDoctorName() {
    java.lang.Object ref = doctorName_;
    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();
      doctorName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *医生姓名
   * </pre>
   *
   * <code>string doctorName = 12;</code>
   */
  public com.google.protobuf.ByteString
      getDoctorNameBytes() {
    java.lang.Object ref = doctorName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      doctorName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SOURCE_FIELD_NUMBER = 13;
  private int source_;
  /**
   * <pre>
   *处方单来源
   * </pre>
   *
   * <code>int32 source = 13;</code>
   */
  public int getSource() {
    return source_;
  }

  public static final int DEPTNAME_FIELD_NUMBER = 14;
  private volatile java.lang.Object deptName_;
  /**
   * <pre>
   *科室名称
   * </pre>
   *
   * <code>string deptName = 14;</code>
   */
  public java.lang.String getDeptName() {
    java.lang.Object ref = deptName_;
    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();
      deptName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *科室名称
   * </pre>
   *
   * <code>string deptName = 14;</code>
   */
  public com.google.protobuf.ByteString
      getDeptNameBytes() {
    java.lang.Object ref = deptName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      deptName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int USERID_FIELD_NUMBER = 15;
  private int userId_;
  /**
   * <pre>
   *患者Id
   * </pre>
   *
   * <code>int32 userId = 15;</code>
   */
  public int getUserId() {
    return userId_;
  }

  public static final int IDCARDNO_FIELD_NUMBER = 16;
  private volatile java.lang.Object idCardNo_;
  /**
   * <pre>
   *身份证号
   * </pre>
   *
   * <code>string idCardNo = 16;</code>
   */
  public java.lang.String getIdCardNo() {
    java.lang.Object ref = idCardNo_;
    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();
      idCardNo_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *身份证号
   * </pre>
   *
   * <code>string idCardNo = 16;</code>
   */
  public com.google.protobuf.ByteString
      getIdCardNoBytes() {
    java.lang.Object ref = idCardNo_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      idCardNo_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int FLAG_FIELD_NUMBER = 17;
  private int flag_;
  /**
   * <pre>
   *标记值 1: 创建订单中心订单信息
   * </pre>
   *
   * <code>int32 flag = 17;</code>
   */
  public int getFlag() {
    return flag_;
  }

  public static final int PATIENTNO_FIELD_NUMBER = 18;
  private volatile java.lang.Object patientNo_;
  /**
   * <pre>
   *患者手编码
   * </pre>
   *
   * <code>string patientNo = 18;</code>
   */
  public java.lang.String getPatientNo() {
    java.lang.Object ref = patientNo_;
    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();
      patientNo_ = s;
      return s;
    }
  }
  /**
   * <pre>
   *患者手编码
   * </pre>
   *
   * <code>string patientNo = 18;</code>
   */
  public com.google.protobuf.ByteString
      getPatientNoBytes() {
    java.lang.Object ref = patientNo_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      patientNo_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PHARMACYID_FIELD_NUMBER = 19;
  private int pharmacyId_;
  /**
   * <pre>
   *药房ID
   * </pre>
   *
   * <code>int32 pharmacyId = 19;</code>
   */
  public int getPharmacyId() {
    return pharmacyId_;
  }

  public static final int ICDCODE_FIELD_NUMBER = 20;
  private com.google.protobuf.LazyStringList icdCode_;
  /**
   * <pre>
   * 诊断编码列表
   * </pre>
   *
   * <code>repeated string icdCode = 20;</code>
   */
  public com.google.protobuf.ProtocolStringList
      getIcdCodeList() {
    return icdCode_;
  }
  /**
   * <pre>
   * 诊断编码列表
   * </pre>
   *
   * <code>repeated string icdCode = 20;</code>
   */
  public int getIcdCodeCount() {
    return icdCode_.size();
  }
  /**
   * <pre>
   * 诊断编码列表
   * </pre>
   *
   * <code>repeated string icdCode = 20;</code>
   */
  public java.lang.String getIcdCode(int index) {
    return icdCode_.get(index);
  }
  /**
   * <pre>
   * 诊断编码列表
   * </pre>
   *
   * <code>repeated string icdCode = 20;</code>
   */
  public com.google.protobuf.ByteString
      getIcdCodeBytes(int index) {
    return icdCode_.getByteString(index);
  }

  public static final int WRITEBACK2HIS_FIELD_NUMBER = 21;
  private boolean writeBack2His_;
  /**
   * <pre>
   * 是否回写 HIS
   * </pre>
   *
   * <code>bool writeBack2His = 21;</code>
   */
  public boolean getWriteBack2His() {
    return writeBack2His_;
  }

  public static final int ADDRESS_FIELD_NUMBER = 22;
  private volatile java.lang.Object address_;
  /**
   * <pre>
   * 患者地址
   * </pre>
   *
   * <code>string address = 22;</code>
   */
  public java.lang.String getAddress() {
    java.lang.Object ref = address_;
    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();
      address_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * 患者地址
   * </pre>
   *
   * <code>string address = 22;</code>
   */
  public com.google.protobuf.ByteString
      getAddressBytes() {
    java.lang.Object ref = address_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      address_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MEDRECORDID_FIELD_NUMBER = 23;
  private int medRecordId_;
  /**
   * <pre>
   * 病历 id, 医生 PC 端开方，病历和处方关联
   * </pre>
   *
   * <code>int32 medRecordId = 23;</code>
   */
  public int getMedRecordId() {
    return medRecordId_;
  }

  public static final int PREVPREID_FIELD_NUMBER = 24;
  private int prevPreId_;
  /**
   * <pre>
   * 修改处方的 id, 修改处方时传入
   * </pre>
   *
   * <code>int32 prevPreId = 24;</code>
   */
  public int getPrevPreId() {
    return prevPreId_;
  }

  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 (hospitalId_ != 0) {
      output.writeInt32(1, hospitalId_);
    }
    if (!getPatientNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, patientName_);
    }
    if (patientSex_ != 0) {
      output.writeInt32(3, patientSex_);
    }
    if (patientAge_ != 0) {
      output.writeInt32(4, patientAge_);
    }
    if (!getPatientMobileBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, patientMobile_);
    }
    if (!getDiagnosisBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, diagnosis_);
    }
    if (!getAllergicHistoryBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, allergicHistory_);
    }
    if (!getDescriptionBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, description_);
    }
    if (doctorId_ != 0) {
      output.writeInt32(9, doctorId_);
    }
    if (doctorSignId_ != 0) {
      output.writeInt32(10, doctorSignId_);
    }
    for (int i = 0; i < drugUsage_.size(); i++) {
      output.writeMessage(11, drugUsage_.get(i));
    }
    if (!getDoctorNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 12, doctorName_);
    }
    if (source_ != 0) {
      output.writeInt32(13, source_);
    }
    if (!getDeptNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 14, deptName_);
    }
    if (userId_ != 0) {
      output.writeInt32(15, userId_);
    }
    if (!getIdCardNoBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 16, idCardNo_);
    }
    if (flag_ != 0) {
      output.writeInt32(17, flag_);
    }
    if (!getPatientNoBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 18, patientNo_);
    }
    if (pharmacyId_ != 0) {
      output.writeInt32(19, pharmacyId_);
    }
    for (int i = 0; i < icdCode_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 20, icdCode_.getRaw(i));
    }
    if (writeBack2His_ != false) {
      output.writeBool(21, writeBack2His_);
    }
    if (!getAddressBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 22, address_);
    }
    if (medRecordId_ != 0) {
      output.writeInt32(23, medRecordId_);
    }
    if (prevPreId_ != 0) {
      output.writeInt32(24, prevPreId_);
    }
  }

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

    size = 0;
    if (hospitalId_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(1, hospitalId_);
    }
    if (!getPatientNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, patientName_);
    }
    if (patientSex_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(3, patientSex_);
    }
    if (patientAge_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(4, patientAge_);
    }
    if (!getPatientMobileBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, patientMobile_);
    }
    if (!getDiagnosisBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, diagnosis_);
    }
    if (!getAllergicHistoryBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, allergicHistory_);
    }
    if (!getDescriptionBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, description_);
    }
    if (doctorId_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(9, doctorId_);
    }
    if (doctorSignId_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(10, doctorSignId_);
    }
    for (int i = 0; i < drugUsage_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(11, drugUsage_.get(i));
    }
    if (!getDoctorNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, doctorName_);
    }
    if (source_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(13, source_);
    }
    if (!getDeptNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, deptName_);
    }
    if (userId_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(15, userId_);
    }
    if (!getIdCardNoBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, idCardNo_);
    }
    if (flag_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(17, flag_);
    }
    if (!getPatientNoBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, patientNo_);
    }
    if (pharmacyId_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(19, pharmacyId_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < icdCode_.size(); i++) {
        dataSize += computeStringSizeNoTag(icdCode_.getRaw(i));
      }
      size += dataSize;
      size += 2 * getIcdCodeList().size();
    }
    if (writeBack2His_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(21, writeBack2His_);
    }
    if (!getAddressBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, address_);
    }
    if (medRecordId_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(23, medRecordId_);
    }
    if (prevPreId_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(24, prevPreId_);
    }
    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.SavePrescriptionInfoRequest)) {
      return super.equals(obj);
    }
    com.ywt.gapi.drug.SavePrescriptionInfoRequest other = (com.ywt.gapi.drug.SavePrescriptionInfoRequest) obj;

    boolean result = true;
    result = result && (getHospitalId()
        == other.getHospitalId());
    result = result && getPatientName()
        .equals(other.getPatientName());
    result = result && (getPatientSex()
        == other.getPatientSex());
    result = result && (getPatientAge()
        == other.getPatientAge());
    result = result && getPatientMobile()
        .equals(other.getPatientMobile());
    result = result && getDiagnosis()
        .equals(other.getDiagnosis());
    result = result && getAllergicHistory()
        .equals(other.getAllergicHistory());
    result = result && getDescription()
        .equals(other.getDescription());
    result = result && (getDoctorId()
        == other.getDoctorId());
    result = result && (getDoctorSignId()
        == other.getDoctorSignId());
    result = result && getDrugUsageList()
        .equals(other.getDrugUsageList());
    result = result && getDoctorName()
        .equals(other.getDoctorName());
    result = result && (getSource()
        == other.getSource());
    result = result && getDeptName()
        .equals(other.getDeptName());
    result = result && (getUserId()
        == other.getUserId());
    result = result && getIdCardNo()
        .equals(other.getIdCardNo());
    result = result && (getFlag()
        == other.getFlag());
    result = result && getPatientNo()
        .equals(other.getPatientNo());
    result = result && (getPharmacyId()
        == other.getPharmacyId());
    result = result && getIcdCodeList()
        .equals(other.getIcdCodeList());
    result = result && (getWriteBack2His()
        == other.getWriteBack2His());
    result = result && getAddress()
        .equals(other.getAddress());
    result = result && (getMedRecordId()
        == other.getMedRecordId());
    result = result && (getPrevPreId()
        == other.getPrevPreId());
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + HOSPITALID_FIELD_NUMBER;
    hash = (53 * hash) + getHospitalId();
    hash = (37 * hash) + PATIENTNAME_FIELD_NUMBER;
    hash = (53 * hash) + getPatientName().hashCode();
    hash = (37 * hash) + PATIENTSEX_FIELD_NUMBER;
    hash = (53 * hash) + getPatientSex();
    hash = (37 * hash) + PATIENTAGE_FIELD_NUMBER;
    hash = (53 * hash) + getPatientAge();
    hash = (37 * hash) + PATIENTMOBILE_FIELD_NUMBER;
    hash = (53 * hash) + getPatientMobile().hashCode();
    hash = (37 * hash) + DIAGNOSIS_FIELD_NUMBER;
    hash = (53 * hash) + getDiagnosis().hashCode();
    hash = (37 * hash) + ALLERGICHISTORY_FIELD_NUMBER;
    hash = (53 * hash) + getAllergicHistory().hashCode();
    hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
    hash = (53 * hash) + getDescription().hashCode();
    hash = (37 * hash) + DOCTORID_FIELD_NUMBER;
    hash = (53 * hash) + getDoctorId();
    hash = (37 * hash) + DOCTORSIGNID_FIELD_NUMBER;
    hash = (53 * hash) + getDoctorSignId();
    if (getDrugUsageCount() > 0) {
      hash = (37 * hash) + DRUGUSAGE_FIELD_NUMBER;
      hash = (53 * hash) + getDrugUsageList().hashCode();
    }
    hash = (37 * hash) + DOCTORNAME_FIELD_NUMBER;
    hash = (53 * hash) + getDoctorName().hashCode();
    hash = (37 * hash) + SOURCE_FIELD_NUMBER;
    hash = (53 * hash) + getSource();
    hash = (37 * hash) + DEPTNAME_FIELD_NUMBER;
    hash = (53 * hash) + getDeptName().hashCode();
    hash = (37 * hash) + USERID_FIELD_NUMBER;
    hash = (53 * hash) + getUserId();
    hash = (37 * hash) + IDCARDNO_FIELD_NUMBER;
    hash = (53 * hash) + getIdCardNo().hashCode();
    hash = (37 * hash) + FLAG_FIELD_NUMBER;
    hash = (53 * hash) + getFlag();
    hash = (37 * hash) + PATIENTNO_FIELD_NUMBER;
    hash = (53 * hash) + getPatientNo().hashCode();
    hash = (37 * hash) + PHARMACYID_FIELD_NUMBER;
    hash = (53 * hash) + getPharmacyId();
    if (getIcdCodeCount() > 0) {
      hash = (37 * hash) + ICDCODE_FIELD_NUMBER;
      hash = (53 * hash) + getIcdCodeList().hashCode();
    }
    hash = (37 * hash) + WRITEBACK2HIS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getWriteBack2His());
    hash = (37 * hash) + ADDRESS_FIELD_NUMBER;
    hash = (53 * hash) + getAddress().hashCode();
    hash = (37 * hash) + MEDRECORDID_FIELD_NUMBER;
    hash = (53 * hash) + getMedRecordId();
    hash = (37 * hash) + PREVPREID_FIELD_NUMBER;
    hash = (53 * hash) + getPrevPreId();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.ywt.gapi.drug.SavePrescriptionInfoRequest parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.ywt.gapi.drug.SavePrescriptionInfoRequest 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.SavePrescriptionInfoRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.ywt.gapi.drug.SavePrescriptionInfoRequest 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.SavePrescriptionInfoRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.ywt.gapi.drug.SavePrescriptionInfoRequest parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.ywt.gapi.drug.SavePrescriptionInfoRequest parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.ywt.gapi.drug.SavePrescriptionInfoRequest 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.SavePrescriptionInfoRequest parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.ywt.gapi.drug.SavePrescriptionInfoRequest 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.SavePrescriptionInfoRequest parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.ywt.gapi.drug.SavePrescriptionInfoRequest 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.SavePrescriptionInfoRequest 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.SavePrescriptionInfoRequest}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:com.ywt.gapi.drug.SavePrescriptionInfoRequest)
      com.ywt.gapi.drug.SavePrescriptionInfoRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.ywt.gapi.drug.DrugOuterClass.internal_static_com_ywt_gapi_drug_SavePrescriptionInfoRequest_descriptor;
    }

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

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

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

      patientName_ = "";

      patientSex_ = 0;

      patientAge_ = 0;

      patientMobile_ = "";

      diagnosis_ = "";

      allergicHistory_ = "";

      description_ = "";

      doctorId_ = 0;

      doctorSignId_ = 0;

      if (drugUsageBuilder_ == null) {
        drugUsage_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000400);
      } else {
        drugUsageBuilder_.clear();
      }
      doctorName_ = "";

      source_ = 0;

      deptName_ = "";

      userId_ = 0;

      idCardNo_ = "";

      flag_ = 0;

      patientNo_ = "";

      pharmacyId_ = 0;

      icdCode_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00080000);
      writeBack2His_ = false;

      address_ = "";

      medRecordId_ = 0;

      prevPreId_ = 0;

      return this;
    }

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

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

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

    public com.ywt.gapi.drug.SavePrescriptionInfoRequest buildPartial() {
      com.ywt.gapi.drug.SavePrescriptionInfoRequest result = new com.ywt.gapi.drug.SavePrescriptionInfoRequest(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.hospitalId_ = hospitalId_;
      result.patientName_ = patientName_;
      result.patientSex_ = patientSex_;
      result.patientAge_ = patientAge_;
      result.patientMobile_ = patientMobile_;
      result.diagnosis_ = diagnosis_;
      result.allergicHistory_ = allergicHistory_;
      result.description_ = description_;
      result.doctorId_ = doctorId_;
      result.doctorSignId_ = doctorSignId_;
      if (drugUsageBuilder_ == null) {
        if (((bitField0_ & 0x00000400) == 0x00000400)) {
          drugUsage_ = java.util.Collections.unmodifiableList(drugUsage_);
          bitField0_ = (bitField0_ & ~0x00000400);
        }
        result.drugUsage_ = drugUsage_;
      } else {
        result.drugUsage_ = drugUsageBuilder_.build();
      }
      result.doctorName_ = doctorName_;
      result.source_ = source_;
      result.deptName_ = deptName_;
      result.userId_ = userId_;
      result.idCardNo_ = idCardNo_;
      result.flag_ = flag_;
      result.patientNo_ = patientNo_;
      result.pharmacyId_ = pharmacyId_;
      if (((bitField0_ & 0x00080000) == 0x00080000)) {
        icdCode_ = icdCode_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00080000);
      }
      result.icdCode_ = icdCode_;
      result.writeBack2His_ = writeBack2His_;
      result.address_ = address_;
      result.medRecordId_ = medRecordId_;
      result.prevPreId_ = prevPreId_;
      result.bitField0_ = to_bitField0_;
      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.SavePrescriptionInfoRequest) {
        return mergeFrom((com.ywt.gapi.drug.SavePrescriptionInfoRequest)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.ywt.gapi.drug.SavePrescriptionInfoRequest other) {
      if (other == com.ywt.gapi.drug.SavePrescriptionInfoRequest.getDefaultInstance()) return this;
      if (other.getHospitalId() != 0) {
        setHospitalId(other.getHospitalId());
      }
      if (!other.getPatientName().isEmpty()) {
        patientName_ = other.patientName_;
        onChanged();
      }
      if (other.getPatientSex() != 0) {
        setPatientSex(other.getPatientSex());
      }
      if (other.getPatientAge() != 0) {
        setPatientAge(other.getPatientAge());
      }
      if (!other.getPatientMobile().isEmpty()) {
        patientMobile_ = other.patientMobile_;
        onChanged();
      }
      if (!other.getDiagnosis().isEmpty()) {
        diagnosis_ = other.diagnosis_;
        onChanged();
      }
      if (!other.getAllergicHistory().isEmpty()) {
        allergicHistory_ = other.allergicHistory_;
        onChanged();
      }
      if (!other.getDescription().isEmpty()) {
        description_ = other.description_;
        onChanged();
      }
      if (other.getDoctorId() != 0) {
        setDoctorId(other.getDoctorId());
      }
      if (other.getDoctorSignId() != 0) {
        setDoctorSignId(other.getDoctorSignId());
      }
      if (drugUsageBuilder_ == null) {
        if (!other.drugUsage_.isEmpty()) {
          if (drugUsage_.isEmpty()) {
            drugUsage_ = other.drugUsage_;
            bitField0_ = (bitField0_ & ~0x00000400);
          } else {
            ensureDrugUsageIsMutable();
            drugUsage_.addAll(other.drugUsage_);
          }
          onChanged();
        }
      } else {
        if (!other.drugUsage_.isEmpty()) {
          if (drugUsageBuilder_.isEmpty()) {
            drugUsageBuilder_.dispose();
            drugUsageBuilder_ = null;
            drugUsage_ = other.drugUsage_;
            bitField0_ = (bitField0_ & ~0x00000400);
            drugUsageBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getDrugUsageFieldBuilder() : null;
          } else {
            drugUsageBuilder_.addAllMessages(other.drugUsage_);
          }
        }
      }
      if (!other.getDoctorName().isEmpty()) {
        doctorName_ = other.doctorName_;
        onChanged();
      }
      if (other.getSource() != 0) {
        setSource(other.getSource());
      }
      if (!other.getDeptName().isEmpty()) {
        deptName_ = other.deptName_;
        onChanged();
      }
      if (other.getUserId() != 0) {
        setUserId(other.getUserId());
      }
      if (!other.getIdCardNo().isEmpty()) {
        idCardNo_ = other.idCardNo_;
        onChanged();
      }
      if (other.getFlag() != 0) {
        setFlag(other.getFlag());
      }
      if (!other.getPatientNo().isEmpty()) {
        patientNo_ = other.patientNo_;
        onChanged();
      }
      if (other.getPharmacyId() != 0) {
        setPharmacyId(other.getPharmacyId());
      }
      if (!other.icdCode_.isEmpty()) {
        if (icdCode_.isEmpty()) {
          icdCode_ = other.icdCode_;
          bitField0_ = (bitField0_ & ~0x00080000);
        } else {
          ensureIcdCodeIsMutable();
          icdCode_.addAll(other.icdCode_);
        }
        onChanged();
      }
      if (other.getWriteBack2His() != false) {
        setWriteBack2His(other.getWriteBack2His());
      }
      if (!other.getAddress().isEmpty()) {
        address_ = other.address_;
        onChanged();
      }
      if (other.getMedRecordId() != 0) {
        setMedRecordId(other.getMedRecordId());
      }
      if (other.getPrevPreId() != 0) {
        setPrevPreId(other.getPrevPreId());
      }
      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.SavePrescriptionInfoRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.ywt.gapi.drug.SavePrescriptionInfoRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private int hospitalId_ ;
    /**
     * <pre>
     *处方医院Id
     * </pre>
     *
     * <code>int32 hospitalId = 1;</code>
     */
    public int getHospitalId() {
      return hospitalId_;
    }
    /**
     * <pre>
     *处方医院Id
     * </pre>
     *
     * <code>int32 hospitalId = 1;</code>
     */
    public Builder setHospitalId(int value) {
      
      hospitalId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *处方医院Id
     * </pre>
     *
     * <code>int32 hospitalId = 1;</code>
     */
    public Builder clearHospitalId() {
      
      hospitalId_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object patientName_ = "";
    /**
     * <pre>
     *患者姓名
     * </pre>
     *
     * <code>string patientName = 2;</code>
     */
    public java.lang.String getPatientName() {
      java.lang.Object ref = patientName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        patientName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *患者姓名
     * </pre>
     *
     * <code>string patientName = 2;</code>
     */
    public com.google.protobuf.ByteString
        getPatientNameBytes() {
      java.lang.Object ref = patientName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        patientName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *患者姓名
     * </pre>
     *
     * <code>string patientName = 2;</code>
     */
    public Builder setPatientName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      patientName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *患者姓名
     * </pre>
     *
     * <code>string patientName = 2;</code>
     */
    public Builder clearPatientName() {
      
      patientName_ = getDefaultInstance().getPatientName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *患者姓名
     * </pre>
     *
     * <code>string patientName = 2;</code>
     */
    public Builder setPatientNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      patientName_ = value;
      onChanged();
      return this;
    }

    private int patientSex_ ;
    /**
     * <pre>
     *患者性别
     * </pre>
     *
     * <code>int32 patientSex = 3;</code>
     */
    public int getPatientSex() {
      return patientSex_;
    }
    /**
     * <pre>
     *患者性别
     * </pre>
     *
     * <code>int32 patientSex = 3;</code>
     */
    public Builder setPatientSex(int value) {
      
      patientSex_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *患者性别
     * </pre>
     *
     * <code>int32 patientSex = 3;</code>
     */
    public Builder clearPatientSex() {
      
      patientSex_ = 0;
      onChanged();
      return this;
    }

    private int patientAge_ ;
    /**
     * <pre>
     *患者年龄
     * </pre>
     *
     * <code>int32 patientAge = 4;</code>
     */
    public int getPatientAge() {
      return patientAge_;
    }
    /**
     * <pre>
     *患者年龄
     * </pre>
     *
     * <code>int32 patientAge = 4;</code>
     */
    public Builder setPatientAge(int value) {
      
      patientAge_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *患者年龄
     * </pre>
     *
     * <code>int32 patientAge = 4;</code>
     */
    public Builder clearPatientAge() {
      
      patientAge_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object patientMobile_ = "";
    /**
     * <pre>
     *患者手机号
     * </pre>
     *
     * <code>string patientMobile = 5;</code>
     */
    public java.lang.String getPatientMobile() {
      java.lang.Object ref = patientMobile_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        patientMobile_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *患者手机号
     * </pre>
     *
     * <code>string patientMobile = 5;</code>
     */
    public com.google.protobuf.ByteString
        getPatientMobileBytes() {
      java.lang.Object ref = patientMobile_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        patientMobile_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *患者手机号
     * </pre>
     *
     * <code>string patientMobile = 5;</code>
     */
    public Builder setPatientMobile(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      patientMobile_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *患者手机号
     * </pre>
     *
     * <code>string patientMobile = 5;</code>
     */
    public Builder clearPatientMobile() {
      
      patientMobile_ = getDefaultInstance().getPatientMobile();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *患者手机号
     * </pre>
     *
     * <code>string patientMobile = 5;</code>
     */
    public Builder setPatientMobileBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      patientMobile_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object diagnosis_ = "";
    /**
     * <pre>
     *诊断结果
     * </pre>
     *
     * <code>string diagnosis = 6;</code>
     */
    public java.lang.String getDiagnosis() {
      java.lang.Object ref = diagnosis_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        diagnosis_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *诊断结果
     * </pre>
     *
     * <code>string diagnosis = 6;</code>
     */
    public com.google.protobuf.ByteString
        getDiagnosisBytes() {
      java.lang.Object ref = diagnosis_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        diagnosis_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *诊断结果
     * </pre>
     *
     * <code>string diagnosis = 6;</code>
     */
    public Builder setDiagnosis(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      diagnosis_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *诊断结果
     * </pre>
     *
     * <code>string diagnosis = 6;</code>
     */
    public Builder clearDiagnosis() {
      
      diagnosis_ = getDefaultInstance().getDiagnosis();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *诊断结果
     * </pre>
     *
     * <code>string diagnosis = 6;</code>
     */
    public Builder setDiagnosisBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      diagnosis_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object allergicHistory_ = "";
    /**
     * <pre>
     *过敏史
     * </pre>
     *
     * <code>string allergicHistory = 7;</code>
     */
    public java.lang.String getAllergicHistory() {
      java.lang.Object ref = allergicHistory_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        allergicHistory_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *过敏史
     * </pre>
     *
     * <code>string allergicHistory = 7;</code>
     */
    public com.google.protobuf.ByteString
        getAllergicHistoryBytes() {
      java.lang.Object ref = allergicHistory_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        allergicHistory_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *过敏史
     * </pre>
     *
     * <code>string allergicHistory = 7;</code>
     */
    public Builder setAllergicHistory(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      allergicHistory_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *过敏史
     * </pre>
     *
     * <code>string allergicHistory = 7;</code>
     */
    public Builder clearAllergicHistory() {
      
      allergicHistory_ = getDefaultInstance().getAllergicHistory();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *过敏史
     * </pre>
     *
     * <code>string allergicHistory = 7;</code>
     */
    public Builder setAllergicHistoryBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      allergicHistory_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object description_ = "";
    /**
     * <pre>
     *病情描述
     * </pre>
     *
     * <code>string description = 8;</code>
     */
    public java.lang.String getDescription() {
      java.lang.Object ref = description_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        description_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *病情描述
     * </pre>
     *
     * <code>string description = 8;</code>
     */
    public com.google.protobuf.ByteString
        getDescriptionBytes() {
      java.lang.Object ref = description_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        description_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *病情描述
     * </pre>
     *
     * <code>string description = 8;</code>
     */
    public Builder setDescription(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      description_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *病情描述
     * </pre>
     *
     * <code>string description = 8;</code>
     */
    public Builder clearDescription() {
      
      description_ = getDefaultInstance().getDescription();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *病情描述
     * </pre>
     *
     * <code>string description = 8;</code>
     */
    public Builder setDescriptionBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      description_ = value;
      onChanged();
      return this;
    }

    private int doctorId_ ;
    /**
     * <pre>
     *医生Id
     * </pre>
     *
     * <code>int32 doctorId = 9;</code>
     */
    public int getDoctorId() {
      return doctorId_;
    }
    /**
     * <pre>
     *医生Id
     * </pre>
     *
     * <code>int32 doctorId = 9;</code>
     */
    public Builder setDoctorId(int value) {
      
      doctorId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *医生Id
     * </pre>
     *
     * <code>int32 doctorId = 9;</code>
     */
    public Builder clearDoctorId() {
      
      doctorId_ = 0;
      onChanged();
      return this;
    }

    private int doctorSignId_ ;
    /**
     * <pre>
     *医生签名Id
     * </pre>
     *
     * <code>int32 doctorSignId = 10;</code>
     */
    public int getDoctorSignId() {
      return doctorSignId_;
    }
    /**
     * <pre>
     *医生签名Id
     * </pre>
     *
     * <code>int32 doctorSignId = 10;</code>
     */
    public Builder setDoctorSignId(int value) {
      
      doctorSignId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *医生签名Id
     * </pre>
     *
     * <code>int32 doctorSignId = 10;</code>
     */
    public Builder clearDoctorSignId() {
      
      doctorSignId_ = 0;
      onChanged();
      return this;
    }

    private java.util.List<com.ywt.gapi.drug.DrugUsage> drugUsage_ =
      java.util.Collections.emptyList();
    private void ensureDrugUsageIsMutable() {
      if (!((bitField0_ & 0x00000400) == 0x00000400)) {
        drugUsage_ = new java.util.ArrayList<com.ywt.gapi.drug.DrugUsage>(drugUsage_);
        bitField0_ |= 0x00000400;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.ywt.gapi.drug.DrugUsage, com.ywt.gapi.drug.DrugUsage.Builder, com.ywt.gapi.drug.DrugUsageOrBuilder> drugUsageBuilder_;

    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public java.util.List<com.ywt.gapi.drug.DrugUsage> getDrugUsageList() {
      if (drugUsageBuilder_ == null) {
        return java.util.Collections.unmodifiableList(drugUsage_);
      } else {
        return drugUsageBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public int getDrugUsageCount() {
      if (drugUsageBuilder_ == null) {
        return drugUsage_.size();
      } else {
        return drugUsageBuilder_.getCount();
      }
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public com.ywt.gapi.drug.DrugUsage getDrugUsage(int index) {
      if (drugUsageBuilder_ == null) {
        return drugUsage_.get(index);
      } else {
        return drugUsageBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public Builder setDrugUsage(
        int index, com.ywt.gapi.drug.DrugUsage value) {
      if (drugUsageBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDrugUsageIsMutable();
        drugUsage_.set(index, value);
        onChanged();
      } else {
        drugUsageBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public Builder setDrugUsage(
        int index, com.ywt.gapi.drug.DrugUsage.Builder builderForValue) {
      if (drugUsageBuilder_ == null) {
        ensureDrugUsageIsMutable();
        drugUsage_.set(index, builderForValue.build());
        onChanged();
      } else {
        drugUsageBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public Builder addDrugUsage(com.ywt.gapi.drug.DrugUsage value) {
      if (drugUsageBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDrugUsageIsMutable();
        drugUsage_.add(value);
        onChanged();
      } else {
        drugUsageBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public Builder addDrugUsage(
        int index, com.ywt.gapi.drug.DrugUsage value) {
      if (drugUsageBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDrugUsageIsMutable();
        drugUsage_.add(index, value);
        onChanged();
      } else {
        drugUsageBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public Builder addDrugUsage(
        com.ywt.gapi.drug.DrugUsage.Builder builderForValue) {
      if (drugUsageBuilder_ == null) {
        ensureDrugUsageIsMutable();
        drugUsage_.add(builderForValue.build());
        onChanged();
      } else {
        drugUsageBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public Builder addDrugUsage(
        int index, com.ywt.gapi.drug.DrugUsage.Builder builderForValue) {
      if (drugUsageBuilder_ == null) {
        ensureDrugUsageIsMutable();
        drugUsage_.add(index, builderForValue.build());
        onChanged();
      } else {
        drugUsageBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public Builder addAllDrugUsage(
        java.lang.Iterable<? extends com.ywt.gapi.drug.DrugUsage> values) {
      if (drugUsageBuilder_ == null) {
        ensureDrugUsageIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, drugUsage_);
        onChanged();
      } else {
        drugUsageBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public Builder clearDrugUsage() {
      if (drugUsageBuilder_ == null) {
        drugUsage_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000400);
        onChanged();
      } else {
        drugUsageBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public Builder removeDrugUsage(int index) {
      if (drugUsageBuilder_ == null) {
        ensureDrugUsageIsMutable();
        drugUsage_.remove(index);
        onChanged();
      } else {
        drugUsageBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public com.ywt.gapi.drug.DrugUsage.Builder getDrugUsageBuilder(
        int index) {
      return getDrugUsageFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public com.ywt.gapi.drug.DrugUsageOrBuilder getDrugUsageOrBuilder(
        int index) {
      if (drugUsageBuilder_ == null) {
        return drugUsage_.get(index);  } else {
        return drugUsageBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public java.util.List<? extends com.ywt.gapi.drug.DrugUsageOrBuilder> 
         getDrugUsageOrBuilderList() {
      if (drugUsageBuilder_ != null) {
        return drugUsageBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(drugUsage_);
      }
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public com.ywt.gapi.drug.DrugUsage.Builder addDrugUsageBuilder() {
      return getDrugUsageFieldBuilder().addBuilder(
          com.ywt.gapi.drug.DrugUsage.getDefaultInstance());
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public com.ywt.gapi.drug.DrugUsage.Builder addDrugUsageBuilder(
        int index) {
      return getDrugUsageFieldBuilder().addBuilder(
          index, com.ywt.gapi.drug.DrugUsage.getDefaultInstance());
    }
    /**
     * <pre>
     *药物使用说明
     * </pre>
     *
     * <code>repeated .com.ywt.gapi.drug.DrugUsage drugUsage = 11;</code>
     */
    public java.util.List<com.ywt.gapi.drug.DrugUsage.Builder> 
         getDrugUsageBuilderList() {
      return getDrugUsageFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.ywt.gapi.drug.DrugUsage, com.ywt.gapi.drug.DrugUsage.Builder, com.ywt.gapi.drug.DrugUsageOrBuilder> 
        getDrugUsageFieldBuilder() {
      if (drugUsageBuilder_ == null) {
        drugUsageBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.ywt.gapi.drug.DrugUsage, com.ywt.gapi.drug.DrugUsage.Builder, com.ywt.gapi.drug.DrugUsageOrBuilder>(
                drugUsage_,
                ((bitField0_ & 0x00000400) == 0x00000400),
                getParentForChildren(),
                isClean());
        drugUsage_ = null;
      }
      return drugUsageBuilder_;
    }

    private java.lang.Object doctorName_ = "";
    /**
     * <pre>
     *医生姓名
     * </pre>
     *
     * <code>string doctorName = 12;</code>
     */
    public java.lang.String getDoctorName() {
      java.lang.Object ref = doctorName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        doctorName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *医生姓名
     * </pre>
     *
     * <code>string doctorName = 12;</code>
     */
    public com.google.protobuf.ByteString
        getDoctorNameBytes() {
      java.lang.Object ref = doctorName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        doctorName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *医生姓名
     * </pre>
     *
     * <code>string doctorName = 12;</code>
     */
    public Builder setDoctorName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      doctorName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *医生姓名
     * </pre>
     *
     * <code>string doctorName = 12;</code>
     */
    public Builder clearDoctorName() {
      
      doctorName_ = getDefaultInstance().getDoctorName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *医生姓名
     * </pre>
     *
     * <code>string doctorName = 12;</code>
     */
    public Builder setDoctorNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      doctorName_ = value;
      onChanged();
      return this;
    }

    private int source_ ;
    /**
     * <pre>
     *处方单来源
     * </pre>
     *
     * <code>int32 source = 13;</code>
     */
    public int getSource() {
      return source_;
    }
    /**
     * <pre>
     *处方单来源
     * </pre>
     *
     * <code>int32 source = 13;</code>
     */
    public Builder setSource(int value) {
      
      source_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *处方单来源
     * </pre>
     *
     * <code>int32 source = 13;</code>
     */
    public Builder clearSource() {
      
      source_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object deptName_ = "";
    /**
     * <pre>
     *科室名称
     * </pre>
     *
     * <code>string deptName = 14;</code>
     */
    public java.lang.String getDeptName() {
      java.lang.Object ref = deptName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deptName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *科室名称
     * </pre>
     *
     * <code>string deptName = 14;</code>
     */
    public com.google.protobuf.ByteString
        getDeptNameBytes() {
      java.lang.Object ref = deptName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        deptName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *科室名称
     * </pre>
     *
     * <code>string deptName = 14;</code>
     */
    public Builder setDeptName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      deptName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *科室名称
     * </pre>
     *
     * <code>string deptName = 14;</code>
     */
    public Builder clearDeptName() {
      
      deptName_ = getDefaultInstance().getDeptName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *科室名称
     * </pre>
     *
     * <code>string deptName = 14;</code>
     */
    public Builder setDeptNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      deptName_ = value;
      onChanged();
      return this;
    }

    private int userId_ ;
    /**
     * <pre>
     *患者Id
     * </pre>
     *
     * <code>int32 userId = 15;</code>
     */
    public int getUserId() {
      return userId_;
    }
    /**
     * <pre>
     *患者Id
     * </pre>
     *
     * <code>int32 userId = 15;</code>
     */
    public Builder setUserId(int value) {
      
      userId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *患者Id
     * </pre>
     *
     * <code>int32 userId = 15;</code>
     */
    public Builder clearUserId() {
      
      userId_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object idCardNo_ = "";
    /**
     * <pre>
     *身份证号
     * </pre>
     *
     * <code>string idCardNo = 16;</code>
     */
    public java.lang.String getIdCardNo() {
      java.lang.Object ref = idCardNo_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        idCardNo_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *身份证号
     * </pre>
     *
     * <code>string idCardNo = 16;</code>
     */
    public com.google.protobuf.ByteString
        getIdCardNoBytes() {
      java.lang.Object ref = idCardNo_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        idCardNo_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *身份证号
     * </pre>
     *
     * <code>string idCardNo = 16;</code>
     */
    public Builder setIdCardNo(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      idCardNo_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *身份证号
     * </pre>
     *
     * <code>string idCardNo = 16;</code>
     */
    public Builder clearIdCardNo() {
      
      idCardNo_ = getDefaultInstance().getIdCardNo();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *身份证号
     * </pre>
     *
     * <code>string idCardNo = 16;</code>
     */
    public Builder setIdCardNoBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      idCardNo_ = value;
      onChanged();
      return this;
    }

    private int flag_ ;
    /**
     * <pre>
     *标记值 1: 创建订单中心订单信息
     * </pre>
     *
     * <code>int32 flag = 17;</code>
     */
    public int getFlag() {
      return flag_;
    }
    /**
     * <pre>
     *标记值 1: 创建订单中心订单信息
     * </pre>
     *
     * <code>int32 flag = 17;</code>
     */
    public Builder setFlag(int value) {
      
      flag_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *标记值 1: 创建订单中心订单信息
     * </pre>
     *
     * <code>int32 flag = 17;</code>
     */
    public Builder clearFlag() {
      
      flag_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object patientNo_ = "";
    /**
     * <pre>
     *患者手编码
     * </pre>
     *
     * <code>string patientNo = 18;</code>
     */
    public java.lang.String getPatientNo() {
      java.lang.Object ref = patientNo_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        patientNo_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     *患者手编码
     * </pre>
     *
     * <code>string patientNo = 18;</code>
     */
    public com.google.protobuf.ByteString
        getPatientNoBytes() {
      java.lang.Object ref = patientNo_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        patientNo_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     *患者手编码
     * </pre>
     *
     * <code>string patientNo = 18;</code>
     */
    public Builder setPatientNo(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      patientNo_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *患者手编码
     * </pre>
     *
     * <code>string patientNo = 18;</code>
     */
    public Builder clearPatientNo() {
      
      patientNo_ = getDefaultInstance().getPatientNo();
      onChanged();
      return this;
    }
    /**
     * <pre>
     *患者手编码
     * </pre>
     *
     * <code>string patientNo = 18;</code>
     */
    public Builder setPatientNoBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      patientNo_ = value;
      onChanged();
      return this;
    }

    private int pharmacyId_ ;
    /**
     * <pre>
     *药房ID
     * </pre>
     *
     * <code>int32 pharmacyId = 19;</code>
     */
    public int getPharmacyId() {
      return pharmacyId_;
    }
    /**
     * <pre>
     *药房ID
     * </pre>
     *
     * <code>int32 pharmacyId = 19;</code>
     */
    public Builder setPharmacyId(int value) {
      
      pharmacyId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     *药房ID
     * </pre>
     *
     * <code>int32 pharmacyId = 19;</code>
     */
    public Builder clearPharmacyId() {
      
      pharmacyId_ = 0;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList icdCode_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    private void ensureIcdCodeIsMutable() {
      if (!((bitField0_ & 0x00080000) == 0x00080000)) {
        icdCode_ = new com.google.protobuf.LazyStringArrayList(icdCode_);
        bitField0_ |= 0x00080000;
       }
    }
    /**
     * <pre>
     * 诊断编码列表
     * </pre>
     *
     * <code>repeated string icdCode = 20;</code>
     */
    public com.google.protobuf.ProtocolStringList
        getIcdCodeList() {
      return icdCode_.getUnmodifiableView();
    }
    /**
     * <pre>
     * 诊断编码列表
     * </pre>
     *
     * <code>repeated string icdCode = 20;</code>
     */
    public int getIcdCodeCount() {
      return icdCode_.size();
    }
    /**
     * <pre>
     * 诊断编码列表
     * </pre>
     *
     * <code>repeated string icdCode = 20;</code>
     */
    public java.lang.String getIcdCode(int index) {
      return icdCode_.get(index);
    }
    /**
     * <pre>
     * 诊断编码列表
     * </pre>
     *
     * <code>repeated string icdCode = 20;</code>
     */
    public com.google.protobuf.ByteString
        getIcdCodeBytes(int index) {
      return icdCode_.getByteString(index);
    }
    /**
     * <pre>
     * 诊断编码列表
     * </pre>
     *
     * <code>repeated string icdCode = 20;</code>
     */
    public Builder setIcdCode(
        int index, java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureIcdCodeIsMutable();
      icdCode_.set(index, value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 诊断编码列表
     * </pre>
     *
     * <code>repeated string icdCode = 20;</code>
     */
    public Builder addIcdCode(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureIcdCodeIsMutable();
      icdCode_.add(value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 诊断编码列表
     * </pre>
     *
     * <code>repeated string icdCode = 20;</code>
     */
    public Builder addAllIcdCode(
        java.lang.Iterable<java.lang.String> values) {
      ensureIcdCodeIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, icdCode_);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 诊断编码列表
     * </pre>
     *
     * <code>repeated string icdCode = 20;</code>
     */
    public Builder clearIcdCode() {
      icdCode_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00080000);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 诊断编码列表
     * </pre>
     *
     * <code>repeated string icdCode = 20;</code>
     */
    public Builder addIcdCodeBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      ensureIcdCodeIsMutable();
      icdCode_.add(value);
      onChanged();
      return this;
    }

    private boolean writeBack2His_ ;
    /**
     * <pre>
     * 是否回写 HIS
     * </pre>
     *
     * <code>bool writeBack2His = 21;</code>
     */
    public boolean getWriteBack2His() {
      return writeBack2His_;
    }
    /**
     * <pre>
     * 是否回写 HIS
     * </pre>
     *
     * <code>bool writeBack2His = 21;</code>
     */
    public Builder setWriteBack2His(boolean value) {
      
      writeBack2His_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 是否回写 HIS
     * </pre>
     *
     * <code>bool writeBack2His = 21;</code>
     */
    public Builder clearWriteBack2His() {
      
      writeBack2His_ = false;
      onChanged();
      return this;
    }

    private java.lang.Object address_ = "";
    /**
     * <pre>
     * 患者地址
     * </pre>
     *
     * <code>string address = 22;</code>
     */
    public java.lang.String getAddress() {
      java.lang.Object ref = address_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        address_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * 患者地址
     * </pre>
     *
     * <code>string address = 22;</code>
     */
    public com.google.protobuf.ByteString
        getAddressBytes() {
      java.lang.Object ref = address_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        address_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * 患者地址
     * </pre>
     *
     * <code>string address = 22;</code>
     */
    public Builder setAddress(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      address_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 患者地址
     * </pre>
     *
     * <code>string address = 22;</code>
     */
    public Builder clearAddress() {
      
      address_ = getDefaultInstance().getAddress();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 患者地址
     * </pre>
     *
     * <code>string address = 22;</code>
     */
    public Builder setAddressBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      address_ = value;
      onChanged();
      return this;
    }

    private int medRecordId_ ;
    /**
     * <pre>
     * 病历 id, 医生 PC 端开方，病历和处方关联
     * </pre>
     *
     * <code>int32 medRecordId = 23;</code>
     */
    public int getMedRecordId() {
      return medRecordId_;
    }
    /**
     * <pre>
     * 病历 id, 医生 PC 端开方，病历和处方关联
     * </pre>
     *
     * <code>int32 medRecordId = 23;</code>
     */
    public Builder setMedRecordId(int value) {
      
      medRecordId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 病历 id, 医生 PC 端开方，病历和处方关联
     * </pre>
     *
     * <code>int32 medRecordId = 23;</code>
     */
    public Builder clearMedRecordId() {
      
      medRecordId_ = 0;
      onChanged();
      return this;
    }

    private int prevPreId_ ;
    /**
     * <pre>
     * 修改处方的 id, 修改处方时传入
     * </pre>
     *
     * <code>int32 prevPreId = 24;</code>
     */
    public int getPrevPreId() {
      return prevPreId_;
    }
    /**
     * <pre>
     * 修改处方的 id, 修改处方时传入
     * </pre>
     *
     * <code>int32 prevPreId = 24;</code>
     */
    public Builder setPrevPreId(int value) {
      
      prevPreId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * 修改处方的 id, 修改处方时传入
     * </pre>
     *
     * <code>int32 prevPreId = 24;</code>
     */
    public Builder clearPrevPreId() {
      
      prevPreId_ = 0;
      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.SavePrescriptionInfoRequest)
  }

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

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

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

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

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

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

}

