Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value "present but null" vs Empty #28

Closed
Aaron-P opened this issue Dec 11, 2018 · 4 comments
Closed

Value "present but null" vs Empty #28

Aaron-P opened this issue Dec 11, 2018 · 4 comments
Labels

Comments

@Aaron-P
Copy link

Aaron-P commented Dec 11, 2018

In HL7 section 2.5.3.0, Field or Component Status, it specifies that a field value of "" (e.g. |""|) is considered to be a null value and should not be used for any other purpose. In the parser, a field value of "" is returned as a string value of 2 double quotes, not a null string value.

@jaime-olivares
Copy link

That's a very weird one. I will review it soon.

@jaime-olivares
Copy link

Please provide a code snippet to demonstrate that behavior

@Aaron-P
Copy link
Author

Aaron-P commented Dec 17, 2018

namespace Test
{
    internal class Program
    {
        public const string SampleMessage = @"MSH|^~\&|SENDING_APPLICATION|SENDING_FACILITY|RECEIVING_APPLICATION|RECEIVING_FACILITY|20110613083617||ADT^A04|934576120110613083617|P|2.7||||
EVN|A04|20110613083617||""""";

        private static void Main(string[] args)
        {
            var message = new Message(SampleMessage);
            message.ParseMessage();
            var evn = message.Segments("EVN")[0];

            var expectEmpty = evn.Fields(3).Value;
            Debug.Assert(expectEmpty == string.Empty);
            var expectNull = evn.Fields(4).Value;
            Debug.Assert(expectNull == null);
        }
    }
}

@jaime-olivares
Copy link

jaime-olivares commented Dec 23, 2018

Solved. Unit test added. Readme section added.
Published to NuGet as 2.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants