Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #358 from HospitalRun/admitted-list-screen
Browse files Browse the repository at this point in the history
Admitted list screen
  • Loading branch information
Joel Glovier committed Mar 18, 2016
2 parents 9dcb6ff + dd23359 commit 66f5ba3
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/mixins/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export default Ember.Mixin.create({
route: 'patients',
capability: 'patients'
},
{
title: 'Admitted Patients',
iconClass: 'octicon-chevron-right',
route: 'patients.admitted',
capability: 'patients'
},
{
title: 'New Patient',
iconClass: 'octicon-plus',
Expand Down
4 changes: 4 additions & 0 deletions app/patients/admitted/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import PatientsIndexController from 'hospitalrun/patients/index/controller';
export default PatientsIndexController.extend({

});
19 changes: 19 additions & 0 deletions app/patients/admitted/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import AbstractIndexRoute from 'hospitalrun/routes/abstract-index-route';
export default AbstractIndexRoute.extend({
modelName: 'patient',
pageTitle: 'Admitted patients',

_getStartKeyFromItem: function(item) {
var displayPatientId = item.get('displayPatientId');
return [displayPatientId, 'patient_' + item.get('id')];
},

_modelQueryParams: function() {
return {
options: {
key: true
},
mapReduce: 'patient_by_admission'
};
}
});
1 change: 1 addition & 0 deletions app/patients/admitted/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{partial 'patients/index'}}
3 changes: 3 additions & 0 deletions app/patients/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export default AbstractModuleRoute.extend(PatientId, {
subActions: [{
text: 'Patient listing',
linkTo: 'patients.index'
}, {
text: 'Admitted patients',
linkTo: 'patients.admitted'
}, {
text: 'Reports',
linkTo: 'patients.reports'
Expand Down
1 change: 1 addition & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Router.map(function() {
}, function() {
this.route('edit', { path: '/edit/:patient_id' });
this.route('reports');
this.route('admitted');
this.route('search', { path: '/search/:search_text' });
});

Expand Down
6 changes: 6 additions & 0 deletions app/utils/pouch-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ var designDocs = [{
'emit(doc.data.status);'
),
version: 2
},{
name: 'patient_by_admission',
function: generateView('patient',
'emit(doc.data.admitted);'
),
version: 1
}, {
name: 'photo_by_patient',
function: generateView('photo',
Expand Down

0 comments on commit 66f5ba3

Please sign in to comment.