Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Nested Nested Group example (Just giving back to the community.)

2 posts in General Discussion Last posting was on 2009-03-25 15:22:43.0Z
Donnovan Knight Posted on 2009-03-25 14:35:57.0Z
Sender: 604f.49c8d5fa.1804289383@sybase.com
From: Donnovan Knight
Newsgroups: sybase.public.impact
Subject: Nested Nested Group example (Just giving back to the community.)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49ca414d.1b57.1681692777@sybase.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="-=_forums-1-dub49ca414d"
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 25 Mar 2009 06:35:57 -0800
X-Trace: forums-1-dub 1237991757 10.22.241.41 (25 Mar 2009 06:35:57 -0800)
X-Original-Trace: 25 Mar 2009 06:35:57 -0800, 10.22.241.41
Lines: 1443
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.impact:2175
Article PK: 230253

I'm posting a project example of an HL7 message that deals
with nested nested groups. This has been something that I
had work arounds for and never could get a sound solution.

I believe the project that is attached is a good example of
dealing with nested groups in general. It seems to scale and
also is capable of handling undefined segments in the middle
of groups.

I can't warrant the project will work perfectly, but I
haven't been able to break this version. If you discover any
problems with it please let me know.

Everything is defined in a certain fashion so read the
document if something isn't clear, please don't knock the
document that isn't my strong suit. Also, test your changes
if you think something should be done differently.

This project is the culmination of probably 100+ hours
between me and my co-worker Mike Rhoads. I also needed some
help from Sybase and once I figured out how to apply what
they said I was missing everything fell into place.

Any questions or comments can be emailed to me at:
donnovan.knight@samcstl.org

I know how frustrating groups can be and I hope this will
help those just learning or even people who still haven't
found a good solution.

Thanks,

Donnovan Knight
St. Anthony's Medical Center
St. Louis, MO

donnovan.knight@samcstl.org

module hl7_group_example

static changelog( blob *pb, char mode, string args );

static object PID_Header_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoRedef = 1;
RsFoSepRef = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_in_fld;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFparentRef = PID_in_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object OBR_grp_master_Not_Missing_qual : clQual
{ arguments
{
RsQoFld = 1;
RsQoFldLit = 1;
RsQoFldSrc = 1;
RsRef = OBR_grp_master_fld;
RsQop = 8;
};
};

static object NTE_for_OBR_grp : clPart
{ arguments
{
RsPoTbl = 1;
RsRef = NTE_for_OBR_grp_master_fld;
RsGrpRule = NTE_for_OBR_rule;
};
};

static object NTE_for_OBX_in_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = NTE_for_OBX_in_fld;
};
};

static object NTE_for_OBX_SegmentSeparator_rc : clPart
{ arguments
{
RsPoLit = 1;
RsLit = "\015";
};
};

static object modPattern_CRSI_To_CR_filt : clFilter
{ arguments
{
RsFunc = modPattern;
RsArgs = "\015\017|\015";
RsBuiltin = 1;
};
};

static object PID_in_Not_Missing_qual : clQual
{ arguments
{
RsQoFld = 1;
RsQoFldLit = 1;
RsQoFldSrc = 1;
RsRef = PID_in_fld;
RsQop = 8;
};
};

static object NTE_for_OBX_grp : clPart
{ arguments
{
RsPoTbl = 1;
RsRef = NTE_for_OBX_grp_master_fld;
RsGrpRule = NTE_for_OBX_rule;
};
};

static object NTE_for_OBX_Header_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoRedef = 1;
RsFoMember = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = NTE_for_OBX_in_fld;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFtblRef = NTE_for_OBX_grp_master_fld;
RsFparentRef = NTE_for_OBX_in_fld;
RsFoper = 3;
RsFIsAParent = 1;
RsFoSepRefFldSrc = 1;
};
};

static object OBR_Header_in : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoRedef = 1;
RsFoMember = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = OBR_in_fld;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFtblRef = OBR_grp_master_fld;
RsFparentRef = OBR_in_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object OBR_FieldSeparator_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = MSH_1_FieldSeparator_fld;
};
};

static object OBR_Header_rc : clPart
{ arguments
{
RsPoLit = 1;
RsLit = "OBR";
};
};

static object modPattern_CR_To_CRSI_filt : clFilter
{ arguments
{
RsFunc = modPattern;
RsArgs = "\015|\015\017";
RsBuiltin = 1;
};
};

static object OBX_SegmentSeparator_rc : clPart
{ arguments
{
RsPoLit = 1;
RsLit = "\015";
};
};

static object OBR_rule : clRule
{ arguments
{
RsFldGrp = OBR_grp_master_fld;
};
controls
{
clPart OBR_in_rc;
clPart Segment_Separator_rc;
clPart NTE_for_OBR_grp;
clPart OBX_grp;
clQual OBR_grp_master_Not_Missing_qual;
};
};

static object OBR_in_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = OBR_in_fld;
};
};

static object OBX_NTE_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoMember = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoPatSep = 1;
RsFoOffPat = 1;
RsFoOptional = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFtblRef = OBX_grp_master_fld;
RsFparentRef = OBX_grp_master_fld;
RsFpattern = "\015\017OBX";
RsFdelineator = "\015\012";
RsFoffPattern = "\017OBX";
RsFoper = 3;
RsPatScopePat = "\015\017OBR\015\012\015\017OBX\015\012\015\017Z";
RsFIsAParent = 1;
};
};

static object OBX_Header_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoMember = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFtblRef = OBX_grp_master_fld;
RsFparentRef = OBX_in_fld;
RsFoffPattern = "\017OBX";
RsFoper = 3;
RsFIsAParent = 1;
RsFoSepRefFldSrc = 1;
};
};

static object OBX_rule : clRule
{ arguments
{
RsFldGrp = OBX_grp_master_fld;
};
controls
{
clPart OBX_in_rc;
clPart OBX_SegmentSeparator_rc;
clPart NTE_for_OBX_grp;
clQual OBX_grp_master_Not_Missing_qual;
};
};

static object OBX_in_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = OBX_in_fld;
};
controls
{
clQual OBX_grp_master_Not_Missing_qual;
};
};

static object OBX_grp : clPart
{ arguments
{
RsPoTbl = 1;
RsRef = OBX_grp_master_fld;
RsGrpRule = OBX_rule;
};
};

static object OBX_in_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoMember = 1;
RsFoSep = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoOptional = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFsep = '\015';
RsFtblRef = OBX_grp_master_fld;
RsFparentRef = OBX_NTE_fld;
RsFoffPattern = "\017OBX";
RsFoper = 3;
RsPatScopePat = "\015\017OBR\015\012\015\017NTE\015\012\015\017Z";
RsFIsAParent = 1;
};
};

static object PV1_rule : clRule
{ controls
{
clPart PV1_Header_rc;
clPart MSH_1_FieldSeparator_rc;
};
};

static object PV1_Header_rc : clPart
{ arguments
{
RsPoLit = 1;
RsLit = "PV1";
};
};

static object OBR_grp_master_fld : clTrFld
{ arguments
{
RsFtTBL = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_in_fld;
RsFparentRef = WholeMessage_in_fld;
RsFoffPattern = "\017OBR";
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object OBX_grp_master_fld : clTrFld
{ arguments
{
RsFtTBL = 1;
RsFoMember = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoOptional = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFtblRef = OBR_grp_master_fld;
RsFparentRef = OBR_NTE_OBX_fld;
RsFoffPattern = "\017OBX";
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object OBX_NTE_CR_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoMember = 1;
RsFoSep = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFsep = '\015';
RsFlocRef = OBX_NTE_fld;
RsFtblRef = OBX_grp_master_fld;
RsFparentRef = OBX_grp_master_fld;
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object MSH_in_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoMultiSep = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFparentRef = WholeMessage_in_fld;
RsFoffPattern = "MSH";
RsFoper = 3;
RsFmultiSep = "CR";
RsFoPscopeSiz = 1;
RsPatScope = 3;
RsFIsAParent = 1;
};
};

static object PID_rule : clRule
{ controls
{
clPart PID_Header_rc;
clPart MSH_1_FieldSeparator_rc;
clPart PID_1_SetIDPatientID_rc;
clPart MSH_1_FieldSeparator_rc;
clPart PID_2_PatientIDExternalID_rc;
clPart MSH_1_FieldSeparator_rc;
clQual PID_in_Not_Missing_qual;
};
controls(2)
{
clFilter Segment_Separator_filt;
};
};

static object PID_1_SetIDPatientID_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = PID_1_SetIDPatientID_fld;
};
};

