Skip to content

Commit

Permalink
Merge d81301c into 1624c8a
Browse files Browse the repository at this point in the history
  • Loading branch information
ghickman committed Jun 22, 2018
2 parents 1624c8a + d81301c commit e8dc1e6
Show file tree
Hide file tree
Showing 107 changed files with 4,839 additions and 846 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Expand Up @@ -5,7 +5,7 @@ environment:

install:
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "pip install --disable-pip-version-check --user --upgrade pip"
- "c:\\python27\\python.exe -m pip install --disable-pip-version-check --user --upgrade pip"
- "%CMD_IN_ENV% python setup.py develop"
- "pip install -r test-requirements.txt"

Expand Down
145 changes: 137 additions & 8 deletions CHANGELOG.md
@@ -1,3 +1,140 @@
### 0.11.0 (Major Release)

#### Adds options of `today` and `yesterday` in the date picker
If you pass in `user_options=True` to the date picker. You will be provided with options to select today or yesterday in the form tag.

#### Adds `dateHelper` to the rootScope
The dateHelper has the functions `now` and `yesterday` that return javascript Dates for
the current time and the current time - 1 day.

#### Deprecates the _title property

In future we will use the standard `verbose_name` property as the display name.
The abstract models have been changed to account for this.

#### Core API registration

A refactor in the way that the core APIs are registered by Opal means that
importing `opal.core.api` in a plugin API no longer results in circular imports.

Fixes a bug whereby episodes were serialising differently depending on whether
the code path went via `.to_dict()` or `.objects.serialised()`.

#### HelpTextStep can now use a custom template
The `opal.core.pathway.steps.HelpTextStep` can now have a `help_text_template` passed in.

This is the template for what will be placed in the side bar.

#### Adds in a radio_vertical template tag
This displays the label and then the radio
buttons as a vertical list.

#### opal.core.serialization

A number of helpers related to serialization and deserialization have been brought
together in the new module `opal.core.serialization`.

#### Removes "episode_history" from episode serialization

Serialised episodes previously contained a "shallow" copy of all other episodes in
a property named `episode_history`. This was primarially useful before we switched
from episode-oriented to patient-oriented detail views by default.

This also includes a change to the signature of the `.serialised()` method of the
Episode manager, which no longer accepts a `episode_history` kwarg.

#### as_menuitem helpers

Applications using Opal Menuitems often wish to add menu items for Patient Lists and
Pathways.

To aid this, the `.as_menuitem()` method now creates one from the target class with
sensible but overridable defaults.

#### Misc Changes

Adds the utility function `opal.utils.get`. Similar to the `getattr` builtin, `get` looks
for a method named `get_$attr` and will call that if it exists.

Adds the method `.get_absolute_url()` to `opal.core.pathways.Pathway` and
`opal.core.patient_lists.PatientList`.


#### Template removals

We removed a number of superfluous templates:

* opal/templates/patient_lists/spreadsheet_list.html
* opal/templates/layouts/left-panel.html

#### Static asset minification

The Django upgrade in Opal 0.10 stopped compressor minifying files
when DEBUG is set to False. This fixes that issue by upgrading Django compressor to
a version that supports Django 1.10.

#### The return of an old friend: IE Document modes

Users report that their system administrators sometimes configure Internet Explorer
in such a way that it uses e.g. IE7 Document mode by default.

This is problematical for Opal applications which do in fact make use of internet
technologies that were in widespread use after say, 2006.

We have altered `base.html` to specify `"X-UA-Compatible" content="IE=Edge"`. If you
override `base.html`in your application we advise that you add this `<meta>` tag.

#### Misc Changes

* Adds the utility function `opal.core.subrecords.singletons()` which returns
a generator function which will yield all subrecord singletons.
* Fixes a URI encoding bug in the `Episode.findByHospitalNumber()` method that
made hospital numbers including `#` or `/` raise an error.

* Adds the methods `.get_absolute_url()`, `.get_icon()` and `get_display_name()`
to `opal.core.pathways.Pathway` and `opal.core.patient_lists.PatientList`.


#### Updates to the Dependency Graph

