Giter VIP home page Giter VIP logo

net_hl7's Issues

$conn->close();

PHP Fatal error: Uncaught Error: Call to undefined method Net_HL7_Connection::close()

Error while receiving ACK

PHP Fatal error: Uncaught InvalidArgumentException: Name should be 3 characters, uppercase in Net/HL7/Segment.php:58

Message parsing does not preserve empty components

Using Net_HL7_Message($string), if a segment contains a field that has empty components, those empty components are removed when the string is parsed. For example:

$msgstr = 'MSH|^~\&|SOME_SOURCE||||20180723115125||DFT^P03|2018072311512590201|P|2.2||||NE|' . "\n" .
'PV1|1|POFFV|723327^^^SLM^^^^^^^DEPID|3|||16367^LAST^FIRST^^^^^^EPROV^^^^PROVID|||||||2|||||300023352295|SELF||||||||||||||||||||||||20180123152601||||||100000000375|';

$msg = new Net_HL7_Message($msgstr);
error_log ($msg->toString(true));

results in:

MSH|^~\&|SOME_SOURCE||||20180723115125||DFT^P03|2018072311512590201|P|2.2||||NE|
PV1|1|POFFV|723327^SLM^DEPID|3|||16367^LAST^FIRST^EPROV^PROVID|||||||2|||||300023352295|SELF||||||||||||||||||||||||20180123152601||||||100000000375|

The problem seems to stem from line 165 in Message.php:

$comps = preg_split("/\\" . $this->_componentSeparator ."/", $fields[$j], -1, PREG_SPLIT_NO_EMPTY);

The PREG_SPLIT_NO_EMPTY flag should not be present, I believe.

Response takes too long

When sending a message, the response takes about half a minute.

I tracked down the cause:
In the Net_HL7_Connection class, the send function iteratively reads 256 byte from the socket file pointer at once, until the message suffix is detected. But the last read operation takes very long.
I think it is, because the last buffer may not be filled completely up to 256 bytes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.