static object PID_3_PatientIDInternalID_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = PID_3_PatientIDInternalID_fld;
};
};

static object PID_Header_rc : clPart
{ arguments
{
RsPoLit = 1;
RsLit = "PID";
};
};

static object PID_2_PatientIDExternalID_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = PID_2_PatientIDExternalID_fld;
};
};

static object PID_4_AlternatePatientID_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = PID_4_AlternatePatientID_fld;
};
};

static object PID_1_SetIDPatientID_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_Header_fld;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFparentRef = PID_in_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object PID_3_1_IDNumber_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoRedef = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_3_PatientIDInternalID_fld;
RsFsepRef = MSH_2_1_ComponentSeparator_fld;
RsFparentRef = PID_3_PatientIDInternalID_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object PID_4_AlternatePatientID_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_3_PatientIDInternalID_fld;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFparentRef = PID_in_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object PID_in_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoMultiSep = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = MSH_in_fld;
RsFparentRef = WholeMessage_in_fld;
RsFoffPattern = "\017PID";
RsFoper = 3;
RsFmultiSep = "CR";
RsFIsAParent = 1;
};
};

static object MSH_rule : clRule
{ controls
{
clPart MSH_Header_rc;
clPart MSH_1_FieldSeparator_rc;
clPart MSH_2_1_ComponentSeparator_rc;
clPart MSH_2_2_RepetitionSeparator_rc;
clPart MSH_2_3_EscapeCharacter_rc;
clPart MSH_2_4_SubcomponentSeparator_rc;
clPart MSH_1_FieldSeparator_rc;
};
controls(2)
{
clFilter Segment_Separator_filt;
};
};

static object MSH_2_4_SubcomponentSeparator_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = MSH_2_4_SubComponentSeparator_fld;
};
};

static object MSH_2_2_RepetitionSeparator_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = MSH_2_2_RepetitionSeparator_fld;
};
};

static object MSH_Header_rc : clPart
{ arguments
{
RsPoLit = 1;
RsLit = "MSH";
};
};

static object MSH_1_FieldSeparator_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = MSH_1_FieldSeparator_fld;
};
};

static object PID_3_3_CheckDigitScheme_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_3_2_CheckDigit_fld;
RsFsepRef = MSH_2_1_ComponentSeparator_fld;
RsFparentRef = PID_3_PatientIDInternalID_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object PID_3_2_CheckDigit_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_3_1_IDNumber_fld;
RsFsepRef = MSH_2_1_ComponentSeparator_fld;
RsFparentRef = PID_3_PatientIDInternalID_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object PID_3_4_AssigningFacilityID_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_3_3_CheckDigitScheme_fld;
RsFsepRef = MSH_2_1_ComponentSeparator_fld;
RsFparentRef = PID_3_PatientIDInternalID_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object PID_3_PatientIDInternalID_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_2_PatientIDExternalID_fld;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFparentRef = PID_in_fld;
RsFoper = 3;
RsFIsAParent = 1;
RsFoSepRefFldSrc = 1;
};
};

static object PID_2_3_CheckDigitScheme_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_2_2_CheckDigit_fld;
RsFsepRef = MSH_2_1_ComponentSeparator_fld;
RsFparentRef = PID_2_PatientIDExternalID_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object PID_2_2_CheckDigit_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_2_1_IDNumber_fld;
RsFsepRef = MSH_2_1_ComponentSeparator_fld;
RsFparentRef = PID_2_PatientIDExternalID_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object PID_2_4_AssigningFacilityID_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_2_3_CheckDigitScheme_fld;
RsFsepRef = MSH_2_1_ComponentSeparator_fld;
RsFparentRef = PID_2_PatientIDExternalID_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object MSH_2_3_EscapeCharacter_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = MSH_2_3_EscapeCharacter_fld;
};
};

static object MSH_2_1_ComponentSeparator_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = MSH_2_1_ComponentSeparator_fld;
};
};

static object Segment_Separator_filt : clFilter
{ arguments
{
RsFunc = asciiCtl;
RsArgs = "CR";
RsBuiltin = 1;
};
};

static object MSH_2_4_SubComponentSeparator_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoAbsLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFlen = 1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = MSH_2_3_EscapeCharacter_fld;
RsFparentRef = MSH_2_EncodingCharacters_fld;
RsFoper = 3;
RsFoPscopeSiz = 1;
};
controls
{
clFilter modPattern_CR_To_CRSI_filt;
};
};

static object MSH_2_2_RepetitionSeparator_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoAbsLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFlen = 1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = MSH_2_1_ComponentSeparator_fld;
RsFparentRef = MSH_2_EncodingCharacters_fld;
RsFoper = 3;
RsFoPscopeSiz = 1;
};
};

static object MSH_Header_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoRedef = 1;
RsFoAbsLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFlen = 3;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = MSH_in_fld;
RsFparentRef = MSH_in_fld;
RsFoper = 3;
RsFoPscopeSiz = 1;
};
};

static object MSH_1_FieldSeparator_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoAbsLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFlen = 1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = MSH_Header_fld;
RsFparentRef = MSH_in_fld;
RsFoper = 3;
RsFoPscopeSiz = 1;
};
};

static object MSH_2_3_EscapeCharacter_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoAbsLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFlen = 1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = MSH_2_2_RepetitionSeparator_fld;
RsFparentRef = MSH_2_EncodingCharacters_fld;
RsFoper = 3;
RsFoPscopeSiz = 1;
};
};

static object MSH_2_EncodingCharacters_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = MSH_1_FieldSeparator_fld;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFparentRef = MSH_in_fld;
RsFoper = 3;
RsFoPscopeSiz = 1;
RsFIsAParent = 1;
RsFoSepRefFldSrc = 1;
};
};

static object MSH_2_1_ComponentSeparator_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoRedef = 1;
RsFoAbsLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFlen = 1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = MSH_2_EncodingCharacters_fld;
RsFparentRef = MSH_2_EncodingCharacters_fld;
RsFoper = 3;
RsFoPscopeSiz = 1;
};
};

