"Unknown segment: ZAU"
-
- Posts: 11
- Joined: Thu Nov 24, 2011 5:20 pm
"Unknown segment: ZAU"
hi, testing with the version 2.4. I'm trying to parse an HL7 message type "eligibility" which consists of the following:
MSH|^~\{|SAMA|SAMA^133455^IIN|TRIA0100M|TRIA00000009|20111216080114||ZPI^Z01^ZPI_Z01|11121608010490289501|P|2.4|0||NE|AL|ARG'#$D'MSA|AA|11091312460943449038'#$D'ZAU||1989|B000'#$D'PRD|PS^Prestador Solicitante||||||30500974016^CU'#$D'PID|1||2000007902^^^SAMA^HC~38386962^^^^NNArg||FRITZLER^K. Stacie'#$D'IN1|1|SIB|133455'#$D'ZIN|Y|GRAV^GRAVADO'#$D
The problem is that when I try to associate the value string of the message with the class, I pulled the following error:
"Unknown segment: Zau"
I do not think the object type must be used with this type of message so I'm asking for help.
thank you very much!
MSH|^~\{|SAMA|SAMA^133455^IIN|TRIA0100M|TRIA00000009|20111216080114||ZPI^Z01^ZPI_Z01|11121608010490289501|P|2.4|0||NE|AL|ARG'#$D'MSA|AA|11091312460943449038'#$D'ZAU||1989|B000'#$D'PRD|PS^Prestador Solicitante||||||30500974016^CU'#$D'PID|1||2000007902^^^SAMA^HC~38386962^^^^NNArg||FRITZLER^K. Stacie'#$D'IN1|1|SIB|133455'#$D'ZIN|Y|GRAV^GRAVADO'#$D
The problem is that when I try to associate the value string of the message with the class, I pulled the following error:
"Unknown segment: Zau"
I do not think the object type must be used with this type of message so I'm asking for help.
thank you very much!
-
- Site Admin
- Posts: 256
- Joined: Sun Jun 05, 2011 8:06 pm
Re: "Unknown segment: ZAU"
Hi,
You can define your custom Segments. You need segment definition.
Sample definition for NTE segment:
If you need more help, please send your message definiton to forum or support@delphihl7.com.
Best regards.
You can define your custom Segments. You need segment definition.
Sample definition for NTE segment:
Code: Select all
TdiNTE_24 = class(TdiSegment)
private
SetIDNTEList : TdiList;
SourceofCommentList : TdiList;
CommentList : TdiList;
CommentTypeList : TdiList;
protected
function GetSetIDNTE : TdiSI_24;
procedure SetSetIDNTE(Value : TdiSI_24);
function GetSourceofComment : TdiID_24;
procedure SetSourceofComment(Value : TdiID_24);
function GetComment(RepCount : Integer) : TdiFT_24;
procedure SetComment(RepCount : Integer; Value : TdiFT_24);
function GetCommentType : TdiCE_24;
procedure SetCommentType(Value : TdiCE_24);
public
property SetIDNTE : TdiSI_24 read GetSetIDNTE write SetSetIDNTE;
property SourceofComment : TdiID_24 read GetSourceofComment write SetSourceofComment;
property Comment[RepCount : Integer] : TdiFT_24 read GetComment write SetComment;
function CommentRepCount : Integer;
property CommentType : TdiCE_24 read GetCommentType write SetCommentType;
constructor Create; override;
end;
implementation
constructor TdiNTE_24.Create;
begin
inherited;
Name :='NTE';
SetIDNTEList:=TdiList.Create;
SetIDNTEList.SetDefault('SI','TdiSI_24',0,0,1,Self);
Add(SetIDNTEList);
SourceofCommentList:=TdiList.Create;
SourceofCommentList.SetDefault('ID','TdiID_24',1,0,1,Self);
Add(SourceofCommentList);
CommentList:=TdiList.Create;
CommentList.SetDefault('FT','TdiFT_24',2,0,-1,Self);
Add(CommentList);
CommentTypeList:=TdiList.Create;
CommentTypeList.SetDefault('CE','TdiCE_24',3,0,1,Self);
Add(CommentTypeList);
end;
function TdiNTE_24.GetSetIDNTE : TdiSI_24;
begin
Result:= TdiSI_24(GetRepByIndex(0,0));
end;
procedure TdiNTE_24.SetSetIDNTE(Value : TdiSI_24);
begin
SetByIndex(0,0,Value);
end;
function TdiNTE_24.GetSourceofComment : TdiID_24;
begin
Result:= TdiID_24(GetRepByIndex(1,0));
end;
procedure TdiNTE_24.SetSourceofComment(Value : TdiID_24);
begin
SetByIndex(1,0,Value);
end;
function TdiNTE_24.GetComment(RepCount:Integer): TdiFT_24;
begin
Result:= TdiFT_24(GetRepByIndex(2,RepCount));
end;
procedure TdiNTE_24.SetComment(RepCount:Integer;Value: TdiFT_24);
begin
SetByIndex(2,RepCount,Value);
end;
function TdiNTE_24.CommentRepCount:Integer;
begin
Result:= CommentList.Count;
end;
function TdiNTE_24.GetCommentType : TdiCE_24;
begin
Result:= TdiCE_24(GetRepByIndex(3,0));
end;
procedure TdiNTE_24.SetCommentType(Value : TdiCE_24);
begin
SetByIndex(3,0,Value);
end;
end.
Best regards.
-
- Posts: 11
- Joined: Thu Nov 24, 2011 5:20 pm
Re: "Unknown segment: ZAU"
Hi, I need to parse the message and something I'm doing wrong, message :
Now when creating an object and assign throws me the same message:
I still leave the same error:
UNKNOWN SEGMENT: ZAU
I'm doing something wrong ... thanks!
Code: Select all
MSH|^~\{|SAMA|SAMA^133455^IIN|TRIA0100M|TRIA00000001|20111219092646||ZPI^Z01^ZPI_Z01|11121909264229902659|P|2.4|0||AL|NE|ARG
MSA|AA|11091312460943449038
ZAU||2165|B000
PRD|PS^Prestador Solicitante||||||30500974016^CU
PID|1||2000007902^^^SAMA^HC~38386962^^^^NNArg||FRITZLER^K. Stacie
IN1|1|SIB|133455
ZIN|Y|GRAV^GRAVADO
Code: Select all
TdiZQI_Z01_24= class(TdiMessage)
private
MSHList:TdiSegmentList;
PRDList:TdiSegmentList;
PIDList:TdiSegmentList;
ZAUList:TdiSegmentList;
protected
function GetMSH : TdiMSH_24;
procedure SetMSH(Value : TdiMSH_24);
function GetPRD : TdiPRD_24;
procedure SetPRD(Value : TdiPRD_24);
function GetPID : TdiPID_24;
procedure SetPID(Value : TdiPID_24);
function GetZAU : TdiSI_24;
procedure SetZAU(Value : TdiSI_24);
public
property MSH : TdiMSH_24 read GetMSH write SetMSH;
property PRD : TdiPRD_24 read GetPRD write SetPRD;
property PID : TdiPID_24 read GetPID write SetPID;
property ZAU : TdiSI_24 read GetZAU write SetZAU;
constructor Create; override;
end;
constructor TdiZQI_Z01_24.Create;
begin
inherited;
Name :='ZQI_Z01';
MessageType :='ZQI';
TriggerEvent :='Z01';
HL7Version :='2.4';
MSHList:=TdiSegmentList.Create;
// Class’s Name,DataType, Index, Minumum also Maximum rep. count and parentnode.
MSHList.SetDefault('MSH','TdiMSH_24',0,1,1,Self);
Add(MSHList);
PRDList:=TdiSegmentList.Create;
PRDList.SetDefault('PRD','TdiPRD_24',1,1,1,Self);
Add(PRDList);
PIDList:=TdiSegmentList.Create;
PIDList.SetDefault('PID','TdiPID_24',2,1,1,Self);
Add(PIDList);
ZAUList:=TdiSegmentList.Create;
ZAUList.SetDefault('ZAU','TdiSI_24',3,1,1,Self);
Add(ZAUList);
Parse(InitMsg);
end;
function TdiZQI_Z01_24.GetMSH: TdiMSH_24;
begin
Result:=TdiMSH_24(Find('MSH',0));
end;
function TdiZQI_Z01_24.GetPRD: TdiPRD_24;
begin
Result:=TdiPRD_24(Find('PRD',0));
end;
function TdiZQI_Z01_24.GetPID: TdiPID_24;
begin
Result:=TdiPID_24(Find('PID',0));
end;
function TdiZQI_Z01_24.GetZAU: TdiSI_24;
begin
Result:=TdiSI_24(Find('ZAU',0));
end;
procedure TdiZQI_Z01_24.SetMSH(Value: TdiMSH_24);
begin
SetByName('MSH',0,Value);
end;
procedure TdiZQI_Z01_24.SetPRD(Value: TdiPRD_24);
begin
SetByName('PRD',0,Value);
end;
procedure TdiZQI_Z01_24.SetPID(Value: TdiPID_24);
begin
SetByName('PID',0,Value);
end;
procedure TdiZQI_Z01_24.SetZAU(Value: TdiSI_24);
begin
SetByName('ZAU',0,Value);
end;
Code: Select all
msgParse: = TdiZQI_Z01_24.Create;
msgParse.AsString: = Memo2.Text;
UNKNOWN SEGMENT: ZAU
I'm doing something wrong ... thanks!
-
- Site Admin
- Posts: 256
- Joined: Sun Jun 05, 2011 8:06 pm
Re: "Unknown segment: ZAU"
Hi,
You need ZAU segment definition.
You have a document for ZAU segment?
Which fields (Name, Type,Min,Max) have it?
Best regard.
You need ZAU segment definition.
You have a document for ZAU segment?
Which fields (Name, Type,Min,Max) have it?
Best regard.
-
- Posts: 11
- Joined: Thu Nov 24, 2011 5:20 pm
Re: "Unknown segment: ZAU"
Documentation Segment ZAU
ZAU - Insurance Authorization (IDXRAD-specific)
ZAU 1 zau-ins-carrier1 st
ZAU 2 zau-preauth-cd-1 st
ZAU 3 zau-ins-carrier2 st
ZAU 4 zau-preauth-cd-2 st
ZAU 5 zau-ins-carrier3 st
ZAU 6 zau-preauth-cd-3 st
ZAU 7 zau-ins-carrier4 st
ZAU 8 zau-preauth-cd-4 st
ZAU 9 zau-ins-carrier5 st
ZAU 10 zau-preauth-cd-5 st
ZAU 11 zau-ins-carrier6 st
ZAU 12 zau-preauth-cd-6 st
Example
ZAU||NumberAuthorization|IdState^Description|||CodePayment&Currency
Thanks!
ZAU - Insurance Authorization (IDXRAD-specific)
ZAU 1 zau-ins-carrier1 st
ZAU 2 zau-preauth-cd-1 st
ZAU 3 zau-ins-carrier2 st
ZAU 4 zau-preauth-cd-2 st
ZAU 5 zau-ins-carrier3 st
ZAU 6 zau-preauth-cd-3 st
ZAU 7 zau-ins-carrier4 st
ZAU 8 zau-preauth-cd-4 st
ZAU 9 zau-ins-carrier5 st
ZAU 10 zau-preauth-cd-5 st
ZAU 11 zau-ins-carrier6 st
ZAU 12 zau-preauth-cd-6 st
Example
ZAU||NumberAuthorization|IdState^Description|||CodePayment&Currency
Thanks!
-
- Site Admin
- Posts: 256
- Joined: Sun Jun 05, 2011 8:06 pm
Re: "Unknown segment: ZAU"
12 fields, and all field types ST.
ZAU segment definition:
Please send your documentation : support@delphihl7.com
Best regards.
ZAU segment definition:
Code: Select all
type
TdiZAU = class(TdiSegment)
private
inscarrier1List:TdiList;
preauthcd1List :TdiList;
inscarrier2List :TdiList;
preauthcd2List :TdiList;
inscarrier3List :TdiList;
preauthcd3List :TdiList;
inscarrier4List :TdiList;
preauthcd4List :TdiList;
inscarrier5List :TdiList;
preauthcd5List :TdiList;
inscarrier6List :TdiList;
preauthcd6List :TdiList;
protected
function Getinscarrier1: TdiST_24;
function Getinscarrier2: TdiST_24;
function Getinscarrier3: TdiST_24;
function Getinscarrier4: TdiST_24;
function Getinscarrier5: TdiST_24;
function Getinscarrier6: TdiST_24;
function Getpreauthcd1: TdiST_24;
function Getpreauthcd2: TdiST_24;
function Getpreauthcd3: TdiST_24;
function Getpreauthcd4: TdiST_24;
function Getpreauthcd5: TdiST_24;
function Getpreauthcd6: TdiST_24;
procedure Setinscarrier1(const Value: TdiST_24);
procedure Setinscarrier2(const Value: TdiST_24);
procedure Setinscarrier3(const Value: TdiST_24);
procedure Setinscarrier4(const Value: TdiST_24);
procedure Setinscarrier5(const Value: TdiST_24);
procedure Setinscarrier6(const Value: TdiST_24);
procedure Setpreauthcd1(const Value: TdiST_24);
procedure Setpreauthcd2(const Value: TdiST_24);
procedure Setpreauthcd3(const Value: TdiST_24);
procedure Setpreauthcd4(const Value: TdiST_24);
procedure Setpreauthcd5(const Value: TdiST_24);
procedure Setpreauthcd6(const Value: TdiST_24);
public
property inscarrier1 : TdiST_24 read Getinscarrier1 write Setinscarrier1;
property preauthcd1 : TdiST_24 read Getpreauthcd1 write Setpreauthcd1;
property inscarrier2 : TdiST_24 read Getinscarrier2 write Setinscarrier2;
property preauthcd2 : TdiST_24 read Getpreauthcd2 write Setpreauthcd2;
property inscarrier3 : TdiST_24 read Getinscarrier3 write Setinscarrier3;
property preauthcd3 : TdiST_24 read Getpreauthcd3 write Setpreauthcd3;
property inscarrier4 : TdiST_24 read Getinscarrier4 write Setinscarrier4;
property preauthcd4 : TdiST_24 read Getpreauthcd4 write Setpreauthcd4;
property inscarrier5 : TdiST_24 read Getinscarrier5 write Setinscarrier5;
property preauthcd5 : TdiST_24 read Getpreauthcd5 write Setpreauthcd5;
property inscarrier6 : TdiST_24 read Getinscarrier6 write Setinscarrier6;
property preauthcd6 : TdiST_24 read Getpreauthcd6 write Setpreauthcd6;
constructor Create; override;
end;
implementation
{ TdiZAU }
constructor TdiZAU.Create;
begin
inherited;
Name :='ZAU';
inscarrier1List:=TdiList.Create;
inscarrier1List.SetDefault('ST','TdiST_24',0,0,1,Self);
Add(inscarrier1List);
preauthcd1List :=TdiList.Create;
preauthcd1List.SetDefault('ST','TdiST_24',1,0,1,Self);
Add(preauthcd1List);
inscarrier2List :=TdiList.Create;
inscarrier2List.SetDefault('ST','TdiST_24',2,0,1,Self);
Add(inscarrier2List);
preauthcd2List :=TdiList.Create;
preauthcd2List.SetDefault('ST','TdiST_24',3,0,1,Self);
Add(preauthcd2List);
inscarrier3List :=TdiList.Create;
inscarrier3List.SetDefault('ST','TdiST_24',4,0,1,Self);
Add(inscarrier3List);
preauthcd3List :=TdiList.Create;
preauthcd3List.SetDefault('ST','TdiST_24',5,0,1,Self);
Add(preauthcd3List);
inscarrier4List :=TdiList.Create;
inscarrier4List.SetDefault('ST','TdiST_24',6,0,1,Self);
Add(inscarrier4List);
preauthcd4List :=TdiList.Create;
preauthcd4List.SetDefault('ST','TdiST_24',7,0,1,Self);
Add(preauthcd4List);
inscarrier5List :=TdiList.Create;
inscarrier5List.SetDefault('ST','TdiST_24',8,0,1,Self);
Add(inscarrier5List);
preauthcd5List :=TdiList.Create;
preauthcd5List.SetDefault('ST','TdiST_24',9,0,1,Self);
Add(preauthcd5List);
inscarrier6List :=TdiList.Create;
inscarrier6List.SetDefault('ST','TdiST_24',10,0,1,Self);
Add(inscarrier6List);
preauthcd6List :=TdiList.Create;
preauthcd6List.SetDefault('ST','TdiST_24',11,0,1,Self);
Add(preauthcd6List);
end;
function TdiZAU.Getinscarrier1: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(0,0));
end;
function TdiZAU.Getinscarrier2: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(1,0));
end;
function TdiZAU.Getinscarrier3: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(2,0));
end;
function TdiZAU.Getinscarrier4: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(3,0));
end;
function TdiZAU.Getinscarrier5: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(4,0));
end;
function TdiZAU.Getinscarrier6: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(5,0));
end;
function TdiZAU.Getpreauthcd1: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(6,0));
end;
function TdiZAU.Getpreauthcd2: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(7,0));
end;
function TdiZAU.Getpreauthcd3: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(8,0));
end;
function TdiZAU.Getpreauthcd4: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(9,0));
end;
function TdiZAU.Getpreauthcd5: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(10,0));
end;
function TdiZAU.Getpreauthcd6: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(10,0));
end;
procedure TdiZAU.Setinscarrier1(const Value: TdiST_24);
begin
SetByIndex(0,0,Value);
end;
procedure TdiZAU.Setinscarrier2(const Value: TdiST_24);
begin
SetByIndex(1,0,Value);
end;
procedure TdiZAU.Setinscarrier3(const Value: TdiST_24);
begin
SetByIndex(2,0,Value);
end;
procedure TdiZAU.Setinscarrier4(const Value: TdiST_24);
begin
SetByIndex(3,0,Value);
end;
procedure TdiZAU.Setinscarrier5(const Value: TdiST_24);
begin
SetByIndex(4,0,Value);
end;
procedure TdiZAU.Setinscarrier6(const Value: TdiST_24);
begin
SetByIndex(5,0,Value);
end;
procedure TdiZAU.Setpreauthcd1(const Value: TdiST_24);
begin
SetByIndex(6,0,Value);
end;
procedure TdiZAU.Setpreauthcd2(const Value: TdiST_24);
begin
SetByIndex(7,0,Value);
end;
procedure TdiZAU.Setpreauthcd3(const Value: TdiST_24);
begin
SetByIndex(8,0,Value);
end;
procedure TdiZAU.Setpreauthcd4(const Value: TdiST_24);
begin
SetByIndex(9,0,Value);
end;
procedure TdiZAU.Setpreauthcd5(const Value: TdiST_24);
begin
SetByIndex(10,0,Value);
end;
procedure TdiZAU.Setpreauthcd6(const Value: TdiST_24);
begin
SetByIndex(11,0,Value);
end;
Best regards.
-
- Posts: 11
- Joined: Thu Nov 24, 2011 5:20 pm
Re: "Unknown segment: ZAU"
Hi, the message:
MSH|^~\{|TRIA0100M|TRIA00000001|SAMA|SAMA^133455^IIN|20111219143458||ZQI^Z01^ZQI_Z01|11091312460943449038|P|2.4|||AL|NE|ARG
PRD|PS^Prestador Solicitante||||||30500974016^CU
PID|||2000007902^^^SAMA^HC||UNKNOWN
ok, to send the message use the following object and working properly:
to receive the message:
MSH|^~\{|SAMA|SAMA^133455^IIN|TRIA0100M|TRIA00000001|20111219145758||ZPI^Z01^ZPI_Z01|11121914530779300747|P|2.4|0||AL|NE|ARG
MSA|AA|11091312460943449038
ZAU||2234|B000
PRD|PS^Prestador Solicitante||||||30500974016^CU
PID|1||2000007902^^^SAMA^HC~38386962^^^^NNArg||FRITZLER^K. Stacie
IN1|1|SIB|133455
ZIN|Y|GRAV^GRAVADO
to make the parser, I can do I have to use the same object modified or need to create a new class?
or relate the class to TdiZAU_24 and TdiZQI_Z01_24 you sent me in the post above?
send the documentation al email...
thanks!!!
MSH|^~\{|TRIA0100M|TRIA00000001|SAMA|SAMA^133455^IIN|20111219143458||ZQI^Z01^ZQI_Z01|11091312460943449038|P|2.4|||AL|NE|ARG
PRD|PS^Prestador Solicitante||||||30500974016^CU
PID|||2000007902^^^SAMA^HC||UNKNOWN
ok, to send the message use the following object and working properly:
Code: Select all
TdiZQI_Z01_24 = class(TdiMessage)
private
MSHList:TdiSegmentList;
PRDList:TdiSegmentList;
PIDList:TdiSegmentList;
ZAUList:TdiSegmentList;
protected
function GetMSH : TdiMSH_24;
procedure SetMSH(Value : TdiMSH_24);
function GetPRD : TdiPRD_24;
procedure SetPRD(Value : TdiPRD_24);
function GetPID : TdiPID_24;
procedure SetPID(Value : TdiPID_24);
function GetZAU : TdiZAU_24;
procedure SetZAU(Value : TdiZAU_24);//TdiSI_24);
public
property MSH : TdiMSH_24 read GetMSH write SetMSH;
property PRD : TdiPRD_24 read GetPRD write SetPRD;
property PID : TdiPID_24 read GetPID write SetPID;
constructor Create; override;
end;
Code: Select all
constructor TdiZQI_Z01_24.Create;
begin
inherited;
Name :='ZQI_Z01';
MessageType :='ZQI';
TriggerEvent :='Z01';
HL7Version :='2.4';
MSHList:=TdiSegmentList.Create;
// Class’s Name,DataType, Index, Minumum also Maximum rep. count and parentnode.
MSHList.SetDefault('MSH','TdiMSH_24',0,1,1,Self);
Add(MSHList);
PRDList:=TdiSegmentList.Create;
PRDList.SetDefault('PRD','TdiPRD_24',1,1,1,Self);
Add(PRDList);
PIDList:=TdiSegmentList.Create;
PIDList.SetDefault('PID','TdiPID_24',2,1,1,Self);
Add(PIDList);
Parse(InitMsg);
end;
to receive the message:
MSH|^~\{|SAMA|SAMA^133455^IIN|TRIA0100M|TRIA00000001|20111219145758||ZPI^Z01^ZPI_Z01|11121914530779300747|P|2.4|0||AL|NE|ARG
MSA|AA|11091312460943449038
ZAU||2234|B000
PRD|PS^Prestador Solicitante||||||30500974016^CU
PID|1||2000007902^^^SAMA^HC~38386962^^^^NNArg||FRITZLER^K. Stacie
IN1|1|SIB|133455
ZIN|Y|GRAV^GRAVADO
to make the parser, I can do I have to use the same object modified or need to create a new class?
or relate the class to TdiZAU_24 and TdiZQI_Z01_24 you sent me in the post above?
send the documentation al email...
thanks!!!
-
- Site Admin
- Posts: 256
- Joined: Sun Jun 05, 2011 8:06 pm
Re: "Unknown segment: ZAU"
Hi,
ZQI^Z01 message contains MSH,PRD, PID segments,
MSH,PRD and PID segments is standart segments.
You need only define ZQI^Z01 message.
ZPI^Z01 message contains MSH,MSA,ZAU,PRD,PID,IN1,ZIN segments.
MSH,MSA,PRD,PID,IN1 segments is standart segments.
ZAU, ZIN segments is non standart segments. (Custom Z segment). First you must define this segments.
Then you can define ZPI^Z01 message.
ZAU segment definition.
ZIN segment definition:
(You must define this segment)
ZPI_Z01 message definition:
Best regards.
ZQI^Z01 message contains MSH,PRD, PID segments,
MSH,PRD and PID segments is standart segments.
You need only define ZQI^Z01 message.
ZPI^Z01 message contains MSH,MSA,ZAU,PRD,PID,IN1,ZIN segments.
MSH,MSA,PRD,PID,IN1 segments is standart segments.
ZAU, ZIN segments is non standart segments. (Custom Z segment). First you must define this segments.
Then you can define ZPI^Z01 message.
ZAU segment definition.
Code: Select all
type
TdiZAU_24 = class(TdiSegment)
private
inscarrier1List:TdiList;
preauthcd1List :TdiList;
inscarrier2List :TdiList;
preauthcd2List :TdiList;
inscarrier3List :TdiList;
preauthcd3List :TdiList;
inscarrier4List :TdiList;
preauthcd4List :TdiList;
inscarrier5List :TdiList;
preauthcd5List :TdiList;
inscarrier6List :TdiList;
preauthcd6List :TdiList;
protected
function Getinscarrier1: TdiST_24;
function Getinscarrier2: TdiST_24;
function Getinscarrier3: TdiST_24;
function Getinscarrier4: TdiST_24;
function Getinscarrier5: TdiST_24;
function Getinscarrier6: TdiST_24;
function Getpreauthcd1: TdiST_24;
function Getpreauthcd2: TdiST_24;
function Getpreauthcd3: TdiST_24;
function Getpreauthcd4: TdiST_24;
function Getpreauthcd5: TdiST_24;
function Getpreauthcd6: TdiST_24;
procedure Setinscarrier1(const Value: TdiST_24);
procedure Setinscarrier2(const Value: TdiST_24);
procedure Setinscarrier3(const Value: TdiST_24);
procedure Setinscarrier4(const Value: TdiST_24);
procedure Setinscarrier5(const Value: TdiST_24);
procedure Setinscarrier6(const Value: TdiST_24);
procedure Setpreauthcd1(const Value: TdiST_24);
procedure Setpreauthcd2(const Value: TdiST_24);
procedure Setpreauthcd3(const Value: TdiST_24);
procedure Setpreauthcd4(const Value: TdiST_24);
procedure Setpreauthcd5(const Value: TdiST_24);
procedure Setpreauthcd6(const Value: TdiST_24);
public
property inscarrier1 : TdiST_24 read Getinscarrier1 write Setinscarrier1;
property preauthcd1 : TdiST_24 read Getpreauthcd1 write Setpreauthcd1;
property inscarrier2 : TdiST_24 read Getinscarrier2 write Setinscarrier2;
property preauthcd2 : TdiST_24 read Getpreauthcd2 write Setpreauthcd2;
property inscarrier3 : TdiST_24 read Getinscarrier3 write Setinscarrier3;
property preauthcd3 : TdiST_24 read Getpreauthcd3 write Setpreauthcd3;
property inscarrier4 : TdiST_24 read Getinscarrier4 write Setinscarrier4;
property preauthcd4 : TdiST_24 read Getpreauthcd4 write Setpreauthcd4;
property inscarrier5 : TdiST_24 read Getinscarrier5 write Setinscarrier5;
property preauthcd5 : TdiST_24 read Getpreauthcd5 write Setpreauthcd5;
property inscarrier6 : TdiST_24 read Getinscarrier6 write Setinscarrier6;
property preauthcd6 : TdiST_24 read Getpreauthcd6 write Setpreauthcd6;
constructor Create; override;
end;
implementation
{ TdiZAU_24 }
constructor TdiZAU_24.Create;
begin
inherited;
Name :='ZAU';
inscarrier1List:=TdiList.Create;
inscarrier1List.SetDefault('ST','TdiST_24',0,0,1,Self);
Add(inscarrier1List);
preauthcd1List :=TdiList.Create;
preauthcd1List.SetDefault('ST','TdiST_24',1,0,1,Self);
Add(preauthcd1List);
inscarrier2List :=TdiList.Create;
inscarrier2List.SetDefault('ST','TdiST_24',2,0,1,Self);
Add(inscarrier2List);
preauthcd2List :=TdiList.Create;
preauthcd2List.SetDefault('ST','TdiST_24',3,0,1,Self);
Add(preauthcd2List);
inscarrier3List :=TdiList.Create;
inscarrier3List.SetDefault('ST','TdiST_24',4,0,1,Self);
Add(inscarrier3List);
preauthcd3List :=TdiList.Create;
preauthcd3List.SetDefault('ST','TdiST_24',5,0,1,Self);
Add(preauthcd3List);
inscarrier4List :=TdiList.Create;
inscarrier4List.SetDefault('ST','TdiST_24',6,0,1,Self);
Add(inscarrier4List);
preauthcd4List :=TdiList.Create;
preauthcd4List.SetDefault('ST','TdiST_24',7,0,1,Self);
Add(preauthcd4List);
inscarrier5List :=TdiList.Create;
inscarrier5List.SetDefault('ST','TdiST_24',8,0,1,Self);
Add(inscarrier5List);
preauthcd5List :=TdiList.Create;
preauthcd5List.SetDefault('ST','TdiST_24',9,0,1,Self);
Add(preauthcd5List);
inscarrier6List :=TdiList.Create;
inscarrier6List.SetDefault('ST','TdiST_24',10,0,1,Self);
Add(inscarrier6List);
preauthcd6List :=TdiList.Create;
preauthcd6List.SetDefault('ST','TdiST_24',11,0,1,Self);
Add(preauthcd6List);
end;
function TdiZAU_24.Getinscarrier1: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(0,0));
end;
function TdiZAU_24.Getinscarrier2: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(1,0));
end;
function TdiZAU_24.Getinscarrier3: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(2,0));
end;
function TdiZAU_24.Getinscarrier4: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(3,0));
end;
function TdiZAU_24.Getinscarrier5: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(4,0));
end;
function TdiZAU_24.Getinscarrier6: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(5,0));
end;
function TdiZAU_24.Getpreauthcd1: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(6,0));
end;
function TdiZAU_24.Getpreauthcd2: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(7,0));
end;
function TdiZAU_24.Getpreauthcd3: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(8,0));
end;
function TdiZAU_24.Getpreauthcd4: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(9,0));
end;
function TdiZAU_24.Getpreauthcd5: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(10,0));
end;
function TdiZAU_24.Getpreauthcd6: TdiST_24;
begin
Result:= TdiST_24(GetRepByIndex(10,0));
end;
procedure TdiZAU_24.Setinscarrier1(const Value: TdiST_24);
begin
SetByIndex(0,0,Value);
end;
procedure TdiZAU_24.Setinscarrier2(const Value: TdiST_24);
begin
SetByIndex(1,0,Value);
end;
procedure TdiZAU_24.Setinscarrier3(const Value: TdiST_24);
begin
SetByIndex(2,0,Value);
end;
procedure TdiZAU_24.Setinscarrier4(const Value: TdiST_24);
begin
SetByIndex(3,0,Value);
end;
procedure TdiZAU_24.Setinscarrier5(const Value: TdiST_24);
begin
SetByIndex(4,0,Value);
end;
procedure TdiZAU_24.Setinscarrier6(const Value: TdiST_24);
begin
SetByIndex(5,0,Value);
end;
procedure TdiZAU_24.Setpreauthcd1(const Value: TdiST_24);
begin
SetByIndex(6,0,Value);
end;
procedure TdiZAU_24.Setpreauthcd2(const Value: TdiST_24);
begin
SetByIndex(7,0,Value);
end;
procedure TdiZAU_24.Setpreauthcd3(const Value: TdiST_24);
begin
SetByIndex(8,0,Value);
end;
procedure TdiZAU_24.Setpreauthcd4(const Value: TdiST_24);
begin
SetByIndex(9,0,Value);
end;
procedure TdiZAU_24.Setpreauthcd5(const Value: TdiST_24);
begin
SetByIndex(10,0,Value);
end;
procedure TdiZAU_24.Setpreauthcd6(const Value: TdiST_24);
begin
SetByIndex(11,0,Value);
end;
(You must define this segment)
Code: Select all
type
TdiZIN_24 = class(TdiSegment)
....
...
end;
Code: Select all
TdiZPI_Z01_24= class(TdiMessage)
private
MSHList:TdiSegmentList;
MSAList:TdiSegmentList;
ZAUList:TdiSegmentList;
PRDList:TdiSegmentList;
PIDList:TdiSegmentList;
IN1List:TdiSegmentList;
ZINList:TdiSegmentList;
protected
function GetIN1: TdiIN1_24;
function GetMSA: TdiMSA_24;
function GetMSH: TdiMSH_24;
function GetPID: TdiPID_24;
function GetPRD: TdiPRD_24;
function GetZAU: TdiZAU_24;
function GetZIN: TdiZIN_24;
procedure SetIN1(const Value: TdiIN1_24);
procedure SetMSA(const Value: TdiMSA_24);
procedure SetMSH(const Value: TdiMSH_24);
procedure SetPID(const Value: TdiPID_24);
procedure SetPRD(const Value: TdiPRD_24);
procedure SetZAU(const Value: TdiZAU_24);
procedure SetZIN(const Value: TdiZIN_24);
public
property MSH : TdiMSH_24 read GetMSH write SetMSH;
property MSA : TdiMSA_24 read GetMSA write SetMSA;
property ZAU : TdiZAU_24 read GetZAU write SetZAU;
property PRD : TdiPRD_24 read GetPRD write SetPRD;
property PID : TdiPID_24 read GetPID write SetPID;
property IN1 : TdiIN1_24 read GetIN1 write SetIN1;
property ZIN : TdiZIN_24 read GetZIN write SetZIN;
constructor Create; override;
end;
implementation
{ TdiZPI_Z01_24 }
constructor TdiZPI_Z01_24.Create;
begin
inherited;
Name :='ZPI_Z01';
MessageType :='ZPI';
TriggerEvent :='Z01';
HL7Version :='2.4';
MSHList:=TdiSegmentList.Create;
MSHList.SetDefault('MSH','TdiMSH_24',0,1,1,Self);
Add(MSHList);
MSAList:=TdiSegmentList.Create;
MSHList.SetDefault('MSA','TdiMSA_24',1,1,1,Self);
Add(MSAList);
ZAUList:=TdiSegmentList.Create;
ZAUList.SetDefault('ZAU','TdiZAU_24',2,0,1,Self);
Add(ZAUList);
PRDList:=TdiSegmentList.Create;
PRDList.SetDefault('PRD','TdiPRD_24',3,0,1,Self);
Add(PRDList);
PIDList:=TdiSegmentList.Create;
PIDList.SetDefault('PID','TdiPID_24',4,0,1,Self);
Add(PIDList);
IN1List:=TdiSegmentList.Create;
IN1List.SetDefault('IN1','TdiIN1_24',5,0,1,Self);
Add(IN1List);
ZINList:=TdiSegmentList.Create;
ZINList.SetDefault('ZIN','TdiZIN_24',6,0,1,Self);
Add(ZINList);
Parse(InitMsg);
end;
function TdiZPI_Z01_24.GetIN1: TdiIN1_24;
begin
Result:=TdiIN1_24(Find('IN1',0));
end;
function TdiZPI_Z01_24.GetMSA: TdiMSA_24;
begin
Result:=TdiMSA_24(Find('MSA',0));
end;
function TdiZPI_Z01_24.GetMSH: TdiMSH_24;
begin
Result:=TdiMSH_24(Find('MSH',0));
end;
function TdiZPI_Z01_24.GetPID: TdiPID_24;
begin
Result:=TdiPID_24(Find('PID',0));
end;
function TdiZPI_Z01_24.GetPRD: TdiPRD_24;
begin
Result:=TdiPRD_24(Find('PRD',0));
end;
function TdiZPI_Z01_24.GetZAU: TdiZAU_24;
begin
Result:=TdiZAU_24(Find('ZAU',0));
end;
function TdiZPI_Z01_24.GetZIN: TdiZIN_24;
begin
Result:=TdiZIN_24(Find('ZIN',0));
end;
procedure TdiZPI_Z01_24.SetIN1(const Value: TdiIN1_24);
begin
SetByName('IN1',0,Value);
end;
procedure TdiZPI_Z01_24.SetMSA(const Value: TdiMSA_24);
begin
SetByName('MSA',0,Value);
end;
procedure TdiZPI_Z01_24.SetMSH(const Value: TdiMSH_24);
begin
SetByName('MSH',0,Value);
end;
procedure TdiZPI_Z01_24.SetPID(const Value: TdiPID_24);
begin
SetByName('PID',0,Value);
end;
procedure TdiZPI_Z01_24.SetPRD(const Value: TdiPRD_24);
begin
SetByName('PRD',0,Value);
end;
procedure TdiZPI_Z01_24.SetZAU(const Value: TdiZAU_24);
begin
SetByName('ZAU',0,Value);
end;
procedure TdiZPI_Z01_24.SetZIN(const Value: TdiZIN_24);
begin
SetByName('ZIN',0,Value);
end;
-
- Posts: 11
- Joined: Thu Nov 24, 2011 5:20 pm
Re: "Unknown segment: ZAU"
ok correct segments were created "Zau" and "ZIN" also the message TdiZPI_Z01_24
containing MSH, MSA, Zau, PRD, PID, IN1, ZIN
When I type a message TdiZPI_Z01_24
msgParse: = TdiZPI_Z01_24.Create;
msgParse.PID.PatientID.ID.AsString: = '1234 ';
here works well until now when I add the following line:
msgParse.ZIN.ifcondition.AsString: = '3333 ';
or
msgParse.ZAU.inscarrier1.AsString: = '2222 ';
Throws the following error: Class not found or Class TdiZIN_24 TdiZAU_24 depends the order of the lines
containing MSH, MSA, Zau, PRD, PID, IN1, ZIN
When I type a message TdiZPI_Z01_24
msgParse: = TdiZPI_Z01_24.Create;
msgParse.PID.PatientID.ID.AsString: = '1234 ';
here works well until now when I add the following line:
msgParse.ZIN.ifcondition.AsString: = '3333 ';
or
msgParse.ZAU.inscarrier1.AsString: = '2222 ';
Throws the following error: Class not found or Class TdiZIN_24 TdiZAU_24 depends the order of the lines
-
- Posts: 11
- Joined: Thu Nov 24, 2011 5:20 pm
Re: "Unknown segment: ZAU"
doing other tests and it works well this way:
msgParse: = TdiZPI_Z01_24.Create;
msgParse.PID.PatientID.ID.AsString: = '1234 ';
zauParse: = TdiZAU_24.Create;
zauParse.inscarrier1.AsString: = '1234 ';
zinParse: = TdiZIN_24.Create;
zinParse.ifcondition.AsString: = 'Y';
{assign zin y zau}
msgParse.ZAU: = zauParse;
msgParse.ZIN: = zinParse;
the arm mensjes well with the new segments, now the big problem is when I want to parse a message with the new message type TdiZPI_Z01_24. Type the following:
msgParse.AsString := ''MSH...ZPI^Z01^ZPI_Z01...MSA...ZAU...PRD...PID...IN1...ZIN';
ERROR: Unknown Segment ZAU
segments must be initialized before or am I missing something?
thanks!!!
msgParse: = TdiZPI_Z01_24.Create;
msgParse.PID.PatientID.ID.AsString: = '1234 ';
zauParse: = TdiZAU_24.Create;
zauParse.inscarrier1.AsString: = '1234 ';
zinParse: = TdiZIN_24.Create;
zinParse.ifcondition.AsString: = 'Y';
{assign zin y zau}
msgParse.ZAU: = zauParse;
msgParse.ZIN: = zinParse;
the arm mensjes well with the new segments, now the big problem is when I want to parse a message with the new message type TdiZPI_Z01_24. Type the following:
msgParse.AsString := ''MSH...ZPI^Z01^ZPI_Z01...MSA...ZAU...PRD...PID...IN1...ZIN';
ERROR: Unknown Segment ZAU
segments must be initialized before or am I missing something?
thanks!!!
Who is online
Users browsing this forum: No registered users and 4 guests