Coverage for cc_modules/cc_ctvinfo.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2022-11-08 23:14 +0000

1#!/usr/bin/env python 

2 

3""" 

4camcops_server/cc_modules/cc_ctvinfo.py 

5 

6=============================================================================== 

7 

8 Copyright (C) 2012, University of Cambridge, Department of Psychiatry. 

9 Created by Rudolf Cardinal (rnc1001@cam.ac.uk). 

10 

11 This file is part of CamCOPS. 

12 

13 CamCOPS is free software: you can redistribute it and/or modify 

14 it under the terms of the GNU General Public License as published by 

15 the Free Software Foundation, either version 3 of the License, or 

16 (at your option) any later version. 

17 

18 CamCOPS is distributed in the hope that it will be useful, 

19 but WITHOUT ANY WARRANTY; without even the implied warranty of 

20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

21 GNU General Public License for more details. 

22 

23 You should have received a copy of the GNU General Public License 

24 along with CamCOPS. If not, see <https://www.gnu.org/licenses/>. 

25 

26=============================================================================== 

27 

28**Information class used by the clinical text viewer (CTV) function.** 

29 

30""" 

31 

32 

33# ============================================================================= 

34# CtvInfo 

35# ============================================================================= 

36 

37 

38class CtvInfo(object): 

39 """ 

40 Snippet of information for incorporating into a CTV. 

41 """ 

42 

43 def __init__( 

44 self, 

45 heading: str = None, 

46 subheading: str = None, 

47 description: str = None, 

48 content: str = None, 

49 skip_if_no_content: bool = True, 

50 ): 

51 """ 

52 Args: 

53 heading: optional text used for heading 

54 subheading: optional text used for subheading 

55 description: optional text used for field description 

56 content: text 

57 skip_if_no_content: if True, no other fields will be printed 

58 unless content evaluates to True 

59 

60 These will be NOT webified by the ClinicalTextView class, meaning 

61 

62 (a) do it yourself if it's necessary, and 

63 (b) you can pass HTML formatting. 

64 """ 

65 self.heading = heading 

66 self.subheading = subheading 

67 self.description = description 

68 self.content = content 

69 self.skip_if_no_content = skip_if_no_content 

70 

71 

72CTV_INCOMPLETE = [CtvInfo(description="Incomplete", skip_if_no_content=False)]