...
 
Commits (2)
......@@ -19,6 +19,7 @@ export default Controller.extend(EditPanelProps, {
'invoice',
'lab',
'medication',
'odontogram',
'patient',
'photo',
'procedure',
......
import Controller from '@ember/controller';
export default Controller.extend({
});
......@@ -830,7 +830,7 @@ export default {
pullFrom: 'Traer de',
quantity: 'Cantidad',
remarks: 'Observaciones',
requestedBy: 'Pedido por|',
requestedBy: 'Pedido por',
requestedOn: 'Pedido el',
requests: 'Pedido',
result: 'Resultado',
......@@ -1104,6 +1104,36 @@ export default {
workflow: 'Flujo de trabajo'
}
},
odontogram: {
buttons: {
newButton: '+ Nuevo Odontograma',
addOdontogram: 'Agregar Odontograma',
deleteOdontogram: 'Eliminar Odontograma'
},
labels: {
actions: 'Acciones',
lastModified: 'Ultima Modificacion',
patient: 'Paciente',
toothsType: 'Tipos de dientes'
},
messages: {
noOdontogramsFound: 'No se encontraron odontogramas',
createNewOdontogram: '¿Crear nuevo odontograma?'
},
procedures: {
fracture: 'Fractura',
obturation: 'Obturación',
extraction: 'Extraer',
toExtract: 'A Extraer',
bridge: 'Puente',
delete: 'Borrar'
},
titles: {
editTitle: 'Editar Odontograma',
newTitle: 'Odontograma Nuevo',
odontogramSaved: 'Odontograma guardado'
}
},
operationReport: {
labels: {
additionalNotes: 'Notas adicionales',
......@@ -1159,6 +1189,7 @@ export default {
newImaging: 'Nueva radiografía',
newLab: 'Nuevo laboratorio',
newMedication: 'Nueva medicación',
newOdontogram: 'Nuevo odontograma',
newPatient: 'Paciente nuevo',
newPhoto: 'Nueva foto',
newVisit: 'Nueva visita',
......@@ -1225,6 +1256,7 @@ export default {
imaging: 'Radiografia',
labs: 'Laboratorios',
medication: 'Medicación',
odontogram: 'Odontograma',
photos: 'Fotos',
socialWork: 'Red social',
visits: 'Visitas'
......
......@@ -392,7 +392,7 @@ export default Mixin.create({
'Administrador de Usuario',
'Administrador de Sistema'
],
dentistry: [
odontogram: [
'Profesional',
'Enfermero',
'Hospital Administrator',
......
import AbstractModel from 'hospitalrun/models/abstract';
import CanEditRequested from 'hospitalrun/mixins/can-edit-requested';
import DS from 'ember-data';
export default AbstractModel.extend(CanEditRequested, {
// Attributes
type: DS.attr(),
bottom: DS.attr('boolean', { default: false }),
center: DS.attr('boolean', { default: false }),
left: DS.attr('boolean', { default: false }),
right: DS.attr('boolean', { default: false }),
top: DS.attr('boolean', { default: false }),
// Asociations
tooth: DS.belongsTo('tooth')
});
import { get } from '@ember/object';
import AbstractModel from 'hospitalrun/models/abstract';
import CanEditRequested from 'hospitalrun/mixins/can-edit-requested';
import DateFormat from 'hospitalrun/mixins/date-format';
import DS from 'ember-data';
import Ember from 'ember';
import PatientValidation from 'hospitalrun/utils/patient-validation';
export default AbstractModel.extend(CanEditRequested, DateFormat, {
// Attributes
prescriptionDate: DS.attr('date'),
// Asociations
patient: DS.belongsTo('patient', { async: false }),
tooths: DS.hasMany('tooth'),
addTooth(tooth) {
let tooths = get(this, 'tooths');
tooths.addObject(tooth);
},
requestedDateAsTime: Ember.computed('prescriptionDate', () => {
return this.dateToTime(this.get('prescriptionDate'));
}),
validations: {
patientTypeAhead: PatientValidation.patientTypeAhead,
patient: {
presence: true
}
}
});
import { get } from '@ember/object';
import AbstractModel from 'hospitalrun/models/abstract';
import DateFormat from 'hospitalrun/mixins/date-format';
import DS from 'ember-data';
export default AbstractModel.extend(DateFormat, {
// Attributes
code: DS.attr('string'),
dateOfProcedure: DS.attr('date'),
// Asociations
odontogram: DS.belongsTo('odontogram'),
procedures: DS.hasMany('dentistry-procedure'),
addDentistryProcedure(procedure) {
let procedures = get(this, 'procedures');
procedures.addObject(procedure);
}
});
......@@ -62,6 +62,7 @@ export default AbstractModel.extend({
imaging: DS.hasMany('imaging', { async: true }),
labs: DS.hasMany('lab', { async: true }),
medication: DS.hasMany('medication', { async: true }),
odontogram: DS.hasMany('odontogram', { async: true }),
patient: DS.belongsTo('patient', { async: false }),
patientNotes: DS.hasMany('patient-note', { async: true }),
procedures: DS.hasMany('procedure', { async: true }),
......@@ -76,6 +77,14 @@ export default AbstractModel.extend({
return diagnosisList;
}),
odontogramList: computed('odontogram.[]', function() {
let odontogram = get(this, 'odontogram');
let odontogramList = odontogram.map((o) => {
return o.get('odontogram');
});
return odontogramList;
}),
hasAppointmentLabel: computed('hasAppointment', function() {
let hasAppointment = get(this, 'hasAppointment');
let i18n = get(this, 'i18n');
......
import { inject as controller } from '@ember/controller';
import AbstractEditController from 'hospitalrun/controllers/abstract-edit-controller';
// import Ember from 'ember';
import PatientSubmodule from 'hospitalrun/mixins/patient-submodule';
import UserSession from 'hospitalrun/mixins/user-session';
let toothList = [];
const BUTTONS_GROUP_ID = ['fractura', 'obturacion', 'extraccion', 'extraer', 'puente', 'borrar'];
export default AbstractEditController.extend(PatientSubmodule, UserSession, {
findPatientVisits: false,
showUpdateButton: true,
odontogramController: controller('odontogram'),
actions: {
toggleActive: (id) => {
let element = document.getElementById(id);
if (element.classList.contains('active')) {
return;
} else {
BUTTONS_GROUP_ID.forEach((btnId) => {
if (btnId === id) {
element = document.getElementById(id);
element.classList.add('active');
} else {
element = document.getElementById(btnId);
element.classList.remove('active');
}
});
}
},
click(id) {
let toothCode = id.substring(1, 4);
let toothRegion = id.substring(id, 1);
let procedureTypes = document.getElementById('btn-group');
let element = document.getElementById(id);
let parent = element.parentElement;
let btnActive = this.setBtnActive(procedureTypes);
let tooth = {
code: toothCode,
dateOfProcedure: undefined,
procedure: {
type: btnActive.id,
region: toothRegion
}
};
if (element.classList.contains('removed')) {
let parentEl = element.parentElement;
for (let i = 1; i < parentEl.children.length; i++) {
parent.children[i].classList.remove('removed');
}
this.deleteToGlobalList(tooth);
}
switch (btnActive.id) {
case 'fractura':
switch (toothRegion) {
case 't':
if (element.classList.contains('fracture-top')) {
element.classList.remove('fracture-top');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('fracture-top');
this.addToGlobalList(tooth);
}
break;
case 'l':
if (element.classList.contains('fracture-left')) {
element.classList.remove('fracture-left');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('fracture-left');
this.addToGlobalList(tooth);
}
break;
case 'r':
if (element.classList.contains('fracture-right')) {
element.classList.remove('fracture-right');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('fracture-right');
this.addToGlobalList(tooth);
}
break;
case 'c':
if (element.classList.contains('fracture-center')) {
element.classList.remove('fracture-center');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('fracture-center');
this.addToGlobalList(tooth);
}
break;
case 'b':
if (element.classList.contains('fracture-bottom')) {
element.classList.remove('fracture-bottom');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('fracture-bottom');
this.addToGlobalList(tooth);
}
break;
}
break;
case 'obturacion':
switch (toothRegion) {
case 't':
if (element.classList.contains('obturation-top')) {
element.classList.remove('obturation-top');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('obturation-top');
this.addToGlobalList(tooth);
}
break;
case 'l':
if (element.classList.contains('obturation-left')) {
element.classList.remove('obturation-left');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('obturation-left');
this.addToGlobalList(tooth);
}
break;
case 'r':
if (element.classList.contains('obturation-right')) {
element.classList.remove('obturation-right');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('obturation-right');
this.addToGlobalList(tooth);
}
break;
case 'c':
if (element.classList.contains('obturation-center')) {
element.classList.remove('obturation-center');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('obturation-center');
this.addToGlobalList(tooth);
}
break;
case 'b':
if (element.classList.contains('obturation-bottom')) {
element.classList.remove('obturation-bottom');
this.deleteToGlobalList(tooth);
} else {
element.classList.add('obturation-bottom');
this.addToGlobalList(tooth);
}
break;
}
break;
case 'extraccion':
this.deleteToothForExtraction(toothCode);
for (let i = 1; i < parent.children.length; i++) {
parent.children[i].classList.add('removed');
toothCode = parent.children[i].getAttribute('id');
tooth.procedure.region = toothCode.slice(0, 1);
this.addToGlobalList(tooth);
}
break;
case 'extraer':
break;
case 'puente':
break;
case 'borrar':
break;
}
},
delete(dentistry) {
let controller = this;
this.send('closeModal');
this.showProgressModal();
this.deleteDentistry(dentistry).then(() => {
controller.closeProgressModal();
controller.send(controller.get('afterDeleteAction'), dentistry);
});
}
},
/**
* Devuelve el elemento html del procedimiento cuyo boton esta activo
* @param {*} procedureTypes
*/
setBtnActive(procedureTypes) {
for (let i = 0; i < procedureTypes.children.length; i++) {
if (procedureTypes.children[i].classList.contains('active')) {
return procedureTypes.children[i];
}
}
},
addToGlobalList(tooth) {
let existTooth = false;
let existProcedure = false;
let tmp = {
code: tooth.code,
dateOfProcedure: undefined,
procedures: [{
type: tooth.procedure.type,
regions: [tooth.procedure.region]
}]
};
if (toothList.length === 0) {
toothList.push(tmp);
} else {
toothList.map((t) => {
if (t.code === tooth.code) {
existTooth = true;
t.procedures.map((proc) => {
if (proc.type === tooth.procedure.type) {
existProcedure = true;
proc.regions.push(tooth.procedure.region);
} else if (proc.regions.indexOf(tooth.procedure.region)) {
proc.regions.splice(proc.regions.indexOf(tooth.procedure.region), 1);
}
});
if (!existProcedure) {
t.procedures.push({
regions: [tooth.procedure.region],
type: tooth.procedure.type
});
}
}
});
if (!existTooth) {
toothList.push(tmp);
}
}
},
deleteToGlobalList(tooth) {
if (toothList.length !== 0) {
toothList.map((t) => {
if (t.code === tooth.code) {
t.procedures.map((proc) => {
if (proc.type === tooth.procedure.type) {
proc.regions.splice(proc.regions.indexOf(tooth.procedure.region), 1);
}
});
}
});
}
},
editNewItem() {
this.send('editItem', this.get('model.id'));
},
update() {
if (this.get('model.isNew')) {
let odontogram = this.get('store').createRecord('odontogram', {
patient: this.get('model').get('patient')
});
let tooths = [];
toothList.map((t) => {
let tooth = this.get('store').createRecord('tooth', {
code: t.code,
odontogram: odontogram.get('id')
});
let procs = [];
t.procedures.map((p) => {
let procedure = this.get('store').createRecord('dentistry-procedure', {
tooth: tooth.id,
type: p.type,
bottom: (p.regions.indexOf('b') >= 0) ? true : false,
center: (p.regions.indexOf('c') >= 0) ? true : false,
left: (p.regions.indexOf('l') >= 0) ? true : false,
right: (p.regions.indexOf('r') >= 0) ? true : false,
top: (p.regions.indexOf('t') >= 0) ? true : false
});
procs.push(procedure);
});
tooth.set('procedures', procs);
tooths.push(tooth);
});
odontogram.set('tooths', tooths);
this.set('odontogram', odontogram);
this.saveModel();
}
}
});
\ No newline at end of file
import AbstractEditRoute from 'hospitalrun/routes/abstract-edit-route';
import AddToPatientRoute from 'hospitalrun/mixins/add-to-patient-route';
import ChargeRoute from 'hospitalrun/mixins/charge-route';
import Ember from 'ember';
import moment from 'moment';
import PatientListRoute from 'hospitalrun/mixins/patient-list-route';
import { translationMacro as t } from 'ember-i18n';
export default AbstractEditRoute.extend(AddToPatientRoute, ChargeRoute, PatientListRoute, {
editTitle: t('odontogram.titles.editTitle'),
modelName: 'odontogram',
newTitle: t('odontogram.titles.newTitle'),
actions: {
editNewItem() {
this.controller.send('editNewItem');
},
returnToAllItems() {
this.controller.send('returnToAllItems');
}
},
getNewData() {
return Ember.RSVP.resolve({
selectPatient: true,
prescriptionDate: moment().startOf('day').toDate()
});
}
});
\ No newline at end of file
This diff is collapsed.
import AbstractPagedController from 'hospitalrun/controllers/abstract-paged-controller';
export default AbstractPagedController.extend({
addPermission: 'add_odontogram',
deletePermission: 'delete_odontogram',
startKey: [],
canAdd: function() {
return this.currentUserCan('add_odontogram');
}.property()
});
import AbstractIndexRoute from 'hospitalrun/routes/abstract-index-route';
import UserSession from 'hospitalrun/mixins/user-session';
export default AbstractIndexRoute.extend(UserSession, {
modelName: 'odontogram',
_modelQueryParams() {
let queryParams = {
mapReduce: 'odontogram_by_patient_id'
};
return queryParams;
}
});
\ No newline at end of file
{{#item-listing paginationProps=paginationProps}}
{{#if hasRecords}}
<table class="table">
<thead>
<tr class="table-header">
{{#sortable-column sortBy="patient" sortDesc=sortDesc sortKey=sortKey}}
{{t 'odontogram.labels.patient'}}
{{/sortable-column}}
{{#sortable-column}}
{{t 'odontogram.labels.actions'}}
{{/sortable-column}}
</tr>
</thead>
<tbody>
{{#each model as |odontogram|}}
<tr>
<td>{{odontogram.patient.displayName}}</td>
{{#if canEdit}}
<button
class="btn btn-default neutral"
{{action 'editItem' odontogram bubbles=false }}
>
{{t 'labels.edit'}}
</button>
{{/if}}
{{#if canDelete}}
<button class="btn btn-default warning"
{{action 'delete' odontogram bubbles=false }}>
<span class="octicon octicon-x"></span>
{{t 'buttons.delete'}}
</button>
{{/if}}
</tr>
{{/each}}
</tbody>
</table>
{{else}}
<div class="alert alert-info" data-test-selector="no-odontograms-found">
<p>
{{t 'odontogram.messages.noOdontogramsFound'}}
{{#if canAdd}}
<a href="#" {{action 'newItem'}}>
{{t 'odontogram.messages.createNewOdontogram'}}
</a>
{{/if}}
</p>
</div>
{{/if}}
{{/item-listing}}
import AbstractModuleRoute from 'hospitalrun/routes/abstract-module-route';
import { translationMacro as t } from 'ember-i18n';
export default AbstractModuleRoute.extend({
addCapability: 'add_odontogram',
allowSearch: false,
moduleName: 'odontogram',
newButtonText: t('odontogram.buttons.newButton')
});
......@@ -42,6 +42,10 @@ export default AbstractEditController.extend(AllergyActions, BloodTypes, Diagnos
return this.currentUserCan('add_medication');
}.property(),
canAddOdontogram: function() {
return this.currentUserCan('add_odontogram');
}.property,
canAddPhoto: function() {
let isFileSystemEnabled = this.get('isFileSystemEnabled');
return (this.currentUserCan('add_photo') && isFileSystemEnabled);
......@@ -75,6 +79,10 @@ export default AbstractEditController.extend(AllergyActions, BloodTypes, Diagnos
return this.currentUserCan('delete_medication');
}.property(),
canDeleteOdontogram: function() {
return this.currentUserCan('delete_odontogram');
}.property(),
canDeletePhoto: function() {
return this.currentUserCan('delete_photo');
}.property(),
......@@ -161,6 +169,10 @@ export default AbstractEditController.extend(AllergyActions, BloodTypes, Diagnos
return this.getVisitCollection('medication');
}.property('model.visits.[].medication'),
patientOdontograms: function() {
return this.getVisitCollection('odontogram');
}.property('model.visits.[].odontogram'),
patientProcedures: function() {
let visits = this.get('model.visits');
let operationReports = get(this, 'model.operationReports');
......@@ -303,6 +315,15 @@ export default AbstractEditController.extend(AllergyActions, BloodTypes, Diagnos
}
},
editOdontogram(odontogram) {
if (this.get('canAddOdontogram')) {
if (odontogram.get('canEdit')) {
odontogram.set('returnToPatient', this.get('model.id'));
this.transitionToRoute('odontogram.edit', odontogram);
}
}
},
editOperativePlan(operativePlan) {
let model = operativePlan;
if (isEmpty(model)) {
......@@ -357,6 +378,10 @@ export default AbstractEditController.extend(AllergyActions, BloodTypes, Diagnos
this._addChildObject('medication.edit');
},
newOdontogram() {
this._addChildObject('odontogram.edit');
},
newSurgicalAppointment() {
this.transitionToRoute('appointments.edit', 'newsurgery').then((newRoute) => {
newRoute.currentModel.setProperties({
......@@ -448,6 +473,10 @@ export default AbstractEditController.extend(AllergyActions, BloodTypes, Diagnos
this.send('openModal', 'medication.delete', medication);
},
showDeleteOdontogram(odontogram) {
this.send('openModal', 'odontogram.delete', odontogram);
},
showDeletePhoto(photo) {
this.send('openModal', 'dialog', EmberObject.create({
confirmAction: 'deletePhoto',
......
......@@ -20,6 +20,7 @@
<li role="presentation"><a href="#medication" role="tab" data-toggle="pill" data-test-selector="medication-tab">{{t 'patients.navigation.medication'}}</a></li>
<li role="presentation"><a href="#imaging" role="tab" data-toggle="pill" data-test-selector="imaging-tab">{{t 'patients.navigation.imaging'}}</a></li>
<li role="presentation"><a href="#labs" role="tab" data-toggle="pill" data-test-selector="labs-tab">{{t 'patients.navigation.labs'}}</a></li>
<li role="presentation"><a href="#odontogram" role="tab" data-toggle="pill" data-test-selector="odontogram-tab">{{t 'patients.navigation.odontogram'}}</a></li>
{{#if canAddSocialWork}}
<li role="presentation"><a href="#social" role="tab" data-toggle="pill" data-test-selector="social-tab">{{t 'patients.navigation.socialWork'}}</a></li>
{{/if}}
......@@ -461,6 +462,20 @@
</div>
</div>
{{/if}}
<div role="tabpanel" class="tab-pane" id="odontogram">
<div class="panel">
{{#if canAddOdontogram}}
<div class="panel-heading">
<button type="button" class="btn btn-primary align-right" {{action "newOdontogram" bubbles=false}}>
<span class="octicon octicon-plus"></span>{{t 'patients.buttons.newOdontogram'}}
</button>
</div>
{{/if}}
<div class="panel-body detail-section-content">
{{partial 'patients/odontogram'}}
</div>
</div>
</div>
{{/unless}}
</div>
{{/em-form}}
......
<table class="table">
<tr class="table-header">
<th>{{t 'labels.date'}}</th>
<th>{{t 'labels.requestedBy'}}</th>
<th>{{t 'labels.actions'}}</th>
</tr>
{{#each patientOdontograms as |odontogram|}}
<tr {{action "editOdontogram" odontogram}} class="{{if odontogram.canEdit (if canAddOdontogram "clickable")}}">
<td>{{date-format odontogram.prescriptionDate}}</td>
<td>{{odontogram.status}}</td>
<td>{{odontogram.prescription}}</td>
<td>{{odontogram.requestedBy}}</td>
<td>
{{#if odontogram.canEdit}}
{{#if canAddOdontogram}}
<button type="button" class="btn btn-default neutral" {{action "editOdontogram" odontogram}}>{{t 'labels.edit'}}</button>
{{/if}}
{{#if canDeleteOdontogram}}
<button type="button" class="btn btn-default warning" {{action "showDeleteOdontogram" odontogram bubbles=false }}><span class="octicon octicon-x"></span>{{t 'labels.delete'}}</button>
{{/if}}
{{/if}}
</td>
</tr>
{{/each}}
</table>
......@@ -85,6 +85,10 @@ Router.map(function() {
this.route('search', { path: '/search/:search_text' });
});
this.route('odontogram', function() {
this.route('edit', { path: '/edit/:odontogram_id' });
});
this.route('patients', function() {
this.route('edit', { path: '/edit/:patient_id' });
this.route('reports');
......
......@@ -29,6 +29,7 @@
@import 'components/imaging';
@import 'components/labs';
@import 'components/loading_notice';
@import 'components/odontogram';
@import 'components/pagination';
@import 'components/panel';
@import 'components/patient_history';
......
.btn-primary {
border: 1px solid transparent;
}
.info-primary {
background: #428bca;
}
.panel {
margin-bottom: 0;
}
.tooth {
display: inline-block;
position: static;
top: -3px;
margin-left: 55px;
width: 0;
height: auto;
}
.tooth-bottom {
top: -5px !important;
left: 7px !important;
transform: rotate(180deg);
height: 15px;
}
.tooth-center {
position: relative;
top: -4px;
left: 7px;
border: 1px solid $gray;
background: $white;
cursor: pointer;
width: 25px;
height: 25px;
}
.tooth-left {
top: 1px !important;
left: -12px !important;
float: left;
transform: rotate(270deg);
}
.tooth-number {
display: inline-block !important;
margin-bottom: 5px;
margin-left: 7px;
border-radius: 10px !important;
}
.tooth-right {
top: -24px !important;
left: 51px !important;
float: right;
transform: rotate(90deg);
}
.square {
position: relative;
left: 7px;
border: 1px solid $gray;
-moz-border-radius: 80px 80px 0 15px;
-webkit-border-radius: 80px 80px 0 15px;
border-radius: 80px 80px 0 15px;
background-color: $white;
cursor: pointer;
width: 25px;
height: 15px;
}
.tooth-top {
top: -3px;
border: 1px solid $gray;
border-radius: 80px 80px 0 15px;
background-color: $white;
width: 25px;
height: 15px;
}
.milk-bottom {
top: -5px !important;
left: 12px !important;
transform: rotate(180deg);
height: 13px !important;
}
.milk-center {
position: relative;
top: -4px;
left: 12px;
border: 1px solid $gray;
background: $white;
cursor: pointer;
width: 13px;
height: 13px;
}
.milk-label {
background: #428bca;
}
.milk-left {
top: -4px !important;
left: 0 !important;
float: left;
transform: rotate(270deg);
}
.milk-right {
top: -17px !important;
left: 37px !important;
float: right;
transform: rotate(90deg);
}
.milk-top {
top: -3px;
border: 1px solid $gray;
border-radius: 80px 80px 0 15px;
background-color: $white;
width: 13px;
height: 13px !important;
}
.square-milk {
position: relative;
left: 12px;
border: 1px solid $gray;
-moz-border-radius: 80px 80px 0 15px;
-webkit-border-radius: 80px 80px 0 15px;
border-radius: 80px 80px 0 15px;
background-color: $white;
cursor: pointer;
width: 13px;
height: 13px;
}
.fracture {
&-top {
background: $red_dark;
}
&-left {
background: $red_dark;
}
&-right {
background: $red_dark;
}
&-center {
background: $red_dark;
}
&-bottom {
background: $red_dark;
}
}
.obturation {
&-top {
background: $navy_text;
}
&-left {
background: $navy_text;
}
&-right {
background: $navy_text;
}
&-center {
background: $navy_text;
}
&-bottom {
background: $navy_text;
}
}
.removed {
border: 0 !important;
background: $gray;
}
#tl {
left: 30px;
border-left: .5px solid $black;
padding: 0;
}
#tll {
left: 28px;
border-bottom: .5px solid $black;
border-left: .5px solid $black;
padding: 0;
}
#tlr {
margin-left: 0;
border-right: .5px solid $black;
border-bottom: .5px solid $black;
padding: 0;
}
#tr {
margin-left: -1px;
border-right: .5px solid $black;
padding: 0;
}
#bl {
left: 30px;
border-left: .5px solid $black;
padding: 0;
}
#bll {
left: 28px;
border-top: .5px solid $black;
border-left: .5px solid $black;
padding: 2px 0;
}
#blr {
margin-left: 0;
border-top: .5px solid $black;
border-right: .5px solid $black;
padding: 2px 0;
}
#br {
margin-left: -1px;
border-right: .5px solid $black;
padding: 0;
}
#panel-body {
text-align: center;
}
......@@ -59,6 +59,10 @@ export default AbstractEditController.extend(AddNewPatient, AllergyActions, Char
return this.currentUserCan('add_medication');
}.property(),
canAddOdontogram: function() {
return this.currentUserCan('add_odontogram');
}.property(),
canAddPhoto: function() {
let isFileSystemEnabled = this.get('isFileSystemEnabled');
return (this.currentUserCan('add_photo') && isFileSystemEnabled);
......@@ -88,6 +92,10 @@ export default AbstractEditController.extend(AddNewPatient, AllergyActions, Char
return this.currentUserCan('delete_medication');
}.property(),
canDeleteOdontogram: function() {
return this.currentUserCan('delete_odontogram');
}.property(),
canDeletePhoto: function() {
return this.currentUserCan('delete_photo');
}.property(),
......@@ -133,6 +141,7 @@ export default AbstractEditController.extend(AddNewPatient, AllergyActions, Char
patientImaging: alias('model.imaging'),
patientLabs: alias('model.labs'),
patientMedications: alias('model.medication'),
patientOdontograms: alias('model.odontogram'),
pricingList: null, // This gets filled in by the route
pricingTypes: alias('visitsController.wardPricingTypes'),
physicianList: alias('visitsController.physicianList'),
......@@ -437,6 +446,13 @@ export default AbstractEditController.extend(AddNewPatient, AllergyActions, Char
}
},
editOdontogram(odontogram) {
if (odontogram.get('canEdit')) {
odontogram.set('returnToVisit', this.get('model.id'));
this.transitionToRoute('odontogram.edit', odontogram);
}
},
editOperativePlan(operativePlan) {
let model = operativePlan;
if (isEmpty(model)) {
......@@ -508,6 +524,10 @@ export default AbstractEditController.extend(AddNewPatient, AllergyActions, Char
this._addChildObject('medication.edit');
},
newOdontogram() {
this._addChildObject('odontogram.edit');
},
newReport() {
this._addChildObject('visits.reports.edit');
},
......@@ -528,6 +548,10 @@ export default AbstractEditController.extend(AddNewPatient, AllergyActions, Char
this.send('openModal', 'medication.delete', medication);
},
showDeleteOdontogram(odontogram) {
this.send('openModal', 'odontogram.delete', odontogram);
},
showDeleteProcedure(procedure) {
this.send('openModal', 'visits.procedures.delete', procedure);
},
......
......@@ -139,6 +139,11 @@
{{t 'visits.navigation.reports'}}
</a>
</li>
<li role="presentation">
<a href="#odontogram" role="tab" data-toggle="pill" data-test-selector="odontogram-tab">
{{t 'visits.navigation.odontogram'}}
</a>
</li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="visit-notes">
......
import { moduleFor, test } from 'ember-qunit';
moduleFor('controller:odontogram', 'Unit | Controller | odontogram', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
});