19.1.20. camcops_server.cc_modules.cc_hl7¶
Copyright (C) 2012-2018 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CamCOPS.
CamCOPS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
CamCOPS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with CamCOPS. If not, see <http://www.gnu.org/licenses/>.
-
class
camcops_server.cc_modules.cc_hl7.
HL7Message
(task=None, recipient_def=None, hl7run=None, show_queue_only=False)[source]¶ -
-
make_hl7_message
(req: camcops_server.cc_modules.cc_request.CamcopsRequest) → None[source]¶ Stores HL7 message in self.msg.
May also store it in self.message (which is saved to the database), if we’re saving HL7 messages.
-
send
(req: camcops_server.cc_modules.cc_request.CamcopsRequest, queue_file: TextIO = None, divert_file: TextIO = None) → Tuple[bool, bool][source]¶ Send an outbound HL7/file message, by the appropriate method.
-
-
class
camcops_server.cc_modules.cc_hl7.
HL7Run
(recipdef=None, *args, **kwargs)[source]¶ Class representing an HL7/file run for a specific recipient.
May be associated with multiple HL7/file messages.
-
class
camcops_server.cc_modules.cc_hl7.
MLLPTimeoutClient
(host: str, port: int, timeout_ms: int = None)[source]¶ Class for MLLP TCP/IP transmission that implements timeouts.
-
camcops_server.cc_modules.cc_hl7.
make_sure_path_exists
(path: str) → None[source]¶ Creates a directory/directories if the path doesn’t already exist.
-
camcops_server.cc_modules.cc_hl7.
send_all_pending_hl7_messages
(cfg: camcops_server.cc_modules.cc_config.CamcopsConfig, show_queue_only: bool = False) → None[source]¶ Sends all pending HL7 or file messages.
Obtains a file lock, then iterates through all recipients.
-
camcops_server.cc_modules.cc_hl7.
send_pending_hl7_messages
(req: camcops_server.cc_modules.cc_request.CamcopsRequest, recipient_def: camcops_server.cc_modules.cc_recipdef.RecipientDefinition, show_queue_only: bool, queue_stdout: TextIO) → None[source]¶ Pings recipient if necessary, opens any files required, creates an HL7Run, then sends all pending HL7/file messages to a specific recipient.
-
camcops_server.cc_modules.cc_hl7.
send_pending_hl7_messages_2
(req: camcops_server.cc_modules.cc_request.CamcopsRequest, recipient_def: camcops_server.cc_modules.cc_recipdef.RecipientDefinition, show_queue_only: bool, queue_stdout: TextIO, hl7run: camcops_server.cc_modules.cc_hl7.HL7Run, divert_file: Union[TextIO, NoneType]) → None[source]¶ Sends all pending HL7/file messages to a specific recipient.
Also called once per recipient, but after diversion files safely opened and recipient pinged successfully (if desired).