Example #1
0
 def test_register_warns(self):
     with warnings.catch_warnings(record=True) as w:
         warnings.simplefilter('always')
         plugins.register(None)
         assert len(w) == 1
         assert issubclass(w[-1].category, DeprecationWarning)
         assert "no longer required" in str(w[-1].message)
Example #2
0
"""
OPAL core search package
"""
from opal.core.search import urls
from opal.core import plugins


class SearchPlugin(plugins.OpalPlugin):
    """
    The plugin entrypoint for OPAL's core search functionality
    """
    urls = urls.urlpatterns
    javascripts = {
        'opal.services': [
            'js/search/services/filter.js',
            'js/search/services/filters_loader.js',
            'js/search/services/filter_resource.js'
        ],
        'opal.controllers': [
            'js/search/controllers/search.js',
            'js/search/controllers/extract.js',
            "js/search/controllers/save_filter.js",
        ]
    }


plugins.register(SearchPlugin)
Example #3
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(PathwayPlugin)
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(iframeapiPlugin)
Example #5
0
from research.schema import get_study_schemas
from research.teams import get_study_teams
from research.urls import urlpatterns


class ResearchStudyPlugin(plugins.OpalPlugin):
    urls = urlpatterns
    javascripts = {
        'opal.controllers': [
            'js/research/controllers/research_hospital_number.js',
            'js/research/controllers/discharge.js'
        ]
    }

    actions = 'actions/remove_research_patient.html',

    def restricted_teams(self, user):
        return get_study_teams(user)

    def list_schemas(self):
        return get_study_schemas()

    def flows(self):
        return get_study_flows()

    def roles(self, user):
        return get_study_roles(user)


plugins.register(ResearchStudyPlugin)
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(iframeapiPlugin)
Example #7
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(nicebnfPlugin)
Example #8
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(TravelalertsPlugin)
Example #9
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(TaskrunnerPlugin)
Example #10
0
"""
OPAL core collaborative Plugin
"""
from opal.core import plugins

from opal.core.collaborative import urls

class CollaborativePlugin(plugins.OpalPlugin):
    """
    Plugin entrypoint for OPAL's collaborative realtime editing features
    """
    urls = urls.urlpatterns
    javascripts = {
        'opal.upstream.deps': [
            'js/collaborative/phoenix.js',
            ],
        'opal.services': [
            'js/collaborative/collaborator.js'
        ]
    }

plugins.register(CollaborativePlugin)
Example #11
0
    head_extra = ['zendesk/snippet.html']
    
    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(ZendeskPlugin)
Example #12
0
    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(DashboardPlugin)


class Dashboard(object):
    """
    Base Dashboard class.
    """
    name = None
    description = None

    @classmethod
    def get(klass, name):
        """
        Return a specific ward round by slug
        """
        if not IMPORTED_FROM_APPS:
Example #13
0
from opal.core import plugins, episodes

from research.flow import get_study_flows
from research.roles import get_study_roles
from research.teams import get_study_teams
from research.urls import urlpatterns


class ResearchStudyPlugin(plugins.OpalPlugin):
    urls        = urlpatterns
    javascripts = {
        'opal.controllers': [
            'js/research/controllers/research_hospital_number.js',
            'js/research/controllers/discharge.js'
        ]
    }

    actions = 'actions/remove_research_patient.html',

    def restricted_teams(self, user):
        return get_study_teams(user)

    def flows(self):
        return get_study_flows()

    def roles(self, user):
        return get_study_roles(user)


plugins.register(ResearchStudyPlugin)
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}

plugins.register(DischargesummaryPlugin)

# So we only do it once
IMPORTED_FROM_APPS = False

def import_from_apps():
    """
    Iterate through installed apps attempting to import app.dischargesummaries
    This way we allow our implementation, or plugins, to define their
    own discharge summary templates. 
    """
    for app in settings.INSTALLED_APPS:
        try:
            stringport(app + '.dischargesummaries')
        except ImportError:
            pass # not a problem