static object group_example : clTran
{ arguments
{
RsOpts = 144;
RsName = "group_example";
RsDesc = "This is an example of an HL7 nested nested group. One part of the solution is to replace the CR with CR (octal 015) and SI (octal 017) characters as a Pre Filter. Once, everything is done you just have to convert the CR/SI back to CR with a Post Filter. The SI character could be replaced with any other character that doesn't usually appear in your messages.\015\012\015\012Donnovan Knight\015\012email: donnovan.knight@samcstl.org\015\012\015\012St. Anthony's Medical Center\015\012St. Louis, MO\015\0122009/03/23";
RsEoCancel = 1;
RsMode = 1;
};
controls
{
clTrFld WholeMessage_in_fld;
clTrFld MSH_in_fld;
clTrFld MSH_Header_fld;
clTrFld MSH_1_FieldSeparator_fld;
clTrFld MSH_2_EncodingCharacters_fld;
clTrFld MSH_2_1_ComponentSeparator_fld;
clTrFld MSH_2_2_RepetitionSeparator_fld;
clTrFld MSH_2_3_EscapeCharacter_fld;
clTrFld MSH_2_4_SubComponentSeparator_fld;
clTrFld PID_in_fld;
clTrFld PID_Header_fld;
clTrFld PID_1_SetIDPatientID_fld;
clTrFld PID_2_PatientIDExternalID_fld;
clTrFld PID_2_1_IDNumber_fld;
clTrFld PID_2_2_CheckDigit_fld;
clTrFld PID_2_3_CheckDigitScheme_fld;
clTrFld PID_2_4_AssigningFacilityID_fld;
clTrFld PID_3_PatientIDInternalID_fld;
clTrFld PID_3_1_IDNumber_fld;
clTrFld PID_3_2_CheckDigit_fld;
clTrFld PID_3_3_CheckDigitScheme_fld;
clTrFld PID_3_4_AssigningFacilityID_fld;
clTrFld PID_4_AlternatePatientID_fld;
clTrFld OBR_grp_master_fld;
clTrFld OBR_NTE_OBX_fld;
clTrFld OBR_in_fld;
clTrFld OBR_Header_in;
clTrFld NTE_for_OBR_grp_master_fld;
clTrFld NTE_for_OBR_fld;
clTrFld NTE_for_OBR_in_fld;
clTrFld NTE_for_OBR_Header_fld;
clTrFld NTE_for_OBR_CR_fld;
clTrFld OBX_grp_master_fld;
clTrFld OBX_NTE_fld;
clTrFld OBX_in_fld;
clTrFld OBX_Header_fld;
clTrFld NTE_for_OBX_grp_master_fld;
clTrFld NTE_for_OBX_fld;
clTrFld NTE_for_OBX_in_fld;
clTrFld NTE_for_OBX_Header_fld;
clTrFld NTE_for_OBX_CR_fld;
clTrFld OBX_NTE_CR_fld;
clTrFld OBR_NTE_OBX_CR_fld;
clRule MSH_rule;
clRule PID_rule;
clRule OBR_rule;
clFilter modPattern_CR_To_CRSI_filt;
};
controls(2)
{
clFilter modPattern_CRSI_To_CR_filt;
};
};

static object Segment_Separator_rc : clPart
{ arguments
{
RsPoLit = 1;
RsLit = "\015";
};
};

static object WholeMessage_in_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAbs = 1;
RsFoEORLen = 1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object OBR_NTE_OBX_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoMember = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoPatSep = 1;
RsFoOffPat = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFtblRef = OBR_grp_master_fld;
RsFparentRef = OBR_grp_master_fld;
RsFpattern = "\015\017OBR";
RsFdelineator = "\015\012";
RsFoffPattern = "\017OBR";
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object OBR_in_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoMember = 1;
RsFoSep = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFsep = '\015';
RsFtblRef = OBR_grp_master_fld;
RsFparentRef = OBR_NTE_OBX_fld;
RsFoffPattern = "\017OBR";
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object NTE_for_OBR_grp_master_fld : clTrFld
{ arguments
{
RsFtTBL = 1;
RsFoMember = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoPatSep = 1;
RsFoOffPat = 1;
RsFoOptional = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = OBR_in_fld;
RsFtblRef = OBR_grp_master_fld;
RsFparentRef = OBR_NTE_OBX_fld;
RsFpattern = "\015\017OBX";
RsFdelineator = "\015\012";
RsFoffPattern = "\017NTE";
RsFoper = 3;
RsFoPscopePat = 1;
RsPatScope = 5;
RsPatScopePat = "\015\017OBX";
RsFIsAParent = 1;
};
};

static object NTE_for_OBX_grp_master_fld : clTrFld
{ arguments
{
RsFtTBL = 1;
RsFoMember = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoOptional = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = OBX_in_fld;
RsFtblRef = OBX_grp_master_fld;
RsFparentRef = OBX_NTE_fld;
RsFoffPattern = "\017NTE";
RsFoper = 3;
RsPatScopePat = "\015\017OBX\015\012\015\017OBR";
RsFIsAParent = 1;
};
};

