procedure StripEmptyRepeats(ALeading : Boolean);
incredible as it may seem, some very large vendors send HL7 that contains empty repeats. This is often in contexts where the presence of non-empty repeats has meaning. This procedure will find and delete any repeats with empty content.
If a field is encoded as |content~content| then the repeat will stand. if the content is encode as any of the following:
etcthen the empty repeat will be deleted. This is not empty:
finally, regarding this situation:
|~Content|The first instance of the field (it's unclear whether this is usually called a "repeat") will be dropped and the content promoted in it's place if ALeading is true, and nothing will happen if ALeading is false