Example #15
0
    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        flows = {
            'enter': {
                'controller': 'OPATReferralCtrl',
                'template'  : '/opat/templates/modals/opat_referral.html/'
            },
            'exit': {
                'controller': 'OPATDischargeCtrl',
                'template'  : '/opat/templates/modals/discharge_opat_episode.html/'
            }
        }
        return {
            'opat': {
                'default': flows
            },
            'OPAT': flows
        }

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(OpatPlugin)
Example #16
0
    angular_module_deps = ['angulartics', 'angulartics.google.analytics']

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(AnalyticsPlugin)
Example #17
0
"""
Plugin definition
"""
from opal.core import plugins

from walkin.urls import urlpatterns

class WalkinPlugin(plugins.OpalPlugin):
    urls = urlpatterns
    javascripts = {
        'opal.controllers': [
            'js/walkin/controllers/walkin_hospital_number.js',
            'js/walkin/controllers/walkin_discharge.js',
            'js/walkin/controllers/nurse_investigation.js'
        ]
    }
    actions = [
        'actions/walkin_next.html',
        'actions/nurse_investigations.html',
        'actions/discharge_summary.html'
    ]

plugins.register(WalkinPlugin)
Example #18
0
"""
Plugin definition
"""
from opal.core import plugins

from walkin.urls import urlpatterns


class WalkinPlugin(plugins.OpalPlugin):
    urls = urlpatterns
    javascripts = {
        'opal.controllers': [
            'js/walkin/controllers/walkin_hospital_number.js',
            'js/walkin/controllers/walkin_discharge.js',
            'js/walkin/controllers/nurse_investigation.js',
            'js/walkin/controllers/zika.js'
        ]
    }
    actions = [
        'actions/walkin_next.html', 'actions/nurse_investigations.html',
        'actions/discharge_summary.html', 'actions/zika_patient.html'
    ]


plugins.register(WalkinPlugin)
DISPLAY_MENU = getattr(settings, 'REFERRAL_MENU_ITEM', True)
if DISPLAY_MENU:
    menuitems = [
        dict(
            href='/referrals/#/', display='Referrals', icon='fa fa-mail-forward',
            activepattern='/referrals', index=2)
    ]
else:
    menuitems = []

class ReferralPortalPlugin(plugins.OpalPlugin):
    """
    Main entrypoint to expose this plugin to the host
    OPAL instance.
    """
    urls = urlpatterns
    javascripts = {
        'opal.referral': [
            'js/referral/app.js',
            'js/referral/services/referral_route_loader.js',
            'js/referral/controllers/list.js',
            'js/referral/controllers/referral.js',
            # 'js/referral/controllers/episode_detail.js',
        ]
    }
    menuitems = menuitems
    apis = api.viewsets()

plugins.register(ReferralPortalPlugin)
Example #20
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(nicebnfPlugin)
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(TaskrunnerPlugin)
Example #22
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(PathwayPlugin)
Example #23
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(TbPlugin)
Example #24
0
"""
OPAL core search package
"""
from opal.core.search import urls
from opal.core import plugins

class SearchPlugin(plugins.OpalPlugin):
    """
    The plugin entrypoint for OPAL's core search functionality
    """
    urls = urls.urlpatterns
    javascripts = {
        'opal.services': [
            'js/search/services/filter.js',
            'js/search/services/filters_loader.js',
            'js/search/services/filter_resource.js'
        ],
        'opal.controllers': [
            'js/search/controllers/search.js',
            'js/search/controllers/extract.js',
            "js/search/controllers/save_filter.js",
        ]
    }

