pear / net_hl7 Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://pear.php.net/package/Net_HL7
Home Page: http://pear.php.net/package/Net_HL7
PHP Fatal error: Uncaught Error: Call to undefined method Net_HL7_Connection::close()
in composer.json file:
"require": {
"pear/pear_exception": "*",
"pear/net_socket": "dev-trunk" //<-- instead of *
},
PHP Fatal error: Uncaught InvalidArgumentException: Name should be 3 characters, uppercase in Net/HL7/Segment.php:58
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.