* Django compressor: 1.5 -> 2.2


### 0.10.1 (Minor Release)

#### Plugin API end points can now override application end points

A change to the order that APIs are registered with Django Rest Framework allows
plugins to now override the core Opal application APIs.

#### Fonts are now locally sourced

Fonts are now served from Opal's static assets rather than from the Google CDN.

#### print/screen stylesheets have been collapsed into opal.css

Print/screen differences are now in opal.css with media tags.

#### Google Analytics is now deferred

The loading in of Google Analytics is now deferred to the bottom of the body
tag to allow the page to load without waiting on analytics scripts to load.

#### Scaffold version control failures

The `startplugin` and `startproject` commands initialize a git repository by
default. If we (The `subprocess` module) cannot find the `git` command, we now
continue with a message printed to screen rather than raising an exception.

#### Episode.objects.serialised now uses select_related

`ForeignKeyOrFreeText` fields now have their ForeignKey items preselected when
we use `Episode.objects.serialised`. This provides a speed boost for applications
with moderately heavy `ForeignKeyOrFreeText` usage.

(Approx 30-40% in our tests.)


### 0.10.0 (Major Release)

This is a major release with breaking changes from upstream dependencies.
Expand Down Expand Up @@ -123,14 +260,6 @@ Adds the `rows` option to the textarea template tag which just fills in the html

Configures the setting `CSRF_FAILURE_VIEW` to use the bundled `opal.views.csrf_failure` view.

Adds the utility function `opal.utils.get`. Similar to the `getattr` builtin, `get` looks
for a method named `get_$attr` and will call that if it exists.

Adds the method `.get_absolute_url()` to `opal.core.pathways.Pathway` and
`opal.core.patient_lists.PatientList`.

Adds the Opal error `SignatureError`.

Pathway slugs may now include hyphens as well as numbers, lower case letters and underscores.

Bugfix: in edit_item.js $scope.episode_category is now set from episode.category_name
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -7,7 +7,7 @@ help:

docs:
pip install -r doc/requirements.txt
mkdocs serve
cd doc && mkdocs serve

release:
rm -rf dist/*
Expand Down
4 changes: 2 additions & 2 deletions README.md
@@ -1,8 +1,8 @@
Opal
====

[![Build Status](https://travis-ci.org/openhealthcare/opal.svg?branch=v0.10.0)](https://travis-ci.org/openhealthcare/opal)
[![Coverage Status](https://coveralls.io/repos/github/openhealthcare/opal/badge.svg?branch=v0.10.0)](https://coveralls.io/github/openhealthcare/opal?branch=v0.10.0)
[![Build Status](https://travis-ci.org/openhealthcare/opal.svg?branch=v0.11.0)](https://travis-ci.org/openhealthcare/opal)
[![Coverage Status](https://coveralls.io/repos/github/openhealthcare/opal/badge.svg?branch=v0.11.0)](https://coveralls.io/github/openhealthcare/opal?branch=v0.11.0)
[![PyPI version](https://badge.fury.io/py/opal.svg)](https://badge.fury.io/py/opal)


Expand Down
File renamed without changes.
6 changes: 0 additions & 6 deletions doc/docs/guides/dump.md
Expand Up @@ -28,12 +28,6 @@ _is_singleton is a boolean property that ensures that there is only one of this

Effectively this defaults to False.

### _title

_title sets the column headings in list view.

Effectively this defaults to camel_case_to_underscore() on the class name.

### _sort

_sort names a field by which we would like to sort the display of subrecords.
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/guides/topic-guides.md
Expand Up @@ -54,7 +54,7 @@ A list of all available topic guides.
### Working on Opal itself
|||
|--|--|
[Contributing](CONTRIBUTING.md) | Contributing to Opal
[Contributing](contributing.md) | Contributing to Opal
[Development environment](development_environment.md) | Setting up the Opal development environment
[Making a Release](releasing.md) | Releasing a version of Opal

Expand Down
File renamed without changes.
42 changes: 42 additions & 0 deletions doc/docs/reference/core_serialization.md
@@ -0,0 +1,42 @@
# opal.core.serialization

Helpers for serializing and deserializing data

## `deserialize_datetime(value)`

Given a string which represents a date time, deserialize it to a Python datetime
object using the first value of `settings.DATETIME_INPUT_FORMATS`.

```python
as_datetime = deserialize_datetime('22/04/1959 21:20:22')
```

## `deserialize_time(value)`

Given a string which represents a time, deserialize it to a Python time
object using the first value of `settings.TIME_INPUT_FORMATS`.

```python
as_time = deserialize_time('14:30:59')
```

## `deserialize_date(value)`

Given a string which represents a date, deserialize it to a Python date
object using the first value of `settings.DATE_INPUT_FORMATS`.

```python
as_date = deserialize_date('22/04/1959')
```

## OpalSerializer

A JSON serializer that will serialize the output of `to_dict` calls. This serializer
uses date formats that can be understood by the Opal javascript applications.

```python
import json

as_dict = episode.to_dict(user)
as_json = json.dumps(as_dict, cls=OpalSerializer)
```
75 changes: 75 additions & 0 deletions doc/docs/reference/core_subrecords.md
@@ -0,0 +1,75 @@
# opal.core.subrecords

The `opal.core.subrecords` module contains utility functions for working with
subrecords.

## `episode_subrecords()`

Generator function that iterates through all episode subrecords.

```python
for s in episode_subrecords():
print(s)

# -> Location, Diagosis et cetera
```

## `patient_subrecords()`

Generator function that iterates through all patient subrecords.

```python
for s in patient_subrecords():
print(s)

# -> Allergies, ContactDetails et cetera
```

## `subrecords()`

Generator function that iterates through all subrecords.

```python
for s in subrecords():
print(s)

# -> Allergies, ContactDetails, Location, Diagnosis et cetera
```

## `singletons()`

Generator function that iterates through all singleton subrecords.

```python
for s in singletons():
print(s)

# -> Location, Demographics
```

## Fetchers

### `get_subrecord_from_api_name(api_name)`

Return a subrecord given the relevant API name for it. Raise a ValueError
if no matching subrecord is found.


```python
get_subrecord_from_api_name('demographics')

# -> <class Demographics>
```


### `get_subrecord_from_model_name(model_name)`

Return a subrecord given the relevant model name for it. Raise a ValueError
if no matching subrecord is found.


```python
get_subrecord_from_api_name('Demographics')

# -> <class Demographics>
```
23 changes: 21 additions & 2 deletions doc/docs/reference/form_templatetags.md
Expand Up @@ -44,7 +44,7 @@ Keywords:
* `mindate` Angular Javascript expression to return the minimum possible date
* `element_name` If this exists this is an Angular expression that is set to the 'name' attribute of the html element
* `style` The form style to render this widget with. Possible values are `['horizontal', 'vertical']`. Defaults to 'horizontal'

* `user_options` If set to `True` this will add the default options of `today`, ie the current date, or `yesterday`, ie t-1.

### {% timepicker ... %}

Expand Down Expand Up @@ -109,7 +109,26 @@ available by using the unit argument e.g.

### {% radio ... %}

Generates an inline radio input
Generates an inline radio input.
Options are rendered in rows with multiple options on each row.

Keywords:

* `field` a string of the models api name '.' field from this it calculates the label, model and will infer the lookuplist if required. For example {% radio field="DogOwner.dog" %}
* `label` The Label with which to describe this input
* `model` The model which we are editing (This is a string that references an in-scope Angular variable)
* `change` A javascript function that fires if the field has changed
* `show` A string that contains an Angular expression for the ng-show directive
* `hide` A string that contains an Angular expression for the ng-hide directive
* `lookuplist` an Angular expression that evaluates to an array containing the radio values
* `element_name` If this exists this is an Angular expression that is set to the 'name' attribute of the html element
* `style` The form style to render this widget with. Possible values are `['horizontal', 'vertical']`. Defaults to 'horizontal'


### {% radio_vertical ... %}

Generates a vertical radio input.
Options are rendered one option per row.

Keywords:

Expand Down

0 comments on commit e8dc1e6

Please sign in to comment.