Skip to content

Commit

Permalink
Merge 0ce132e into 61f4c09
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjones committed Oct 26, 2018
2 parents 61f4c09 + 0ce132e commit 1658802
Show file tree
Hide file tree
Showing 89 changed files with 620 additions and 767 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ python:
- "3.4"
- "3.5"
- "3.6"
services:
- postgresql
install:
- python setup.py develop
- gem install coveralls-lcov
Expand All @@ -13,6 +15,7 @@ install:
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- psql -c 'create database travis_ci_test;' -U postgres
script:
- opal test --coverage
- flake8
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ recursive-include opal/core/search/static *
recursive-include opal/core/search/templates *
recursive-include opal/core/pathway/static *
recursive-include opal/core/pathway/templates *
recursive-include opal/core/referencedata/data/lookuplists *
recursive-include opal/tests/js_config *
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ From there, Opal provides you with a common batteries-included architecture for
applications, and a composable modular framework that takes advantage of generic, re-usable components.

Opal is entirely open ([source](https://github.com/openhealthcare/opal) &
[Governance](https://github.com/openhealthcare/opal/issues)) as are the wide library of plugins.
[governance](https://github.com/openhealthcare/opal/issues)) as are the wide library of plugins.

Opal was created by [Open Health Care UK](http://openhealthcare.org.uk), because it makes Healthcare IT Less Bad.

Expand Down
80 changes: 76 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,82 @@
### 0.13.0 (Major Release)

#### Removes scope.jumpToEpisode and scope.getEpisodeId from Search and Extract

We no longer use these functions, instead we use an HTML link to the patient detail view.

#### Removes Patient.to_dict().active_episode_id

We no longer include a value for "active_episode_id" as part of the Patient to_dict serialisation.

This is effectively meaningless since we moved to an episode model that allows for multiple
concurrent episodes.


#### Removes CopyToCategory

Removes the entire CopyToCategory flow from Opal Core. If applications continue to rely on it,
they are advised to implement at application level.

In general application developers are advised to find alternative ways to display subrecords
from multiple episodes rather than copying them however, as this is known to cause duplication
of data that is hard to trace back later on.

This includes the API endpoint at `episode/$id/actions/copyto/$category/`, the template
`copy_to_category.html`, the Angular controller `CopyToCategoryCtrl` and service
`CopyToCategory` and Subrecord property `_clonable`.


#### Lookuplist data format

Lookuplist entries in data files are no longer required to have an empty synonyms list
if the entry doesn't have a synonym. This reduces the file size and makes it easier to
hand craft data files for new applications.


#### Removes the deprecated Model._title property

Use of `Model._title` to set a display name of a subrecord has issued a warning for several
releases - this has now been removed and will no longer work.

#### Misc Changes

* The undocumented Reopen Episode flow included in Opal < 0.8.0 has now been completely removed,
including the `reopen_episode_modal.html` template and the url/view at `templates/modals/reopen_episode.html/`.

* Removes the method `.deleteItem` from the `RecordEditor` service.

* Adds in a footer updated/created by to the form base template


### 0.12.0 (Major Release)

#### Misc Changes
* Adds the {% block analytics %} in the base template (opal/templates/base.html) that by default contains the google analytics code.

* Adds the block {% block javascripts %} in the base template (opal/templates/base.html) that will compress all javascripts.

* Adds a method `.demographics()` to `opal.models.Patient` which returns the relevant demographics instance.

* Adds a `for_user` method on to the menu item. This method
takes a user and by default returns True. Override this
to decide if a menu item should be shown in the nav bar.

### 0.11.2 (Bugfix Release)

Includes referencedata JSON files in Manifest.

### 0.11.1 (Bugfix Release)
Fixes the user_options in the date picker tag to display the options as part of the text input.

### 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.

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.

Expand All @@ -21,11 +94,13 @@ 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.

Expand Down Expand Up @@ -65,7 +140,6 @@ 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:
Expand Down Expand Up @@ -96,11 +170,9 @@ override `base.html`in your application we advise that you add this `<meta>` tag
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
Expand Down
2 changes: 0 additions & 2 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module.exports = function(config){
var includedFiles = [
'opal/app.js',
'opal/routes.js',
'../../core/pathway/static/js/pathway/**/*.js',
'../../core/search/static/js/search/**/*.js',
'test/*.js',
'../../core/search/static/js/test/*',
'../../core/pathway/static/js/test/*',
Expand Down
4 changes: 2 additions & 2 deletions doc/docs/guides/flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ wish to be called.
enter: function(){
return {
'controller': 'HospitalNumberCtrl',
'template' : '/templates/modals/hospital_number.html/'
'template' : '/templates/hospital_number_modal.html/'
}
}

Expand Down Expand Up @@ -64,6 +64,6 @@ that acts differently for deceased patients might look as follows
}
return {
'controller': 'DischargeEpisodeCtrl',
'template' : '/templates/modals/discharge_episode.html/'
'template' : '/templates/discharge_episode_modal.html'
}
}
19 changes: 10 additions & 9 deletions doc/docs/guides/releasing.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Making a Release
1. Make and deploy a version to test it on a windows machines.

1. Tag the HEAD of the release branch and push to github: `git tag <version> && git push --tags`.
2. Tag the HEAD of the release branch and push to github: `git tag <version> && git push --tags`.
Opal branch names are in the format `vX.Y.Z` the tag for a release should be the `X.Y.Z` component
of the branch name.

1. Check version is correct in `_version.py`.
3. Check version is correct in `_version.py`.

1. Make sure you have `twine` installed and then: `make release`
4. Make sure you have `twine` installed and then: `make release`

1. Merge the branch you are releasing into `master`
5. Merge the branch you are releasing into `master`

1. Update the Github release page and make sure that it has the relevant Changelog contents.
6. Update the Github release page and make sure that it has the relevant Changelog contents.

1. If the branch for the next version does not already exist, create that branch. For instance, if you
7. If the branch for the next version does not already exist, create that branch. For instance, if you
have released `x.y.z` then create `x.y.(z+1)`. If you are creating a new version branch, ensure you have
also changed the version number in the documentation, `opal._version.__version__`, and the branches that
any badges in the project README are pointing at.

1. Change the github default branch to be the new in development version
8. Change the github default branch to be the new in development version

1. Update the Opal website: Change the current release and development version on the homepage, and run
9. Update the Opal website: Change the current release and development version on the homepage, and run
`rake docs` to regenerate the documentation site with a new latest stable release version.

1. Post to the Opal mailing list to announce the new release.
10. Post to the Opal mailing list to announce the new release.
3 changes: 0 additions & 3 deletions doc/docs/guides/working_with_data_in_angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ episode.recordEditor.newItem('diagnosis'):

episode.recordEditor.editItem('diagnosis', 0);
// -> Opens a modal that allows the user to edit the first diagnosis

episode.recordEditor.deleteItem('diagnosis', 0);
// -> Prompts the user to confirm the deletion of the first diagnosis
```

## Customising Subrecords
Expand Down
Binary file added doc/docs/img/detail_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions doc/docs/reference/core_menus.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Opal provides classes and methods to define application menus programatically.

## opal.core.MenuItem
### opal.core.MenuItem

An item in an application menu.

Expand All @@ -15,7 +15,12 @@ An item in an application menu.
* display - the text to display in this menu item
* index - a number to use as the primary sort order for your menu items

## opal.core.Menu
**Methods**

#### for_user
A method that takes a user and returns True by default. Override this if you want menu items hidden for certain users.

### opal.core.Menu

The menu for an Opal application. On initialization it will construct a menu
for the current user, pulling items from the current app, and any plugins.
8 changes: 0 additions & 8 deletions doc/docs/reference/javascript/episode_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ episode.recordEditor.newItem('diagnosis'):
// -> Opens a modal with the diagnosis form and will create a new diagnosis on save
```

#### Episode.recordEditor.deleteItem(name, index)

Delete the `index-th` item of type `name`. Prompt the user to confirm this with a dialog.

```js
episode.recordEditor.deleteItem('diagnosis', 0);
// -> Prompts the user to confirm the deletion of the first diagnosis
```
#### Episode.recordEditor.editItem(name, index)

Open a modal from which the user may edit the `index-th` item of type `name`.
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/reference/panels_templatetags.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ instances of the given model, as well as editing any existing ones.
Render a panel for a given record that will allow the user to view, create, update and delete instances.

The record panel template expects the relevant Angular `$scope` to have `newNamedItem(name, index)`,
`editNamedItem(name, index)` and `deleteItem(name, index)` methods implemented. Default
`editNamedItem(name, index)` methods implemented. Default
implementations of these are available from the `EpisodeDetailMixin`.

{% load panels %}
Expand Down
6 changes: 5 additions & 1 deletion doc/docs/reference/patient.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

### methods

#### create_episode
#### `Patient.demographics()`

Returns the relevant Demographics instance for the patient.

#### `Patient.create_episode()`

Returns a new `Episode` for this patient.

Expand Down
12 changes: 1 addition & 11 deletions doc/docs/reference/subrecords.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@ Name of the field by which we want to sort these records when displaying.
_sort = 'start_date'
```

#### Subrecord._clonable

A Boolean that is True by default used by `opal.views.EpisodeCopyToCategoryView`
to determine if instances of this record should be copied across.

```python
class Antimicrobial(EpisodeSubrecord):
_clonable = 'False'
```

#### Subrecord._exclude_from_extract

Boolean to specify that this subrecord should be excluded from any standard data extract.
Expand Down Expand Up @@ -104,7 +94,7 @@ Classmethod that returns the display name of the subrecord.
This is used as the user visible title of subrecord panels and modals amongst other places.

By default this uses the Django
[Meta verbose_name](https://docs.djangoproject.com/en/dev/ref/models/options/#verbose-name)
[Meta verbose_name](https://docs.djangoproject.com/en/dev/ref/models/options/#verbose-name)
property

```python
Expand Down
8 changes: 8 additions & 0 deletions doc/docs/reference/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
This document provides instructions for specific steps required to upgrading your Opal
application to a later version where there are extra steps required.

### 0.11.1 -> 0.11.2

This bugfix release should be entirely backwards compatible.

### 0.11.0 -> 0.11.1

This bugfix release should be entirely backwards compatible.

### 0.10.1 -> 0.11.0

Please upgrade django-compressor version to 2.2, ie update your requirements to
Expand Down
7 changes: 4 additions & 3 deletions doc/docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ class Diagnosis(EpisodeSubrecord):

You will notice that the condition field has a custom field type - `ForeignKeyOrFreeText`.
This is a custom field type that we use with Opal when we want to use a
[Lookup List](/guides/lookup_lists/).
[Lookup List](/guides/referencedata/).


Lookup Lists allow us to reference canonical lists of available terminology as a foreign key, while
also allowing synonymous terms, and a free text override. That means that we can ensure that
Expand Down Expand Up @@ -262,7 +263,7 @@ application.

For us, you'll notice that the value of `TODOItem.completed` simply displays as false -
which is not particularly useful. So let's update that using the Opal
[Boxed filter](/reference/javascript_helpers/). In `mynewapp/templates/records/todo_item.html`
[Boxed filter](/reference/javascript/javascript_helpers/#boxed). In `mynewapp/templates/records/todo_item.html`
change the last `span` to look like this:

```html
Expand Down Expand Up @@ -295,7 +296,7 @@ We also have a detail view for our patients, which you can access via search res
view will typically allow for a more detailed display and editing of all the events
comprising a patient's care than is available on the list page.

<img src="/img/detail.png" style="margin: 12px auto; border: 1px solid black; width: 600px;"/>
<img src="/img/detail_1.png" style="margin: 12px auto; border: 1px solid black; width: 600px;"/>


#### JSON APIs
Expand Down
2 changes: 1 addition & 1 deletion doc/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ dev_addr: 0.0.0.0:8965
include_next_prev: false

extra:
version: v0.11.0
version: v0.13.0

markdown_extensions:
- fenced_code
2 changes: 1 addition & 1 deletion opal/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Declare our current version string
"""
__version__ = '0.11.0'
__version__ = '0.13.0'
2 changes: 1 addition & 1 deletion opal/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def create(self, request):
patient, created = Patient.objects.get_or_create(
demographics__hospital_number=hospital_number)
if created:
demographics = patient.demographics_set.get()
demographics = patient.demographics()
demographics.hospital_number = hospital_number
demographics.save()
else:
Expand Down
4 changes: 1 addition & 3 deletions opal/core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class OpalApplication(object):
"js/opal/services/patient_loader.js",
"js/opal/services/episode_resource.js",
"js/opal/services/record_editor.js",
"js/opal/services/copy_to_category.js",
"js/opal/services/patientlist_loader.js",
'js/opal/services/fields_translater.js',
'js/opal/services/referencedata.js',
Expand All @@ -86,7 +85,6 @@ class OpalApplication(object):
"js/opal/controllers/account.js",
"js/opal/controllers/discharge.js",
"js/opal/controllers/undischarge.js",
"js/opal/controllers/copy_to_category.js",
"js/opal/controllers/keyboard_shortcuts.js",
"js/opal/controllers/patient_access_log.js",
"js/opal/controllers/lookup_list_reference.js"
Expand Down Expand Up @@ -142,7 +140,7 @@ def get_menu_items(klass, user=None):
items.append(logout)
if user.is_staff:
items.append(admin)
return items
return [item for item in items if item.for_user(user)]

@classmethod
def get_menu(klass, user=None):
Expand Down
Loading

0 comments on commit 1658802

Please sign in to comment.