Life is hard, and then you die
2007-08-31 06:18:04 UTC
We're trying to handle hl7 update messages, and these may contain hl7
null's (""). HAPI does not currently seem to handle them specially,
which leads to various problems, such as validation failures and
making it somewhat torturous to detect these nulls.
I've been trying to figure out what the best approach for handling
nulls would be, and came up with the following: add two methods to
Type, 'boolean isNull()' and 'void setNull(boolean)'. The parsers
would set the null-flag appropriately, and the encoders and verifier
would simiarly check the flag; setting the flag on instances that are
part of another composite type (as opposed to part of the segment
directly) would have no effect.
I've done a quick implmentation of this and it works reasonably well.
But I wanted to gather feedback on the approach before submitting a
patch. Is there a better alternative? What have others done? Have I
missed something?
TIA.
Cheers,
Ronald
null's (""). HAPI does not currently seem to handle them specially,
which leads to various problems, such as validation failures and
making it somewhat torturous to detect these nulls.
I've been trying to figure out what the best approach for handling
nulls would be, and came up with the following: add two methods to
Type, 'boolean isNull()' and 'void setNull(boolean)'. The parsers
would set the null-flag appropriately, and the encoders and verifier
would simiarly check the flag; setting the flag on instances that are
part of another composite type (as opposed to part of the segment
directly) would have no effect.
I've done a quick implmentation of this and it works reasonably well.
But I wanted to gather feedback on the approach before submitting a
patch. Is there a better alternative? What have others done? Have I
missed something?
TIA.
Cheers,
Ronald