Skip to content

Commit

Permalink
Merge branch 'fuan'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rupert Bedford committed Jul 19, 2016
2 parents 51ecf7d + 4851df8 commit 9780156
Show file tree
Hide file tree
Showing 7 changed files with 275 additions and 0 deletions.
68 changes: 68 additions & 0 deletions src/app/patients/fuan/clinical-pictures-component.directive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
(function() {
'use strict';

var app = angular.module('radar.patients.mpgn');

app.factory('MpgnClinicalPicturePermission', ['PatientObjectPermission', function(PatientObjectPermission) {
return PatientObjectPermission;
}]);

function controllerFactory(
ModelListDetailController,
MpgnClinicalPicturePermission,
$injector,
store,
firstPromise
) {
function FuanClinicalPicturesController($scope) {
var self = this;

$injector.invoke(ModelListDetailController, self, {
$scope: $scope,
params: {
permission: new MpgnClinicalPicturePermission($scope.patient)
}
});

self.load(firstPromise([
store.findMany('fuan-clinical-pictures', {patient: $scope.patient.id}),
store.findMany('fuan-relatives').then(function(relatives) {
$scope.relatives = relatives;
}),
store.findMany('fuan-thp-results').then(function(thpResults) {
$scope.thpResults = thpResults;
})
]));

$scope.create = function() {
var item = store.create('fuan-clinical-pictures', {patient: $scope.patient.id});
self.edit(item);
};
}

FuanClinicalPicturesController.$inject = ['$scope'];
FuanClinicalPicturesController.prototype = Object.create(ModelListDetailController.prototype);

return FuanClinicalPicturesController;
}

controllerFactory.$inject = [
'ModelListDetailController',
'MpgnClinicalPicturePermission',
'$injector',
'store',
'firstPromise'
];

app.factory('FuanClinicalPicturesController', controllerFactory);

app.directive('fuanClinicalPicturesComponent', ['FuanClinicalPicturesController', function(FuanClinicalPicturesController) {
return {
scope: {
patient: '='
},
controller: FuanClinicalPicturesController,
templateUrl: 'app/patients/fuan/clinical-pictures-component.html'
};
}]);
})();
185 changes: 185 additions & 0 deletions src/app/patients/fuan/clinical-pictures-component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
<div loading="loading" crud>
<div ng-if="viewing">
<p>
<span crud-list-button></span>
<span crud-edit-button item="item"></span>
</p>

<table class="table properties">
<tr>
<th>Date of Picture</th>
<td>{{item.pictureDate | dateFormat}}</td>
</tr>

<tr>
<th>Gout</th>
<td><span tick="item.gout"></span></td>
</tr>

<tr ng-if="item.goutDate">
<th>Gout Date</th>
<td>{{item.goutDate | dateFormat}}</td>
</tr>

<tr>
<th>Family History of Gout</th>
<td>
<span tick="item.familyGout"></span>
</td>
</tr>

<tr ng-if="item.familyGoutRelatives.length">
<th>Relatives with Gout</th>
<td>
<ul>
<li ng-repeat="relative in item.familyGoutRelatives">{{relative.label}}</li>
</ul>
</td>
</tr>

<tr>
<th>Urinary Uromodulin THP</th>
<td>{{item.thp.label | missing}}</td>
</tr>

<tr>
<th>Recurrent UTI</th>
<td>
<span tick="item.uti"></span>
</td>
</tr>

<tr>
<th>Comments</th>
<td class="newlines">{{item.comments}}</td>
</tr>
</table>

<div metadata item="item"></div>
</div>

<div ng-if="editing">
<p>
<span crud-list-button></span>
<span crud-view-button item="originalItem"></span>
</p>

<form class="form-horizontal form-container" crud-submit="saveAndView()" novalidate>
<div frm-field frm-group>
<div frm-label>Date of Picture</div>

<div frm-control>
<div frm-date-field model="item.pictureDate" required="true"></div>
<div frm-errors errors="item.errors.pictureDate"></div>
</div>
</div>

<div frm-field frm-group>
<div frm-label>Gout</div>

<div frm-control>
<div frm-boolean-field model="item.gout"></div>
<div frm-errors errors="item.errors.gout"></div>
</div>
</div>

<div frm-field frm-group ng-if="item.gout">
<div frm-label>Date Gout Diagnosed</div>

<div frm-control>
<div frm-date-field model="item.goutDate"></div>
<div frm-errors errors="item.errors.goutDate"></div>
</div>
</div>

