unit Etiquetas_Intf;

{----------------------------------------------------------------------------}
{ This unit was automatically generated by the RemObjects SDK after reading  }
{ the RODL file associated with this project .                               }
{                                                                            }
{ Do not modify this unit manually, or your changes will be lost when this   }
{ unit is regenerated the next time you compile the project.                 }
{----------------------------------------------------------------------------}

{$I RemObjects.inc}

interface

uses
  {vcl:} Classes, TypInfo,
  {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf,
  {Used RODLs:} DataAbstract4_Intf;

const
  { Library ID }
  LibraryUID = '{99553DD5-13B5-40EB-B7E6-D2B9A7C1B4D6}';
  TargetNamespace = '';

  { Service Interface ID's }
  IsrvContactos_IID : TGUID = '{28CCDC07-A3A4-4917-89B4-64423DC70C9D}';
  IsrvLogin_IID : TGUID = '{399F9DB4-1B34-4140-AB6E-3BC10C0A7034}';
  IsrvEmpresas_IID : TGUID = '{590F06D1-26B4-435B-B636-50CB8FFE6353}';
  IsrvConfiguracion_IID : TGUID = '{0882B8A4-C8AA-424E-8FC1-C6226B670522}';
  IsrvUsuarios_IID : TGUID = '{29388459-1A0B-46BE-AF9E-66A9E7AABB0B}';
  IsrvArticulos_IID : TGUID = '{CFBE5841-DF0F-48AD-853E-A35FDA989E6E}';
  IsrvMedicacion_IID : TGUID = '{6E910718-9AB0-47BB-9875-B0DE66A68D7A}';
  IsrvReferencias_IID : TGUID = '{B957528D-3BE1-412D-A35E-801C97CCD252}';
  IsrvUnidadesMedida_IID : TGUID = '{8B4C72F0-5ACE-46FF-9F00-D70C2B611652}';
  IsrvProvinciasPoblaciones_IID : TGUID = '{551D8756-51AE-4929-B235-107CD7B05C38}';

  { Event ID's }

type
  { Forward declarations }
  IsrvContactos = interface;
  IsrvLogin = interface;
  IsrvEmpresas = interface;
  IsrvConfiguracion = interface;
  IsrvUsuarios = interface;
  IsrvArticulos = interface;
  IsrvMedicacion = interface;
  IsrvReferencias = interface;
  IsrvUnidadesMedida = interface;
  IsrvProvinciasPoblaciones = interface;

  TRdxEmpresasArray = class;
  TIntegerArray = class;

  TRdxLoginInfo = class;



  { Enumerateds }
  TRdxAlmacenes = (TRdxAlmacenes_Presupuestos);

  { TRdxLoginInfo }
  TRdxLoginInfo = class(TROComplexType)
  private
    fUserID: Integer;
    fSessionID: AnsiString;
    fUsuario: AnsiString;
    fPerfiles: StringArray;
    fEmpresas: TRdxEmpresasArray;
    function GetPerfiles: StringArray;
    function GetEmpresas: TRdxEmpresasArray;
  public
    procedure Assign(iSource: TPersistent); override;
    procedure ReadComplex(ASerializer: TObject); override;
    procedure WriteComplex(ASerializer: TObject); override;
  published
    property UserID:Integer read fUserID write fUserID;
    property SessionID:AnsiString read fSessionID write fSessionID;
    property Usuario:AnsiString read fUsuario write fUsuario;
    property Perfiles:StringArray read GetPerfiles write fPerfiles;
    property Empresas:TRdxEmpresasArray read GetEmpresas write fEmpresas;
  end;

  { TRdxLoginInfoCollection }
  TRdxLoginInfoCollection = class(TROCollection)
  protected
    constructor Create(aItemClass: TCollectionItemClass); overload;
    function GetItems(aIndex: integer): TRdxLoginInfo;
    procedure SetItems(aIndex: integer; const Value: TRdxLoginInfo);
  public
    constructor Create; overload;
    function Add: TRdxLoginInfo; reintroduce;
    property Items[Index: integer]:TRdxLoginInfo read GetItems write SetItems; default;
  end;

  { TRdxEmpresasArray }
  TRdxEmpresasArray_Integer = array of Integer;
  TRdxEmpresasArray = class(TROArray)
  private
    fCount: Integer;
    fItems : TRdxEmpresasArray_Integer;
  protected
    procedure Grow; virtual;
    function GetItems(aIndex: integer): Integer;
    procedure SetItems(aIndex: integer; const Value: Integer);
    function GetCount: integer; override;
  public
    class function GetItemType: PTypeInfo; override;
    class function GetItemSize: integer; override;

    function GetItemRef(aIndex: integer): pointer; override;
    procedure Clear; override;
    procedure Delete(aIndex: integer); override;
    procedure Resize(ElementCount: integer); override;

    procedure Assign(iSource:TPersistent); override;
    procedure ReadComplex(ASerializer: TObject); override;
    procedure WriteComplex(ASerializer: TObject); override;
    function Add(const Value:Integer): integer;
    function GetIndex(const aPropertyName : string;
                      const aPropertyValue : Variant;
                      StartFrom : integer = 0;
                      Options : TROSearchOptions = [soIgnoreCase]) : integer; override;

    property Count : integer read GetCount;
    property Items[Index: integer]:Integer read GetItems write SetItems; default;
    property InnerArray: TRdxEmpresasArray_Integer read fItems;
  end;

  { TIntegerArray }
  TIntegerArray_Integer = array of Integer;
  TIntegerArray = class(TROArray)
  private
    fCount: Integer;
    fItems : TIntegerArray_Integer;
  protected
    procedure Grow; virtual;
    function GetItems(aIndex: integer): Integer;
    procedure SetItems(aIndex: integer; const Value: Integer);
    function GetCount: integer; override;
  public
    class function GetItemType: PTypeInfo; override;
    class function GetItemSize: integer; override;

    function GetItemRef(aIndex: integer): pointer; override;
    procedure Clear; override;
    procedure Delete(aIndex: integer); override;
    procedure Resize(ElementCount: integer); override;

    procedure Assign(iSource:TPersistent); override;
    procedure ReadComplex(ASerializer: TObject); override;
    procedure WriteComplex(ASerializer: TObject); override;
    function Add(const Value:Integer): integer;
    function GetIndex(const aPropertyName : string;
                      const aPropertyValue : Variant;
                      StartFrom : integer = 0;
                      Options : TROSearchOptions = [soIgnoreCase]) : integer; override;

    property Count : integer read GetCount;
    property Items[Index: integer]:Integer read GetItems write SetItems; default;
    property InnerArray: TIntegerArray_Integer read fItems;
  end;

  { IsrvContactos }
  IsrvContactos = interface(IDataAbstractService)
    ['{28CCDC07-A3A4-4917-89B4-64423DC70C9D}']
    function GenerarInformeEtiquetas(const ListaID: TIntegerArray): Binary;
    function GenerarInformeFichaPaciente(const ListaID: TIntegerArray): Binary;
  end;

  { CosrvContactos }
  CosrvContactos = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvContactos;
  end;

  { TsrvContactos_Proxy }
  TsrvContactos_Proxy = class(TDataAbstractService_Proxy, IsrvContactos)
  protected
    function __GetInterfaceName:string; override;

    function GenerarInformeEtiquetas(const ListaID: TIntegerArray): Binary;
    function GenerarInformeFichaPaciente(const ListaID: TIntegerArray): Binary;
  end;

  { IsrvLogin }
  IsrvLogin = interface(IDataAbstractService)
    ['{399F9DB4-1B34-4140-AB6E-3BC10C0A7034}']
    function Login(const User: AnsiString; const Password: AnsiString; out LoginInfo: TRdxLoginInfo): Boolean;
    procedure Logout;
    function Ping: Boolean;
  end;

  { CosrvLogin }
  CosrvLogin = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvLogin;
  end;

  { TsrvLogin_Proxy }
  TsrvLogin_Proxy = class(TDataAbstractService_Proxy, IsrvLogin)
  protected
    function __GetInterfaceName:string; override;

    function Login(const User: AnsiString; const Password: AnsiString; out LoginInfo: TRdxLoginInfo): Boolean;
    procedure Logout;
    function Ping: Boolean;
  end;

  { IsrvEmpresas }
  IsrvEmpresas = interface(IDataAbstractService)
    ['{590F06D1-26B4-435B-B636-50CB8FFE6353}']
  end;

  { CosrvEmpresas }
  CosrvEmpresas = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvEmpresas;
  end;

  { TsrvEmpresas_Proxy }
  TsrvEmpresas_Proxy = class(TDataAbstractService_Proxy, IsrvEmpresas)
  protected
    function __GetInterfaceName:string; override;

  end;

  { IsrvConfiguracion }
  IsrvConfiguracion = interface(IDataAbstractService)
    ['{0882B8A4-C8AA-424E-8FC1-C6226B670522}']
    function darValor(const CODIGO: AnsiString; const ValorPorDefecto: AnsiString): AnsiString;
  end;

  { CosrvConfiguracion }
  CosrvConfiguracion = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvConfiguracion;
  end;

  { TsrvConfiguracion_Proxy }
  TsrvConfiguracion_Proxy = class(TDataAbstractService_Proxy, IsrvConfiguracion)
  protected
    function __GetInterfaceName:string; override;

    function darValor(const CODIGO: AnsiString; const ValorPorDefecto: AnsiString): AnsiString;
  end;

  { IsrvUsuarios }
  IsrvUsuarios = interface(IDataAbstractService)
    ['{29388459-1A0B-46BE-AF9E-66A9E7AABB0B}']
  end;

  { CosrvUsuarios }
  CosrvUsuarios = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvUsuarios;
  end;

  { TsrvUsuarios_Proxy }
  TsrvUsuarios_Proxy = class(TDataAbstractService_Proxy, IsrvUsuarios)
  protected
    function __GetInterfaceName:string; override;

  end;

  { IsrvArticulos }
  IsrvArticulos = interface(IDataAbstractService)
    ['{CFBE5841-DF0F-48AD-853E-A35FDA989E6E}']
  end;

  { CosrvArticulos }
  CosrvArticulos = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvArticulos;
  end;

  { TsrvArticulos_Proxy }
  TsrvArticulos_Proxy = class(TDataAbstractService_Proxy, IsrvArticulos)
  protected
    function __GetInterfaceName:string; override;

  end;

  { IsrvMedicacion }
  IsrvMedicacion = interface(IDataAbstractService)
    ['{6E910718-9AB0-47BB-9875-B0DE66A68D7A}']
    function GenerarInforme(const ListaID: TIntegerArray): Binary;
  end;

  { CosrvMedicacion }
  CosrvMedicacion = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvMedicacion;
  end;

  { TsrvMedicacion_Proxy }
  TsrvMedicacion_Proxy = class(TDataAbstractService_Proxy, IsrvMedicacion)
  protected
    function __GetInterfaceName:string; override;

    function GenerarInforme(const ListaID: TIntegerArray): Binary;
  end;

  { IsrvReferencias }

  { Description:
      Para uso interno del servidor. Para modulo de gestion de referencias del cliente }
  IsrvReferencias = interface(IDataAbstractService)
    ['{B957528D-3BE1-412D-A35E-801C97CCD252}']
    function DarNuevaReferencia(const NombreReferencia: AnsiString; const EmpresaID: Integer): AnsiString;
    function IncrementarValorReferencia(const NombreReferencia: AnsiString; const Valor: AnsiString; const EmpresaID: Integer): Boolean;
  end;

  { CosrvReferencias }
  CosrvReferencias = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvReferencias;
  end;

  { TsrvReferencias_Proxy }
  TsrvReferencias_Proxy = class(TDataAbstractService_Proxy, IsrvReferencias)
  protected
    function __GetInterfaceName:string; override;

    function DarNuevaReferencia(const NombreReferencia: AnsiString; const EmpresaID: Integer): AnsiString;
    function IncrementarValorReferencia(const NombreReferencia: AnsiString; const Valor: AnsiString; const EmpresaID: Integer): Boolean;
  end;

  { IsrvUnidadesMedida }
  IsrvUnidadesMedida = interface(IDataAbstractService)
    ['{8B4C72F0-5ACE-46FF-9F00-D70C2B611652}']
  end;

  { CosrvUnidadesMedida }
  CosrvUnidadesMedida = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvUnidadesMedida;
  end;

  { TsrvUnidadesMedida_Proxy }
  TsrvUnidadesMedida_Proxy = class(TDataAbstractService_Proxy, IsrvUnidadesMedida)
  protected
    function __GetInterfaceName:string; override;

  end;

  { IsrvProvinciasPoblaciones }
  IsrvProvinciasPoblaciones = interface
    ['{551D8756-51AE-4929-B235-107CD7B05C38}']
    function DarListaProvincias: Binary;
    function DarListaPoblaciones(const ID_Provincia: Integer): Binary;
  end;

  { CosrvProvinciasPoblaciones }
  CosrvProvinciasPoblaciones = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvProvinciasPoblaciones;
  end;

  { TsrvProvinciasPoblaciones_Proxy }
  TsrvProvinciasPoblaciones_Proxy = class(TROProxy, IsrvProvinciasPoblaciones)
  protected
    function __GetInterfaceName:string; override;

    function DarListaProvincias: Binary;
    function DarListaPoblaciones(const ID_Provincia: Integer): Binary;
  end;

implementation

uses
  {vcl:} SysUtils,
  {RemObjects:} uROEventRepository, uROSerializer, uRORes;

{ TRdxEmpresasArray }

procedure TRdxEmpresasArray.Assign(iSource: TPersistent);
var lSource:TRdxEmpresasArray;
    i:integer;
begin
  if (iSource is TRdxEmpresasArray) then begin
    lSource := TRdxEmpresasArray(iSource);
    Clear();
    Resize(lSource.Count);

    for i := 0 to Count-1 do begin
      Items[i] := lSource.Items[i];
    end;
  end
  else begin
    inherited Assign(iSource);
  end;
end;

class function TRdxEmpresasArray.GetItemType: PTypeInfo;
begin
  result := TypeInfo(Integer);
end;

class function TRdxEmpresasArray.GetItemSize: integer;
begin
  result := SizeOf(Integer);
end;

function TRdxEmpresasArray.GetItems(aIndex: integer): Integer;
begin
  if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]);
  result := fItems[aIndex];
end;

function TRdxEmpresasArray.GetItemRef(aIndex: integer): pointer;
begin
  if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]);
  result := @fItems[aIndex];
