Page 1 of 1

TdiZQA_Z02 repetitive segments

Posted: Wed Dec 21, 2011 2:34 pm
by ibarrols
Hi,

I'm doing a message repeated segments, including:

PR1 | setId | | Description ^ ^ CódigoPráctica IdNomenclador
AUT FechaVencAutorizacion ||||| | | | CantPrestacionAutorizar
Zau | | NroPreautorización

The segments that are not defined like this:

Code: Select all

MSHList: TdiSegmentList;
ZAUList: TdiSegmentList;
As repetitive segments are defined PRD1, AUT and Zau?

thanks!

Re: TdiZQA_Z02 repetitive segments

Posted: Thu Dec 22, 2011 7:14 am
by admin
Hi,

For PR1 segment sample definition is below:

Code: Select all

TdiZQA_Z02_24=class(TdiMessage)
private
  PR1List:TdiSegmentList;
protected
   function GetPR1(RepCount : Integer ) : TdiPR1_24;
   procedure SetPR1( RepCount : Integer; Value : TdiPR1_24);
public
   property PR1[RepCount : Integer ] : TdiPR1_24 read GetPR1 write SetPR1;
   function PR1RepCount : Integer;
   constructor Create; override;
end;

implementation

function TdiZQA_Z02_24.GetPR1(RepCount : Integer ) : TdiPR1_24;
begin
  Result:=TdiPR1_24(Find('PR1',RepCount));
end;
function TdiZQA_Z02_24.PR1RepCount : Integer;
begin
  Result:=GetSegmentCount('PR1');
end;
constructor TdiZQA_Z02_24.Create;
begin
   inherited;
   ...
   ...
  PR1List:=TdiSegmentList.Create;  
  PR1List.SetDefault('PR1', // Segment Name
                              'TdiPR1_24', // Segment Type Name
                              3, // Zero based segment order
                              1, // Minimum number of repetitions. if 0 is optional
                             -1,//Maximum number of repetitions. if 0 is optional. if -1 is unbounded
                              Self);
  Add(PR1List);
  ...
end;
Best regards.