plugins.register(SearchPlugin)
Example #25
0
        plugin may define.
        """
        return []

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        flows = {
            'enter': {
                'controller': 'OPATReferralCtrl',
                'template': '/opat/templates/modals/opat_referral.html/'
            },
            'exit': {
                'controller': 'OPATDischargeCtrl',
                'template':
                '/opat/templates/modals/discharge_opat_episode.html/'
            }
        }
        return {'opat': {'default': flows}, 'OPAT': flows}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(OpatPlugin)
Example #26
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(ActivityPlugin)
Example #27
0
    """
    urls = urlpatterns
    javascripts = {
        # Add your javascripts here!
        'opal.controllers': [
            'js/lab/controllers/forms/lab_test_collection_record_form.js',
            'js/lab/directives.js',
        ],
        'opal.services': [
            'js/lab/services/records/lab_test_collection_record.js',
            'js/lab/services/lab_test_collection_form_helper.js',
        ]
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(LabPlugin)
"""
Plugin definition
"""
from opal.core import plugins

from obs import urls

class ObservationsPlugin(plugins.OpalPlugin):
    """
    Plugin for obs
    """
    urls = urls.urlpatterns
    javascripts = {
        'opal.controllers': [
            'js/obs/controllers/obs_chart.js'
        ]
    }

plugins.register(ObservationsPlugin)
Example #29
0
    """
    urls = urlpatterns
    javascripts = {
        # Add your javascripts here!
        'opal.controllers': [
            'js/lab/controllers/forms/lab_test_collection_record_form.js',
            'js/lab/directives.js',
        ],
        'opal.services': [
            'js/lab/services/records/lab_test_collection_record.js',
            'js/lab/services/lab_test_collection_form_helper.js',
        ]
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(LabPlugin)
Example #30
0
from opal.core import plugins

from wardround.urls import urlpatterns


class WardRoundsPlugin(plugins.OpalPlugin):
    """
    Main entrypoint to expose this plugin to the host
    OPAL instance !
    """
    urls = urlpatterns
    javascripts = {
        'opal.wardround': [
            'js/wardround/app.js',
            'js/wardround/services/wardround_utils.js',
            'js/wardround/controllers/list.js',
            'js/wardround/controllers/wardround.js',
            'js/wardround/controllers/episode_detail.js',
            'js/wardround/controllers/find_patient.js',
        ]
    }
    menuitems = [
        dict(
            href="/wardround/#/", display="Ward Rounds", icon="fa fa-tasks",
            activepattern='/wardround', index=1)
    ]


plugins.register(WardRoundsPlugin)
Example #31
0
"""
Plugin definition
"""
from opal.core import plugins

from obs import urls


class ObservationsPlugin(plugins.OpalPlugin):
    """
    Plugin for obs
    """
    urls = urls.urlpatterns
    javascripts = {'opal.controllers': ['js/obs/controllers/obs_chart.js']}


plugins.register(ObservationsPlugin)
Example #32
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(ActivityPlugin)
Example #33
0
    }

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(TbPlugin)
Example #34
0
"""
OPAL core collaborative Plugin
"""
from opal.core import plugins

from opal.core.collaborative import urls


class CollaborativePlugin(plugins.OpalPlugin):
    """
    Plugin entrypoint for OPAL's collaborative realtime editing features
    """
    urls = urls.urlpatterns
    javascripts = {
        'opal.upstream.deps': [
            'js/collaborative/phoenix.js',
        ],
        'opal.services': ['js/collaborative/collaborator.js']
    }


plugins.register(CollaborativePlugin)
Example #35
0
            ('guideline_consultation', api.ConsultationViewSet)]

    def restricted_teams(self, user):
        """
        Return any restricted teams for particualr users that our
        plugin may define.
        """
        return []

    def list_schemas(self):
        """
        Return any patient list schemas that our plugin may define.
        """
        return {}

    def flows(self):
        """
        Return any custom flows that our plugin may define
        """
        return {}

    def roles(self, user):
        """
        Given a (Django) USER object, return any extra roles defined
        by our plugin.
        """
        return {}


plugins.register(GuidelinesPlugin)