public void Read (TProtocol iprot)
 {
   bool isset_uuidFicha = false;
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.String) {
           UuidFicha = iprot.ReadString();
           isset_uuidFicha = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.String) {
           OutraLocalidade = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 7:
         if (field.Type == TType.I64) {
           Inep = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 11:
         if (field.Type == TType.I32) {
           NumParticipantes = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 12:
         if (field.Type == TType.I32) {
           NumAvaliacoesAlteradas = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 13:
         if (field.Type == TType.List) {
           {
             Profissionais = new List<ProfissionalCboRowItemThrift>();
             TList _list0 = iprot.ReadListBegin();
             for( int _i1 = 0; _i1 < _list0.Count; ++_i1)
             {
               ProfissionalCboRowItemThrift _elem2;
               _elem2 = new ProfissionalCboRowItemThrift();
               _elem2.Read(iprot);
               Profissionais.Add(_elem2);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 14:
         if (field.Type == TType.I64) {
           AtividadeTipo = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 15:
         if (field.Type == TType.List) {
           {
             TemasParaReuniao = new List<long>();
             TList _list3 = iprot.ReadListBegin();
             for( int _i4 = 0; _i4 < _list3.Count; ++_i4)
             {
               long _elem5;
               _elem5 = iprot.ReadI64();
               TemasParaReuniao.Add(_elem5);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 16:
         if (field.Type == TType.List) {
           {
             PublicoAlvo = new List<long>();
             TList _list6 = iprot.ReadListBegin();
             for( int _i7 = 0; _i7 < _list6.Count; ++_i7)
             {
               long _elem8;
               _elem8 = iprot.ReadI64();
               PublicoAlvo.Add(_elem8);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 18:
         if (field.Type == TType.List) {
           {
             Participantes = new List<ParticipanteRowItemThrift>();
             TList _list9 = iprot.ReadListBegin();
             for( int _i10 = 0; _i10 < _list9.Count; ++_i10)
             {
               ParticipanteRowItemThrift _elem11;
               _elem11 = new ParticipanteRowItemThrift();
               _elem11.Read(iprot);
               Participantes.Add(_elem11);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 19:
         if (field.Type == TType.I32) {
           TbCdsOrigem = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 21:
         if (field.Type == TType.String) {
           CnesLocalAtividade = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 22:
         if (field.Type == TType.String) {
           Procedimento = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 23:
         if (field.Type == TType.I64) {
           Turno = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 24:
         if (field.Type == TType.Struct) {
           HeaderTransport = new br.gov.saude.esusab.ras.common.UnicaLotacaoHeaderThrift();
           HeaderTransport.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 25:
         if (field.Type == TType.List) {
           {
             TemasParaSaude = new List<long>();
             TList _list12 = iprot.ReadListBegin();
             for( int _i13 = 0; _i13 < _list12.Count; ++_i13)
             {
               long _elem14;
               _elem14 = iprot.ReadI64();
               TemasParaSaude.Add(_elem14);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 26:
         if (field.Type == TType.List) {
           {
             PraticasEmSaude = new List<long>();
             TList _list15 = iprot.ReadListBegin();
             for( int _i16 = 0; _i16 < _list15.Count; ++_i16)
             {
               long _elem17;
               _elem17 = iprot.ReadI64();
               PraticasEmSaude.Add(_elem17);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
   if (!isset_uuidFicha)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
 }
        public void Read(TProtocol iprot)
        {
            bool   isset_uuidFicha = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.String)
                    {
                        UuidFicha       = iprot.ReadString();
                        isset_uuidFicha = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        OutraLocalidade = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 7:
                    if (field.Type == TType.I64)
                    {
                        Inep = iprot.ReadI64();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 11:
                    if (field.Type == TType.I32)
                    {
                        NumParticipantes = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 12:
                    if (field.Type == TType.I32)
                    {
                        NumAvaliacoesAlteradas = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 13:
                    if (field.Type == TType.List)
                    {
                        {
                            Profissionais = new List <ProfissionalCboRowItemThrift>();
                            TList _list0 = iprot.ReadListBegin();
                            for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                            {
                                ProfissionalCboRowItemThrift _elem2;
                                _elem2 = new ProfissionalCboRowItemThrift();
                                _elem2.Read(iprot);
                                Profissionais.Add(_elem2);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 14:
                    if (field.Type == TType.I64)
                    {
                        AtividadeTipo = iprot.ReadI64();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 15:
                    if (field.Type == TType.List)
                    {
                        {
                            TemasParaReuniao = new List <long>();
                            TList _list3 = iprot.ReadListBegin();
                            for (int _i4 = 0; _i4 < _list3.Count; ++_i4)
                            {
                                long _elem5;
                                _elem5 = iprot.ReadI64();
                                TemasParaReuniao.Add(_elem5);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 16:
                    if (field.Type == TType.List)
                    {
                        {
                            PublicoAlvo = new List <long>();
                            TList _list6 = iprot.ReadListBegin();
                            for (int _i7 = 0; _i7 < _list6.Count; ++_i7)
                            {
                                long _elem8;
                                _elem8 = iprot.ReadI64();
                                PublicoAlvo.Add(_elem8);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 18:
                    if (field.Type == TType.List)
                    {
                        {
                            Participantes = new List <ParticipanteRowItemThrift>();
                            TList _list9 = iprot.ReadListBegin();
                            for (int _i10 = 0; _i10 < _list9.Count; ++_i10)
                            {
                                ParticipanteRowItemThrift _elem11;
                                _elem11 = new ParticipanteRowItemThrift();
                                _elem11.Read(iprot);
                                Participantes.Add(_elem11);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 19:
                    if (field.Type == TType.I32)
                    {
                        TbCdsOrigem = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 21:
                    if (field.Type == TType.String)
                    {
                        CnesLocalAtividade = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 22:
                    if (field.Type == TType.String)
                    {
                        Procedimento = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 23:
                    if (field.Type == TType.I64)
                    {
                        Turno = iprot.ReadI64();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 24:
                    if (field.Type == TType.Struct)
                    {
                        HeaderTransport = new br.gov.saude.esusab.ras.common.UnicaLotacaoHeaderThrift();
                        HeaderTransport.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 25:
                    if (field.Type == TType.List)
                    {
                        {
                            TemasParaSaude = new List <long>();
                            TList _list12 = iprot.ReadListBegin();
                            for (int _i13 = 0; _i13 < _list12.Count; ++_i13)
                            {
                                long _elem14;
                                _elem14 = iprot.ReadI64();
                                TemasParaSaude.Add(_elem14);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 26:
                    if (field.Type == TType.List)
                    {
                        {
                            PraticasEmSaude = new List <long>();
                            TList _list15 = iprot.ReadListBegin();
                            for (int _i16 = 0; _i16 < _list15.Count; ++_i16)
                            {
                                long _elem17;
                                _elem17 = iprot.ReadI64();
                                PraticasEmSaude.Add(_elem17);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 27:
                    if (field.Type == TType.Bool)
                    {
                        PseEducacao = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 28:
                    if (field.Type == TType.Bool)
                    {
                        PseSaude = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_uuidFicha)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }