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 2:
         if (field.Type == TType.I32) {
           TpCdsOrigem = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         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 4:
         if (field.Type == TType.List) {
           {
             AtendProcedimentos = new List<FichaProcedimentoChildThrift>();
             TList _list8 = iprot.ReadListBegin();
             for( int _i9 = 0; _i9 < _list8.Count; ++_i9)
             {
               FichaProcedimentoChildThrift _elem10;
               _elem10 = new FichaProcedimentoChildThrift();
               _elem10.Read(iprot);
               AtendProcedimentos.Add(_elem10);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.I64) {
           NumTotalAfericaoPa = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 6:
         if (field.Type == TType.I64) {
           NumTotalGlicemiaCapilar = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 7:
         if (field.Type == TType.I64) {
           NumTotalAfericaoTemperatura = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 8:
         if (field.Type == TType.I64) {
           NumTotalMedicaoAltura = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 9:
         if (field.Type == TType.I64) {
           NumTotalCurativoSimples = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 10:
         if (field.Type == TType.I64) {
           NumTotalMedicaoPeso = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 11:
         if (field.Type == TType.I64) {
           NumTotalColetaMaterialParaExameLaboratorial = iprot.ReadI64();
         } 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 2:
                    if (field.Type == TType.I32)
                    {
                        TpCdsOrigem = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    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 4:
                    if (field.Type == TType.List)
                    {
                        {
                            AtendProcedimentos = new List <FichaProcedimentoChildThrift>();
                            TList _list8 = iprot.ReadListBegin();
                            for (int _i9 = 0; _i9 < _list8.Count; ++_i9)
                            {
                                FichaProcedimentoChildThrift _elem10;
                                _elem10 = new FichaProcedimentoChildThrift();
                                _elem10.Read(iprot);
                                AtendProcedimentos.Add(_elem10);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

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

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

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

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

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

                case 11:
                    if (field.Type == TType.I64)
                    {
                        NumTotalColetaMaterialParaExameLaboratorial = iprot.ReadI64();
                    }
                    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);
            }
        }