Coverage for cc_modules/cc_ctvinfo.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1#!/usr/bin/env python
3"""
4camcops_server/cc_modules/cc_ctvinfo.py
6===============================================================================
8 Copyright (C) 2012-2020 Rudolf Cardinal (rudolf@pobox.com).
10 This file is part of CamCOPS.
12 CamCOPS is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version 3 of the License, or
15 (at your option) any later version.
17 CamCOPS is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
25===============================================================================
27**Information class used by the clinical text viewer (CTV) function.**
29"""
32# =============================================================================
33# CtvInfo
34# =============================================================================
36class CtvInfo(object):
37 """
38 Snippet of information for incorporating into a CTV.
39 """
40 def __init__(self,
41 heading: str = None,
42 subheading: str = None,
43 description: str = None,
44 content: str = None,
45 skip_if_no_content: bool = True):
46 """
47 Args:
48 heading: optional text used for heading
49 subheading: optional text used for subheading
50 description: optional text used for field description
51 content: text
52 skip_if_no_content: if True, no other fields will be printed
53 unless content evaluates to True
55 These will be NOT webified by the ClinicalTextView class, meaning
57 (a) do it yourself if it's necessary, and
58 (b) you can pass HTML formatting.
59 """
60 self.heading = heading
61 self.subheading = subheading
62 self.description = description
63 self.content = content
64 self.skip_if_no_content = skip_if_no_content
67CTV_INCOMPLETE = [CtvInfo(description="Incomplete", skip_if_no_content=False)]