public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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.Struct)
                        {
                            HeaderTransport = new br.gov.saude.esusab.ras.common.VariasLotacoesHeaderThrift();
                            HeaderTransport.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                AtendimentosIndividuais = new List <FichaAtendimentoIndividualChildThrift>();
                                TList _list28 = iprot.ReadListBegin();
                                for (int _i29 = 0; _i29 < _list28.Count; ++_i29)
                                {
                                    FichaAtendimentoIndividualChildThrift _elem30;
                                    _elem30 = new FichaAtendimentoIndividualChildThrift();
                                    _elem30.Read(iprot);
                                    AtendimentosIndividuais.Add(_elem30);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            UuidFicha       = iprot.ReadString();
                            isset_uuidFicha = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.I32)
                        {
                            TpCdsOrigem = iprot.ReadI32();
                        }
                        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);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
 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.Struct) {
           HeaderTransport = new br.gov.saude.esusab.ras.common.VariasLotacoesHeaderThrift();
           HeaderTransport.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.List) {
           {
             AtendimentosIndividuais = new List<FichaAtendimentoIndividualChildThrift>();
             TList _list28 = iprot.ReadListBegin();
             for( int _i29 = 0; _i29 < _list28.Count; ++_i29)
             {
               FichaAtendimentoIndividualChildThrift _elem30;
               _elem30 = new FichaAtendimentoIndividualChildThrift();
               _elem30.Read(iprot);
               AtendimentosIndividuais.Add(_elem30);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.String) {
           UuidFicha = iprot.ReadString();
           isset_uuidFicha = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.I32) {
           TpCdsOrigem = iprot.ReadI32();
         } 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);
 }