<div frm-field frm-group>
<div frm-label>Family History of Gout</div>

<div frm-control>
<div frm-boolean-field model="item.familyGout"></div>
<div frm-errors errors="item.errors.familyGout"></div>
</div>
</div>

<div frm-field frm-group ng-if="item.familyGout">
<div frm-label>Relatives with Gout</div>

<div frm-control>
<div frm-multiple-checkbox-field model="item.familyGoutRelatives" options="relatives"></div>
<div frm-errors errors="item.errors.familyGoutRelatives"></div>
</div>
</div>

<div frm-field frm-group>
<div frm-label>Urinary Uromodulin THP</div>

<div frm-control>
<div frm-select-field model="item.thp" options="thpResults"></div>
<div frm-errors errors="item.errors.thp"></div>
</div>
</div>

<div frm-field frm-group>
<div frm-label>Recurrent UTI</div>

<div frm-control>
<div frm-boolean-field model="item.uti"></div>
<div frm-errors errors="item.errors.uti"></div>
</div>
</div>

<div frm-field frm-group>
<div frm-label>Comments</div>

<div frm-control>
<div frm-textarea-field model="item.comments"></div>
<div frm-errors errors="item.errors.comments"></div>
</div>
</div>

<div frm-buttons>
<span crud-save-button></span>
<span crud-cancel-list-button></span>
</div>
</form>
</div>

<div ng-if="!viewing && !editing" list-helper="items as page" list-helper-options="{perPage: 10, sortBy: 'pictureDate', reverse: true}">
<p>
<span crud-create-button action="create()"></span>
</p>

<div filter-helper></div>

<div ng-show="!page.getCount()">
<p>No results.</p>
</div>

<table class="table table-condensed table-striped" ng-if="page.getCount()">
<thead>
<tr>
<th></th>
<th sort-helper="pictureDate">Date</th>
<th></th>
</tr>
</thead>

<tbody>
<tr ng-repeat="item in page.getItems()">
<td>
<span crud-list-view-button item="item"></span>
<span crud-list-edit-button item="item"></span>
</td>

<td>{{item.pictureDate | dateFormat}}</td>

<td>
<span crud-list-remove-button item="item"></span>
</td>
</tr>
</tbody>
</table>

<div pagination-helper></div>
</div>
</div>
3 changes: 3 additions & 0 deletions src/app/patients/fuan/clinical-pictures.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h1 class="page-header">ADTKD Clinical Pictures</h1>

<div fuan-clinical-pictures-component patient="patient"></div>
12 changes: 12 additions & 0 deletions src/app/patients/fuan/fuan.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(function() {
'use strict';

var app = angular.module('radar.patients.fuan');

app.config(['$stateProvider', function($stateProvider) {
$stateProvider.state('patient.fuanClinicalPictures', {
url: '/adtkd-clinical-pictures',
templateUrl: 'app/patients/fuan/clinical-pictures.html'
});
}]);
})();
5 changes: 5 additions & 0 deletions src/app/patients/fuan/fuan.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(function() {
'use strict';

angular.module('radar.patients.fuan', ['ui.router']);
})();
1 change: 1 addition & 0 deletions src/app/patients/patients.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
FAMILY_HISTORY: patientPage('Family History', 'patient.familyHistory', true),
FETAL_ANOMALY_SCANS: patientPage('Fetal Anomaly Scans', 'patient.fetalAnomalyScans'),
FETAL_ULTRASOUNDS: patientPage('Fetal Ultrasounds', 'patient.fetalUltrasounds'),
FUAN_CLINICAL_PICTURES: patientPage('Clinical Pictures', 'patient.fuanClinicalPictures'),
GENETICS: patientPage('Genetics', 'patient.genetics', true),
HNF1B_CLINICAL_PICTURES: patientPage('Clinical Pictures', 'patient.hnf1bClinicalPictures'),
HOSPITALISATIONS: patientPage('Hospitalisations', 'patient.hospitalisations'),
Expand Down
1 change: 1 addition & 0 deletions src/app/patients/patients.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'radar.patients.familyHistory',
'radar.patients.fetalAnomalyScans',
'radar.patients.fetalUltrasounds',
'radar.patients.fuan',
'radar.patients.genetics',
'radar.patients.hnf1b',
'radar.patients.hospitalisations',
Expand Down

0 comments on commit 9780156

Please sign in to comment.