end;

procedure TRdxEmpresasArray.Clear;
begin
  SetLength(fItems, 0);
  FCount := 0;
end;

procedure TRdxEmpresasArray.Delete(aIndex: integer);
var i: integer;
begin
  if (aIndex>=Count) then RaiseError(err_InvalidIndex, [aIndex]);

  if (aIndex<Count-1) then
    for i := aIndex to Count-2 do fItems[i] := fItems[i+1];

  SetLength(fItems, Count-1);
  Dec(FCount);
end;

procedure TRdxEmpresasArray.SetItems(aIndex: integer; const Value: Integer);
begin
  if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]);
  fItems[aIndex] := Value;
end;

procedure TRdxEmpresasArray.Resize(ElementCount: integer);
begin
  if fCount = ElementCount then Exit;
  SetLength(fItems, ElementCount);
  FCount := ElementCount;
end;

function TRdxEmpresasArray.GetCount: integer;
begin
  result := FCount;
end;

procedure TRdxEmpresasArray.Grow;
var
  Delta, Capacity: Integer;
begin
  Capacity := Length(fItems);
  if Capacity > 64 then
    Delta := Capacity div 4
  else
    if Capacity > 8 then
      Delta := 16
   else
      Delta := 4;
  SetLength(fItems, Capacity + Delta);
end;

function TRdxEmpresasArray.Add(const Value: Integer): integer;
begin
  Result := Count;
  if Length(fItems) = Result then
    Grow;
  fItems[result] := Value;
  Inc(fCount);
end;

function TRdxEmpresasArray.GetIndex(const aPropertyName: string;
  const aPropertyValue: Variant; StartFrom: integer;
  Options: TROSearchOptions): integer;
begin
  result := -1;
end;

procedure TRdxEmpresasArray.ReadComplex(ASerializer: TObject);
var
  lval: Integer;
  i: integer;
begin
  for i := 0 to Count-1 do begin
    with TROSerializer(ASerializer) do
      ReadInteger(GetArrayElementName(GetItemType, GetItemRef(i)), otSLong, lval, i);
    Items[i] := lval;
  end;
end;

procedure TRdxEmpresasArray.WriteComplex(ASerializer: TObject);
var
  i: integer;
begin
  for i := 0 to Count-1 do
    with TROSerializer(ASerializer) do
      WriteInteger(GetArrayElementName(GetItemType, GetItemRef(i)), otSLong, fItems[i], i);
end;

{ TIntegerArray }

procedure TIntegerArray.Assign(iSource: TPersistent);
var lSource:TIntegerArray;
    i:integer;
begin
  if (iSource is TIntegerArray) then begin
    lSource := TIntegerArray(iSource);
    Clear();
    Resize(lSource.Count);

    for i := 0 to Count-1 do begin
      Items[i] := lSource.Items[i];
    end;
  end
  else begin
    inherited Assign(iSource);
  end;
end;

class function TIntegerArray.GetItemType: PTypeInfo;
begin
  result := TypeInfo(Integer);
end;

class function TIntegerArray.GetItemSize: integer;
begin
  result := SizeOf(Integer);
end;

function TIntegerArray.GetItems(aIndex: integer): Integer;
begin
  if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]);
  result := fItems[aIndex];
end;

function TIntegerArray.GetItemRef(aIndex: integer): pointer;
begin
  if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]);
  result := @fItems[aIndex];
end;

procedure TIntegerArray.Clear;
begin
  SetLength(fItems, 0);
  FCount := 0;
end;

procedure TIntegerArray.Delete(aIndex: integer);
var i: integer;
begin
  if (aIndex>=Count) then RaiseError(err_InvalidIndex, [aIndex]);

  if (aIndex<Count-1) then
    for i := aIndex to Count-2 do fItems[i] := fItems[i+1];

  SetLength(fItems, Count-1);
  Dec(FCount);
end;

procedure TIntegerArray.SetItems(aIndex: integer; const Value: Integer);
begin
  if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]);
  fItems[aIndex] := Value;
end;

procedure TIntegerArray.Resize(ElementCount: integer);
begin
  if fCount = ElementCount then Exit;
  SetLength(fItems, ElementCount);
  FCount := ElementCount;
end;

function TIntegerArray.GetCount: integer;
begin
  result := FCount;
end;

procedure TIntegerArray.Grow;
var
  Delta, Capacity: Integer;
begin
  Capacity := Length(fItems);
  if Capacity > 64 then
    Delta := Capacity div 4
  else
    if Capacity > 8 then
      Delta := 16
   else
      Delta := 4;
  SetLength(fItems, Capacity + Delta);
end;

function TIntegerArray.Add(const Value: Integer): integer;
begin
  Result := Count;
  if Length(fItems) = Result then
    Grow;
  fItems[result] := Value;
  Inc(fCount);
end;

function TIntegerArray.GetIndex(const aPropertyName: string;
  const aPropertyValue: Variant; StartFrom: integer;
  Options: TROSearchOptions): integer;
begin
  result := -1;
end;

procedure TIntegerArray.ReadComplex(ASerializer: TObject);
var
  lval: Integer;
  i: integer;
begin
  for i := 0 to Count-1 do begin
    with TROSerializer(ASerializer) do
      ReadInteger(GetArrayElementName(GetItemType, GetItemRef(i)), otSLong, lval, i);
    Items[i] := lval;
  end;
end;

procedure TIntegerArray.WriteComplex(ASerializer: TObject);
var
  i: integer;
begin
  for i := 0 to Count-1 do
    with TROSerializer(ASerializer) do
      WriteInteger(GetArrayElementName(GetItemType, GetItemRef(i)), otSLong, fItems[i], i);
end;

{ TRdxLoginInfo }

procedure TRdxLoginInfo.Assign(iSource: TPersistent); 
var lSource: Etiquetas_Intf.TRdxLoginInfo;
begin
  inherited Assign(iSource);
  if (iSource is Etiquetas_Intf.TRdxLoginInfo) then begin
    lSource := Etiquetas_Intf.TRdxLoginInfo(iSource);
    UserID := lSource.UserID;
    SessionID := lSource.SessionID;
    Usuario := lSource.Usuario;
    Perfiles.Assign(lSource.Perfiles);
    Empresas.Assign(lSource.Empresas);
  end;
end;

function TRdxLoginInfo.GetPerfiles: StringArray;
begin
  if (fPerfiles = nil) then fPerfiles := StringArray.Create();
  result := fPerfiles;
end;

function TRdxLoginInfo.GetEmpresas: TRdxEmpresasArray;
begin
  if (fEmpresas = nil) then fEmpresas := TRdxEmpresasArray.Create();
  result := fEmpresas;
end;

procedure TRdxLoginInfo.ReadComplex(ASerializer: TObject);
var
  l_Empresas: TRdxEmpresasArray;
  l_Perfiles: StringArray;
  l_SessionID: AnsiString;
  l_UserID: Integer;
  l_Usuario: AnsiString;
begin
  if TROSerializer(ASerializer).RecordStrictOrder then begin
    l_UserID := UserID;
    TROSerializer(ASerializer).ReadInteger('UserID', otSLong, l_UserID);
    UserID := l_UserID;
    l_SessionID := SessionID;
    TROSerializer(ASerializer).ReadAnsiString('SessionID', l_SessionID);
    SessionID := l_SessionID;
    l_Usuario := Usuario;
    TROSerializer(ASerializer).ReadAnsiString('Usuario', l_Usuario);
    Usuario := l_Usuario;
    l_Perfiles := Perfiles;
    TROSerializer(ASerializer).ReadArray('Perfiles', StringArray, l_Perfiles);
    if Perfiles <> l_Perfiles then Perfiles.Free;
    Perfiles := l_Perfiles;
    l_Empresas := Empresas;
    TROSerializer(ASerializer).ReadArray('Empresas', TRdxEmpresasArray, l_Empresas);
    if Empresas <> l_Empresas then Empresas.Free;
    Empresas := l_Empresas;
  end
  else begin
    l_Empresas := Empresas;
    TROSerializer(ASerializer).ReadArray('Empresas', TRdxEmpresasArray, l_Empresas);
    if Empresas <> l_Empresas then Empresas.Free;
    Empresas := l_Empresas;
    l_Perfiles := Perfiles;
    TROSerializer(ASerializer).ReadArray('Perfiles', StringArray, l_Perfiles);
    if Perfiles <> l_Perfiles then Perfiles.Free;
    Perfiles := l_Perfiles;
    l_SessionID := SessionID;
    TROSerializer(ASerializer).ReadAnsiString('SessionID', l_SessionID);
    SessionID := l_SessionID;
    l_UserID := UserID;
    TROSerializer(ASerializer).ReadInteger('UserID', otSLong, l_UserID);
    UserID := l_UserID;
    l_Usuario := Usuario;
    TROSerializer(ASerializer).ReadAnsiString('Usuario', l_Usuario);
    Usuario := l_Usuario;
  end;
end;

procedure TRdxLoginInfo.WriteComplex(ASerializer: TObject);
var
  l_Empresas: TRdxEmpresasArray;
  l_Perfiles: StringArray;
  l_SessionID: AnsiString;
  l_UserID: Integer;
  l_Usuario: AnsiString;
begin
  if TROSerializer(ASerializer).RecordStrictOrder then begin
    TROSerializer(ASerializer).ChangeClass(TRdxLoginInfo);
    l_UserID := UserID;
    TROSerializer(ASerializer).WriteInteger('UserID', otSLong, l_UserID);
    l_SessionID := SessionID;
    TROSerializer(ASerializer).WriteAnsiString('SessionID', l_SessionID);
    l_Usuario := Usuario;
    TROSerializer(ASerializer).WriteAnsiString('Usuario', l_Usuario);
    l_Perfiles := Perfiles;
    TROSerializer(ASerializer).WriteArray('Perfiles', l_Perfiles, StringArray);
    l_Empresas := Empresas;
    TROSerializer(ASerializer).WriteArray('Empresas', l_Empresas, TRdxEmpresasArray);
  end
  else begin
    l_Empresas := Empresas;
    TROSerializer(ASerializer).WriteArray('Empresas', l_Empresas, TRdxEmpresasArray);
    l_Perfiles := Perfiles;
    TROSerializer(ASerializer).WriteArray('Perfiles', l_Perfiles, StringArray);
    l_SessionID := SessionID;
    TROSerializer(ASerializer).WriteAnsiString('SessionID', l_SessionID);
    l_UserID := UserID;
    TROSerializer(ASerializer).WriteInteger('UserID', otSLong, l_UserID);
    l_Usuario := Usuario;
    TROSerializer(ASerializer).WriteAnsiString('Usuario', l_Usuario);
  end;
end;

{ TRdxLoginInfoCollection }
constructor TRdxLoginInfoCollection.Create;
begin
  inherited Create(TRdxLoginInfo);
end;

constructor TRdxLoginInfoCollection.Create(aItemClass: TCollectionItemClass);
begin
  inherited Create(aItemClass);
end;

function TRdxLoginInfoCollection.Add: TRdxLoginInfo;
begin
  result := TRdxLoginInfo(inherited Add);
end;

function TRdxLoginInfoCollection.GetItems(aIndex: integer): TRdxLoginInfo;
begin
  result := TRdxLoginInfo(inherited Items[aIndex]);
end;

procedure TRdxLoginInfoCollection.SetItems(aIndex: integer; const Value: TRdxLoginInfo);
begin
  TRdxLoginInfo(inherited Items[aIndex]).Assign(Value);
end;

{ CosrvContactos }

class function CosrvContactos.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvContactos;
begin
  result := TsrvContactos_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvContactos_Proxy }

function TsrvContactos_Proxy.__GetInterfaceName:string;
begin
  result := 'srvContactos';
end;

function TsrvContactos_Proxy.GenerarInformeEtiquetas(const ListaID: TIntegerArray): Binary;
begin
  try
    result := nil;
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'GenerarInformeEtiquetas');
    __Message.Write('ListaID', TypeInfo(Etiquetas_Intf.TIntegerArray), ListaID, []);
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(Binary), result, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

function TsrvContactos_Proxy.GenerarInformeFichaPaciente(const ListaID: TIntegerArray): Binary;
begin
  try
    result := nil;
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'GenerarInformeFichaPaciente');
    __Message.Write('ListaID', TypeInfo(Etiquetas_Intf.TIntegerArray), ListaID, []);
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(Binary), result, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

{ CosrvLogin }

class function CosrvLogin.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvLogin;
begin
  result := TsrvLogin_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvLogin_Proxy }

function TsrvLogin_Proxy.__GetInterfaceName:string;
begin
  result := 'srvLogin';
end;

function TsrvLogin_Proxy.Login(const User: AnsiString; const Password: AnsiString; out LoginInfo: TRdxLoginInfo): Boolean;
begin
  try
    LoginInfo := nil;
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'Login');
    __Message.Write('User', TypeInfo(AnsiString), User, []);
    __Message.Write('Password', TypeInfo(AnsiString), Password, []);
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(Boolean), result, []);
    __Message.Read('LoginInfo', TypeInfo(Etiquetas_Intf.TRdxLoginInfo), LoginInfo, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

procedure TsrvLogin_Proxy.Logout;
begin
  try
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'Logout');
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

  finally
    __Message.FreeStream;
  end
end;

function TsrvLogin_Proxy.Ping: Boolean;
begin
  try
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'Ping');
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(Boolean), result, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

{ CosrvEmpresas }

class function CosrvEmpresas.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvEmpresas;
begin
  result := TsrvEmpresas_Proxy.Create(aMessage, aTransportChannel);
end;

function TsrvEmpresas_Proxy.__GetInterfaceName:string;
begin
  result := 'srvEmpresas';
end;

{ CosrvConfiguracion }

class function CosrvConfiguracion.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvConfiguracion;
begin
  result := TsrvConfiguracion_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvConfiguracion_Proxy }

function TsrvConfiguracion_Proxy.__GetInterfaceName:string;
begin
  result := 'srvConfiguracion';
end;

function TsrvConfiguracion_Proxy.darValor(const CODIGO: AnsiString; const ValorPorDefecto: AnsiString): AnsiString;
begin
  try
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'darValor');
    __Message.Write('CODIGO', TypeInfo(AnsiString), CODIGO, []);
    __Message.Write('ValorPorDefecto', TypeInfo(AnsiString), ValorPorDefecto, []);
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(AnsiString), result, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

{ CosrvUsuarios }

class function CosrvUsuarios.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvUsuarios;
begin
  result := TsrvUsuarios_Proxy.Create(aMessage, aTransportChannel);
end;

function TsrvUsuarios_Proxy.__GetInterfaceName:string;
begin
  result := 'srvUsuarios';
end;

{ CosrvArticulos }

class function CosrvArticulos.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvArticulos;
begin
  result := TsrvArticulos_Proxy.Create(aMessage, aTransportChannel);
end;

function TsrvArticulos_Proxy.__GetInterfaceName:string;
begin
  result := 'srvArticulos';
end;

{ CosrvMedicacion }

class function CosrvMedicacion.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvMedicacion;
begin
  result := TsrvMedicacion_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvMedicacion_Proxy }

function TsrvMedicacion_Proxy.__GetInterfaceName:string;
begin
  result := 'srvMedicacion';
end;

function TsrvMedicacion_Proxy.GenerarInforme(const ListaID: TIntegerArray): Binary;
begin
  try
    result := nil;
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'GenerarInforme');
    __Message.Write('ListaID', TypeInfo(Etiquetas_Intf.TIntegerArray), ListaID, []);
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(Binary), result, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

{ CosrvReferencias }

class function CosrvReferencias.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvReferencias;
begin
  result := TsrvReferencias_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvReferencias_Proxy }

function TsrvReferencias_Proxy.__GetInterfaceName:string;
begin
  result := 'srvReferencias';
end;

function TsrvReferencias_Proxy.DarNuevaReferencia(const NombreReferencia: AnsiString; const EmpresaID: Integer): AnsiString;
begin
  try
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'DarNuevaReferencia');
    __Message.Write('NombreReferencia', TypeInfo(AnsiString), NombreReferencia, []);
    __Message.Write('EmpresaID', TypeInfo(Integer), EmpresaID, []);
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(AnsiString), result, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

function TsrvReferencias_Proxy.IncrementarValorReferencia(const NombreReferencia: AnsiString; const Valor: AnsiString; const EmpresaID: Integer): Boolean;
begin
  try
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'IncrementarValorReferencia');
    __Message.Write('NombreReferencia', TypeInfo(AnsiString), NombreReferencia, []);
    __Message.Write('Valor', TypeInfo(AnsiString), Valor, []);
    __Message.Write('EmpresaID', TypeInfo(Integer), EmpresaID, []);
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(Boolean), result, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

{ CosrvUnidadesMedida }

class function CosrvUnidadesMedida.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvUnidadesMedida;
begin
  result := TsrvUnidadesMedida_Proxy.Create(aMessage, aTransportChannel);
end;

function TsrvUnidadesMedida_Proxy.__GetInterfaceName:string;
begin
  result := 'srvUnidadesMedida';
end;

{ CosrvProvinciasPoblaciones }

class function CosrvProvinciasPoblaciones.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvProvinciasPoblaciones;
begin
  result := TsrvProvinciasPoblaciones_Proxy.Create(aMessage, aTransportChannel);
end;

{ TsrvProvinciasPoblaciones_Proxy }

function TsrvProvinciasPoblaciones_Proxy.__GetInterfaceName:string;
begin
  result := 'srvProvinciasPoblaciones';
end;

function TsrvProvinciasPoblaciones_Proxy.DarListaProvincias: Binary;
begin
  try
    result := nil;
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'DarListaProvincias');
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(Binary), result, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

function TsrvProvinciasPoblaciones_Proxy.DarListaPoblaciones(const ID_Provincia: Integer): Binary;
begin
  try
    result := nil;
    __Message.InitializeRequestMessage(__TransportChannel, 'Etiquetas', __InterfaceName, 'DarListaPoblaciones');
    __Message.Write('ID_Provincia', TypeInfo(Integer), ID_Provincia, []);
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(Binary), result, []);
  finally
    __Message.UnsetAttributes(__TransportChannel);
    __Message.FreeStream;
  end
end;

initialization
  RegisterROClass(TRdxLoginInfo);
  RegisterROClass(TRdxEmpresasArray);
  RegisterROClass(TIntegerArray);
  RegisterProxyClass(IsrvContactos_IID, TsrvContactos_Proxy);
  RegisterProxyClass(IsrvLogin_IID, TsrvLogin_Proxy);
  RegisterProxyClass(IsrvEmpresas_IID, TsrvEmpresas_Proxy);
  RegisterProxyClass(IsrvConfiguracion_IID, TsrvConfiguracion_Proxy);
  RegisterProxyClass(IsrvUsuarios_IID, TsrvUsuarios_Proxy);
  RegisterProxyClass(IsrvArticulos_IID, TsrvArticulos_Proxy);
  RegisterProxyClass(IsrvMedicacion_IID, TsrvMedicacion_Proxy);
  RegisterProxyClass(IsrvReferencias_IID, TsrvReferencias_Proxy);
  RegisterProxyClass(IsrvUnidadesMedida_IID, TsrvUnidadesMedida_Proxy);
  RegisterProxyClass(IsrvProvinciasPoblaciones_IID, TsrvProvinciasPoblaciones_Proxy);


finalization
  UnregisterROClass(TRdxLoginInfo);
  UnregisterROClass(TRdxEmpresasArray);
  UnregisterROClass(TIntegerArray);
  UnregisterProxyClass(IsrvContactos_IID);
  UnregisterProxyClass(IsrvLogin_IID);
  UnregisterProxyClass(IsrvEmpresas_IID);
  UnregisterProxyClass(IsrvConfiguracion_IID);
  UnregisterProxyClass(IsrvUsuarios_IID);
  UnregisterProxyClass(IsrvArticulos_IID);
  UnregisterProxyClass(IsrvMedicacion_IID);
  UnregisterProxyClass(IsrvReferencias_IID);
  UnregisterProxyClass(IsrvUnidadesMedida_IID);
  UnregisterProxyClass(IsrvProvinciasPoblaciones_IID);

end.
