• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openhealthcare / elcid-rfh / 3852

pending completion
3852

Pull #875

travis-ci

web-flow
Only display the clinical advice timeline if we are not readonly
Pull Request #875: Readonly is not respected everywhere, fix some omissions

44 of 177 branches covered (24.86%)

4 of 4 new or added lines in 1 file covered. (100.0%)

2603 of 3273 relevant lines covered (79.53%)

1.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.0
/elcid/__init__.py
1
"""
2
elCID Royal Free Hospital implementation
3
"""
4

5
from opal.core import application
1✔
6
from opal.core import menus
1✔
7
from apps.tb import constants as tb_constants
1✔
8
from elcid import episode_categories
1✔
9

10

11
class StandardAddPatientMenuItem(menus.MenuItem):
1✔
12
    def for_user(self, user):
1✔
13
        from opal.models import UserProfile
1✔
14
        if user and user.is_superuser:
1✔
15
            return True
1✔
16

17
        profile = UserProfile.objects.get(user=user)
1✔
18
        if profile.readonly:
1✔
19
            return False
×
20

21
        return not profile.roles.filter(
1✔
22
            name=tb_constants.TB_ROLE
23
        ).exists()
24

25

26
# ie, not the TB one
27
standard_add_patient_menu_item = StandardAddPatientMenuItem(
1✔
28
    href='/pathway/#/add_patient',
29
    display='Add Patient',
30
    icon='fa fa-plus',
31
    activepattern='/pathway/#/add_patient'
32
)
33

34

35
class Application(application.OpalApplication):
1✔
36
    schema_module = 'elcid.schema'
1✔
37
    javascripts = [
1✔
38
        'js/elcid/routes.js',
39
        'js/elcid/filters.js',
40
        'js/elcid/directives.js',
41
        'js/elcid/controllers/discharge.js',
42
        'js/elcid/services/records/microbiology_input.js',
43
        'js/elcid/controllers/clinical_advice_form.js',
44
        'js/elcid/controllers/welcome.js',
45
        'js/elcid/controllers/clinical_advice_form.js',
46
        'js/elcid/controllers/lab_test_json_dump_view.js',
47
        'js/elcid/controllers/result_view.js',
48
        'js/elcid/controllers/rfh_find_patient.js',
49
        'js/elcid/controllers/blood_culture_panel.js',
50
        'js/elcid/controllers/edit_blood_culture_isolate.js',
51
        'js/elcid/controllers/delete_blood_culture_isolate.js',
52
        'js/elcid/controllers/remove_patient_step.js',
53

54
        'js/elcid/services/demographics_search.js',
55
        'js/elcid/controllers/tagging_step.js',
56
        'js/elcid/controllers/investigations.js',
57

58
        'js/elcid/services/blood_culture_isolate.js',
59
        'js/elcid/services/blood_culture_loader.js',
60
        'js/elcid/services/upstream_blood_culture_loader.js',
61
        'js/elcid/services/lab_test_results.js',
62
        'js/elcid/services/demographics_search.js',
63
        'js/elcid/services/lab_test_summary_loader.js',
64
        'js/elcid/services/lab_test_json_dump.js',
65
        'js/elcid/services/episode_added_comparator.js',
66
    ]
67

68
    styles = [
1✔
69
        "css/elcid.css"
70
    ]
71

72
    patient_view_forms = {
1✔
73
        "General Consultation": "inline_forms/clinical_advice.html",
74
    }
75

76
    default_episode_category = episode_categories.InfectionService.display_name
1✔
77

78
    @classmethod
1✔
79
    def get_menu_items(cls, user):
80
        menu_items = super(Application, cls).get_menu_items(user)
1✔
81
        if standard_add_patient_menu_item.for_user(user):
1✔
82
            menu_items.append(standard_add_patient_menu_item)
1✔
83

84
        return menu_items
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc