15.2.118. camcops_server.cc_modules.cc_exportrecipientinfo¶
camcops_server/cc_modules/cc_exportrecipient.py
Copyright (C) 2012, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
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 <https://www.gnu.org/licenses/>.
ExportRecipientInfo class.
The purpose of this is to capture information without using an SQLAlchemy
class. The camcops_server.cc_modules.cc_config.CamcopsConfig
class
uses this, as it needs to be readable in the absence of a database connection
(q.v.).
- class camcops_server.cc_modules.cc_exportrecipientinfo.ExportRecipientInfo(other: Optional[camcops_server.cc_modules.cc_exportrecipientinfo.ExportRecipientInfo] = None)[source]¶
Class representing an export recipient, that is not an SQLAlchemy ORM object.
This has an unfortunate close relationship with
camcops_server.cc_modules.cc_exportrecipient.ExportRecipient
(q.v.).Full details of parameters are in the docs for the config file.
- __init__(other: Optional[camcops_server.cc_modules.cc_exportrecipientinfo.ExportRecipientInfo] = None) None [source]¶
Initializes, optionally copying attributes from
other
.
- classmethod create_dummy_recipient() camcops_server.cc_modules.cc_exportrecipientinfo.ExportRecipientInfo [source]¶
Creates and returns a dummy
ExportRecipientInfo
.
- get_filename(req: CamcopsRequest, task: Task, override_task_format: str = '') str [source]¶
Get the export filename, for file transfers.
- static get_hl7_id_aa(req: CamcopsRequest, which_idnum: int) str [source]¶
Get the HL7 Assigning Authority for a specific CamCOPS ID number type.
- static get_hl7_id_type(req: CamcopsRequest, which_idnum: int) str [source]¶
Get the HL7 ID type for a specific CamCOPS ID number type.
- is_incremental() bool [source]¶
Is this an incremental export? (That’s the norm, except for database exports.)
- classmethod read_from_config(cfg: CamcopsConfig, parser: configparser.ConfigParser, recipient_name: str) ExportRecipientInfo [source]¶
Reads from the config file and writes this instance’s attributes.
- Parameters
parser – configparser INI file object
recipient_name – name of recipient and of INI file section
- Returns
an
ExportRecipient
object, which is not currently in a database session
- validate_db_dependent(req: CamcopsRequest) None [source]¶
Validates the database-dependent aspects of the
ExportRecipient
, or raisesInvalidExportRecipient
.validate_db_independent()
should have been called first; this function presumes that those checks have been passed.- Parameters
- validate_db_independent() None [source]¶
Validates the database-independent aspects of the
ExportRecipient
, or raisesInvalidExportRecipient
.