13.2.63. camcops_server.cc_modules.cc_specialnote

camcops_server/cc_modules/cc_specialnote.py


Copyright (C) 2012-2019 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/>.


Special notes that are attached, on the server, to tasks or patients.

class camcops_server.cc_modules.cc_specialnote.SpecialNote(**kwargs)[source]

Represents a special note, attached server-side to a task or patient.

“Task” means all records representing versions of a single task instance, identified by the combination of {id, device, era}.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

classmethod forcibly_preserve_special_notes_for_device(req: camcops_server.cc_modules.cc_request.CamcopsRequest, device_id: int) → None[source]

Force-preserve all special notes for a given device.

WRITES TO DATABASE.

For update methods, see also: http://docs.sqlalchemy.org/en/latest/orm/persistence_techniques.html

get_note_as_html() → str[source]

Return an HTML-formatted version of the note.

get_note_as_string() → str[source]

Return a string-formatted version of the note.

get_xml_root(skip_fields: List[str] = None) → camcops_server.cc_modules.cc_xml.XmlElement[source]

Get root of XML tree, as an camcops_server.cc_modules.cc_xml.XmlElement.