TdiZQA_Z02 repetitive segments

Discussion of open issues, suggestions and bugs regarding to (known as Delphi HL7) HL7 Components
Post Reply
ibarrols
Posts: 11
Joined: Thu Nov 24, 2011 5:20 pm

TdiZQA_Z02 repetitive segments

Post 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!
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: TdiZQA_Z02 repetitive segments

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest