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

Hl7InputStreamMessageStringIterator returns silently on non HL7 content #113

Open
kirupha2000 opened this issue Jan 4, 2024 · 0 comments

Comments

@kirupha2000
Copy link

When the Hl7InputStreamMessageStringIterator is used to read an input stream from a file containing non HL7 content, it returns silently without throwing an exception or erroring out.

Example code:

package com.example;

import ca.uhn.hl7v2.util.Hl7InputStreamMessageStringIterator;

import java.io.FileInputStream;

public class HL7FileRead {
    public static void main(String[] args) {
        try {
            FileInputStream fis = new FileInputStream("<filepath>");
            Hl7InputStreamMessageStringIterator it = new Hl7InputStreamMessageStringIterator(fis);
            while (it.hasNext()) {
                String msg = it.next();
                System.out.println(msg);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Say the file contains the following content

{ 
    "abc":"def"
}

The program will exit silently without throwing any exceptions or errors.

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

No branches or pull requests

1 participant