...
 
Commits (6)
......@@ -325,6 +325,7 @@ export default {
loadFile: 'Cargar archivo',
newItem: '+ nuevo elemento',
newNote: 'Nueva nota',
newOdontogram: 'Nuevo Odontograma',
newRequest: 'Nueva solicitud',
newRequestPlus: '+ nuevo pedido',
newUser: 'Nuevo usuario',
......@@ -1414,6 +1415,7 @@ export default {
haveAppointment: 'Y',
haveDoneOrders: 'Y',
noAppointment: 'N',
requestedBy: 'Solicitado por',
ordersDone: 'Pedidos completos',
ordersNotDone: 'Pedidos sin terminar',
patientToCheckIn: 'PAcientes a ingresar',
......@@ -1442,6 +1444,7 @@ export default {
navigation: {
charges: 'Cargos',
notes: 'Notas',
odontogram: 'Odontograma',
orders: 'Ordenes',
procedures: 'Procedimientos',
reports: 'Reportes',
......
......@@ -11,5 +11,5 @@ export default AbstractModel.extend(CanEditRequested, {
top: DS.attr('boolean', { default: false }),
// Asociations
tooth: DS.belongsTo('tooth')
tooth: DS.belongsTo('tooth', { async: false })
});
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'),
requestedBy: DS.attr('string'),
// 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'));
}),
patient: DS.belongsTo('patient'),
tooths: DS.hasMany('tooth', { async: false }),
validations: {
patientTypeAhead: PatientValidation.patientTypeAhead,
......
......@@ -54,6 +54,7 @@ export default AbstractModel.extend(DOBDays, PatientName, {
// Associations
allergies: DS.hasMany('allergy', { async: true }),
diagnoses: DS.hasMany('diagnosis', { async: false }),
odontogram: DS.hasMany('odontogram', { async: false }),
operationReports: DS.hasMany('operation-report', { async: true }),
operativePlans: DS.hasMany('operative-plan', { async: true }),
payments: DS.hasMany('payment', { async: true }),
......
import { get } from '@ember/object';
import AbstractModel from 'hospitalrun/models/abstract';
import DateFormat from 'hospitalrun/mixins/date-format';
import DS from 'ember-data';
......@@ -9,11 +8,6 @@ export default AbstractModel.extend(DateFormat, {
dateOfProcedure: DS.attr('date'),
// Asociations
odontogram: DS.belongsTo('odontogram'),
procedures: DS.hasMany('dentistry-procedure'),
addDentistryProcedure(procedure) {
let procedures = get(this, 'procedures');
procedures.addObject(procedure);
}
odontogram: DS.belongsTo('odontogram', { async: false }),
procedures: DS.hasMany('dentistry-procedure', { async: false })
});
......@@ -6,7 +6,7 @@ import Ember from 'ember';
import config from '../config/environment';
import { walkConfigs, setRTL } from '../utils/locale-utils';
export const DEFAULT_LANGUAGE = config.i18n.defaultLocale || 'en';
export const DEFAULT_LANGUAGE = 'es' || config.i18n.defaultLocale;
export default Service.extend({
i18n: service(),
......
......@@ -10,11 +10,15 @@
margin-bottom: 0;
}
.panel-footer {
padding: 0;
}
.tooth {
display: inline-block;
position: static;
top: -3px;
margin-left: 55px;
margin-right: 60px;
width: 0;
height: auto;
}
......@@ -188,57 +192,97 @@
}
#tl {
display: flex;
left: 30px;
align-items: center;
justify-content: center;
border-left: .5px solid $black;
padding: 0;
height: 80px;
}
#tll {
display: flex;
left: 28px;
align-items: center;
justify-content: center;
border-bottom: .5px solid $black;
border-left: .5px solid $black;
padding: 0;
height: 80px;
}
#tlr {
display: flex;
align-items: center;
justify-content: center;
margin-left: 0;
border-right: .5px solid $black;
border-bottom: .5px solid $black;
padding: 0;
height: 80px;
}
#tr {
display: flex;
align-items: center;
justify-content: center;
margin-left: -1px;
border-right: .5px solid $black;
padding: 0;
height: 80px;
}
#bl {
display: flex;
left: 30px;
align-items: center;
justify-content: center;
border-left: .5px solid $black;
padding: 0;
height: 80px;
}
#bll {
display: flex;
left: 28px;
align-items: center;
justify-content: center;
border-top: .5px solid $black;
border-left: .5px solid $black;
padding: 2px 0;
height: 80px;
}
#blr {
display: flex;
align-items: center;
justify-content: center;
margin-left: 0;
border-top: .5px solid $black;
border-right: .5px solid $black;
padding: 2px 0;
height: 80px;
}
#br {
display: flex;
align-items: center;
justify-content: center;
margin-left: -1px;
border-right: .5px solid $black;
padding: 0;
height: 80px;
}
#panel-body {
padding: 5px;
text-align: center;
}
......@@ -398,6 +398,16 @@ let designDocs = [{
emit([doc.data.status, requestedDate, prescriptionDate, doc._id]);`
),
version: 4
}, {
name: 'odontogram_by_patient_id',
function: generateView('odontogram',
`if (doc._id && (uidx = doc._id.indexOf('_')) > 0 && !doc.data.archived) {
doctype = doc._id.substring(0, uidx);
if (doctype === 'odontogram') {
emit(doc.data.patient);
}
}`),
version: 1
}, {
name: 'patient_by_display_id',
function: generateView('patient', patientListingKey),
......
......@@ -498,6 +498,17 @@ export default AbstractEditController.extend(AddNewPatient, AllergyActions, Char
this.send('openModal', 'patients.notes', model);
},
showAddPatientOdontogram(model) {
if (isEmpty(model)) {
model = this.get('store').createRecord('odontogram', {
visit: this.get('model'),
requestedBy: this.getUserName(),
patient: this.get('model').get('patient')
});
}
this.send('openModal', 'odontogram.edit', model);
},
showAddPhoto() {
let newPatientPhoto = this.get('store').createRecord('photo', {
patient: this.get('model.patient'),
......
......@@ -140,7 +140,7 @@
</a>
</li>
<li role="presentation">
<a href="#odontogram" role="tab" data-toggle="pill" data-test-selector="odontogram-tab">
<a href="#odontograms" role="tab" data-toggle="pill" data-test-selector="odontogram-tab">
{{t 'visits.navigation.odontogram'}}
</a>
</li>
......@@ -352,6 +352,21 @@
</div>
</div>
<div role="tabpanel" class="tab-pane" id="odontograms">
<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>
</div>
{{/unless}}
</div>
......
......@@ -4,7 +4,7 @@ URL="localhost"
PORT="5984"
if [ -z "${1}" ] || [ -z "${2}" ]; then
SECUREHOST="http://hradmin:test@$URL:$PORT"
SECUREHOST="http://couchadmin:test@$URL:$PORT"
else
SECUREHOST="http://$1:$2@$URL:$PORT"
fi
......
......@@ -21,7 +21,7 @@ echo "Setting up HospitalRun main DB"
curl -X PUT $SECUREHOST/main
curl -X PUT $SECUREHOST/main/_security -d '{ "admins": { "names": [], "roles": ["admin"]}, "members": { "names": [], "roles": ["user"]}}'
echo "Configure CouchDB authentication"
curl -X PUT $SECUREHOST/main/_design/auth -d "{\"validate_doc_update\": \"function(newDoc, oldDoc, userCtx) { if(userCtx.roles.indexOf('_admin')!== -1 || userCtx.roles.indexOf('admin')!== -1){ if (newDoc._id.indexOf('_design') === 0 || newDoc._id === 'fhir_audit') { return; }}if (newDoc._id.indexOf('_') !== -1) {var idParts=newDoc._id.split('_');if (idParts.length >= 3) { var allowedTypes=['allergy','appointment','attachment','billingLineItem','customForm','diagnosis','imaging','incCategory','incidentNote','incident','invLocation','invPurchase','invRequest','inventory','invoice','lab','lineItemDetail','lookup','medication','operationReport','operativePlan','option','overridePrice','patientNote','patient','payment','photo','priceProfile','pricing','procCharge','procedure','questionnaire','questionnaireResponse','report','sequence','userRole','visit','vital'];if (allowedTypes.indexOf(idParts[0]) !== -1) {if(newDoc._deleted || newDoc.data) {return;}}}}throw({forbidden: 'Invalid data'});}\"}"
curl -X PUT $SECUREHOST/main/_design/auth -d "{\"validate_doc_update\": \"function(newDoc, oldDoc, userCtx) { if(userCtx.roles.indexOf('_admin')!== -1 || userCtx.roles.indexOf('admin')!== -1){ if (newDoc._id.indexOf('_design') === 0 || newDoc._id === 'fhir_audit') { return; }}if (newDoc._id.indexOf('_') !== -1) {var idParts=newDoc._id.split('_');if (idParts.length >= 3) { var allowedTypes=['allergy','appointment','attachment','billingLineItem','customForm','dentistry-procedure','diagnosis','imaging','incCategory','incidentNote','incident','invLocation','invPurchase','invRequest','inventory','invoice','lab','lineItemDetail','lookup','medication','odontogram','operationReport','operativePlan','option','overridePrice','patientNote','patient','payment','photo','priceProfile','pricing','procCharge','procedure','questionnaire','questionnaireResponse','report','sequence','tooth','userRole','visit','vital'];if (allowedTypes.indexOf(idParts[0]) !== -1) {if(newDoc._deleted || newDoc.data) {return;}}}}throw({forbidden: 'Invalid data'});}\"}"
curl -X PUT $SECUREHOST/_config/http/authentication_handlers -d '"{couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, proxy_authentification_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}"'
curl -X PUT $SECUREHOST/_config/couch_httpd_oauth/use_users_db -d '"true"'
echo "Add hradmin user for use in HospitalRun"
......