static object NTE_for_OBR_rule : clRule
{ arguments
{
RsFldGrp = NTE_for_OBR_grp_master_fld;
};
controls
{
clPart NTE_for_OBR_in_rc;
clPart NTE_for_OBR_SegmentSeparator_rc;
clQual NTE_for_OBR_grp_Not_Missing_qual;
};
};

static object NTE_for_OBX_in_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoMember = 1;
RsFoSep = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoOptional = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFsep = '\015';
RsFtblRef = NTE_for_OBX_grp_master_fld;
RsFparentRef = NTE_for_OBX_fld;
RsFoffPattern = "\017NTE";
RsFoper = 3;
RsPatScopePat = "\015\017OBR\015\012\015\017OBX\015\012\015\017Z";
RsFIsAParent = 1;
};
};

static object NTE_for_OBR_Header_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoRedef = 1;
RsFoMember = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = NTE_for_OBR_in_fld;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFtblRef = NTE_for_OBR_grp_master_fld;
RsFparentRef = NTE_for_OBR_in_fld;
RsFoper = 3;
RsPatScope = 5;
RsFIsAParent = 1;
RsFoSepRefFldSrc = 1;
};
};

static object NTE_OBR_Segment_Separator_rc : clPart
{ arguments
{
RsPoLit = 1;
RsLit = "\015";
};
};

static object NTE_for_OBR_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoMember = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoPatSep = 1;
RsFoOffPat = 1;
RsFoOptional = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFtblRef = NTE_for_OBR_grp_master_fld;
RsFparentRef = NTE_for_OBR_grp_master_fld;
RsFpattern = "\015\017NTE";
RsFdelineator = "\015\012";
RsFoffPattern = "\017NTE";
RsFoper = 3;
RsPatScopePat = "\015\017OBR\015\012\015\017OBX";
RsFIsAParent = 1;
};
};

static object NTE_for_OBR_in_rc : clPart
{ arguments
{
RsPoFld = 1;
RsRef = NTE_for_OBR_in_fld;
};
};

static object NTE_for_OBR_SegmentSeparator_rc : clPart
{ arguments
{
RsPoLit = 1;
RsLit = "\015";
};
};

static object OBX_grp_master_Not_Missing_qual : clQual
{ arguments
{
RsQoFld = 1;
RsQoFldLit = 1;
RsQoFldSrc = 1;
RsRef = OBX_grp_master_fld;
RsQop = 8;
};
};

static object NTE_for_OBX_grp_Not_Missing_qual : clQual
{ arguments
{
RsQoFld = 1;
RsQoFldLit = 1;
RsQoFldSrc = 1;
RsRef = NTE_for_OBX_grp_master_fld;
RsQop = 8;
};
};

static object NTE_for_OBR_CR_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoMember = 1;
RsFoSep = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFsep = '\015';
RsFlocRef = NTE_for_OBR_fld;
RsFtblRef = NTE_for_OBR_grp_master_fld;
RsFparentRef = NTE_for_OBR_grp_master_fld;
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object NTE_for_OBR_grp_Not_Missing_qual : clQual
{ arguments
{
RsQoFld = 1;
RsQoFldLit = 1;
RsQoFldSrc = 1;
RsRef = NTE_for_OBR_grp_master_fld;
RsQop = 8;
};
};

static object NTE_for_OBR_in_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoMember = 1;
RsFoSep = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOffPat = 1;
RsFoOptional = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFsep = '\015';
RsFtblRef = NTE_for_OBR_grp_master_fld;
RsFparentRef = NTE_for_OBR_fld;
RsFoffPattern = "\017NTE";
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object PID_2_1_IDNumber_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoRedef = 1;
RsFoSepRef = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_2_PatientIDExternalID_fld;
RsFsepRef = MSH_2_1_ComponentSeparator_fld;
RsFparentRef = PID_2_PatientIDExternalID_fld;
RsFoper = 3;
RsFoSepRefFldSrc = 1;
};
};

