openhealthcare/opal-reporting

Name: opal-reporting

Owner: Open Health Care

Description: null

Created: 2017-05-04 09:10:17.0

Updated: 2017-05-04 09:12:50.0

Pushed: 2018-01-09 09:49:06.0

Homepage: null

Size: 47

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

This is reporting - an Opal plugin.

Reports

The Opal Reporting plugin provides developers with a highly extensible method of creating downloadable reports in Opal.

This plugin is Alpha software.

Although it aldeady provides significant and useful functionality, it is in active development, and delvelopers should anticipate backwards-incompatible API changes as part of minor (x.VERSION.x) releases.

Build Status Coverage Status

Contents
Introduction: What Is A Report?

A report is a cut of data from an Opal application. The reports are downloaded as a zipped file containing one or more csv files.

Quickstart Guide

In this section we walk you through creating a simple Report.

Pip install opal-reporting from github and add it to your INSTALLED_APPS

Create a report object in your {{ application }}/reports.py. This should look something like the below…

s YourFirstReport(Report):
slug = "your-first-report"
display_name = "Your First Report"
description = """Everyone has to have one report that is their first, this one is yours."""

def generate_report_data(self, *args, **kwargs):
    return [
        ReportFile(
            file_name="some_file.txt", file_data=[['hello']]
        )
    ]

Now if you go to “/reporting/#/list” You should see your report listed. Click on this and it should have an option to download your new report.

Custom Template

Add template to your report, for example

s YourFirstReport(Report):
slug = "your-first-report"
display_name = "Your First Report"
description = """Everyone has to have one report that is their first, this ones yours"""
template = "my_template.html"

This allows you to put your own template into the front end instead of the default one.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.