static object PID_2_PatientIDExternalID_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoSepRef = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFlocRef = PID_1_SetIDPatientID_fld;
RsFsepRef = MSH_1_FieldSeparator_fld;
RsFparentRef = PID_in_fld;
RsFoper = 3;
RsFIsAParent = 1;
RsFoSepRefFldSrc = 1;
};
};

static object OBR_NTE_OBX_CR_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoMember = 1;
RsFoSep = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFsep = '\015';
RsFlocRef = OBR_NTE_OBX_fld;
RsFtblRef = OBR_grp_master_fld;
RsFparentRef = OBR_grp_master_fld;
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object NTE_for_OBX_rule : clRule
{ arguments
{
RsFldGrp = NTE_for_OBX_grp_master_fld;
};
controls
{
clPart NTE_for_OBX_in_rc;
clPart NTE_for_OBX_SegmentSeparator_rc;
clQual NTE_for_OBX_grp_Not_Missing_qual;
};
};

static object NTE_for_OBX_CR_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoAfter = 1;
RsFoMember = 1;
RsFoSep = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoOptional = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFsep = '\015';
RsFlocRef = NTE_for_OBX_fld;
RsFtblRef = NTE_for_OBX_grp_master_fld;
RsFparentRef = NTE_for_OBX_grp_master_fld;
RsFoper = 3;
RsFIsAParent = 1;
};
};

static object NTE_for_OBX_fld : clTrFld
{ arguments
{
RsFtFLD = 1;
RsFoMember = 1;
RsFoEORLen = 1;
RsFoSubfld = 1;
RsFoPatSep = 1;
RsFoOffPat = 1;
RsFoOptional = 1;
RsFoInclSep = 1;
RsFoff = -1;
RsFtRaw = 1;
RsFtX = 1;
RsFcASCI = 1;
RsFtblRef = NTE_for_OBX_grp_master_fld;
RsFparentRef = NTE_for_OBX_grp_master_fld;
RsFpattern = "\015\017NTE";
RsFdelineator = "\015\012";
RsFoffPattern = "\017NTE";
RsFoper = 3;
RsFIsAParent = 1;
};
};
static int changelog(blob *pb, char mode, string args)
{/*
Created By:
Date Created:

Purpose:

Process:

Requestor:
Ticket#:

Modified
---------------------------------------------------------------------
Date Modified:
Modified By:
Change:
Requestor:
Ticket#:
---------------------------------------------------------------------
Date Modified:
Modified By:
Change:
Requestor:
Ticket#:
---------------------------------------------------------------------
Date Modified:
Modified By:
Change:
Requestor:
Ticket#:
---------------------------------------------------------------------
Date Modified:
Modified By:
Change:
Requestor:
Ticket#:






*/

return 1;
}

end module;

#dll lib1 "cltran.dll"
#dll lib2 "cltrnide.dll"
#dll lib3 "clfile.dll"
#dll lib4 "clmtbl.dll"
#dll lib5 "clrepo.dll"
#dll lib6 "clutil.dll"
#dll lib7 "cldbi.dll"
#dll lib8 "cltdmsql.dll"
#dll lib9 "cltbl.dll"
#dll lib10 "clproto.dll"
#include "hl7_group_example.mod"


Donnovan Knight Posted on 2009-03-25 15:22:43.0Z
Sender: 604f.49c8d5fa.1804289383@sybase.com
From: Donnovan Knight
Newsgroups: sybase.public.impact
Subject: Re: Nested Nested Group example (Just giving back to the community.)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49ca4c43.1cdd.1681692777@sybase.com>
References: <49ca414d.1b57.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 25 Mar 2009 07:22:43 -0800
X-Trace: forums-1-dub 1237994563 10.22.241.41 (25 Mar 2009 07:22:43 -0800)
X-Original-Trace: 25 Mar 2009 07:22:43 -0800, 10.22.241.41
Lines: 6
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.impact:2176
Article PK: 230251

Also, this was created in Tran-IDE 5.5 for e-Biz Impact
version 5.5. I'm not sure if the projects can be used in
previous versions, I've never attempted to go backwards. But
I expect the logic would work the same.

-Donnovan