This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added paymentState to visit — Fixes #464 Create an administrative screen where workflow rules can be toggled on/off Fixes #462
- Loading branch information
Showing
9 changed files
with
175 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import AbstractEditController from 'hospitalrun/controllers/abstract-edit-controller'; | ||
export default AbstractEditController.extend({ | ||
hideCancelButton: true, | ||
updateCapability: 'update_config', | ||
|
||
afterUpdate: function() { | ||
this.displayAlert(this.get('i18n').t('admin.workflow.titles.options_saved'), this.get('i18n').t('admin.workflow.messages.options_saved')); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import AbstractEditRoute from 'hospitalrun/routes/abstract-edit-route'; | ||
import { translationMacro as t } from 'ember-i18n'; | ||
export default AbstractEditRoute.extend({ | ||
hideNewButton: true, | ||
editTitle: t('admin.workflow.edit_title'), | ||
|
||
model: function() { | ||
var store = this.get('store'); | ||
return store.find('option', 'workflow_options').catch(function() { | ||
// create a new workflow_option if none exists | ||
return store.push(store.normalize('option', { | ||
id: 'workflow_options', | ||
value: { | ||
admissionDeposit: false, | ||
clinicPrepayment: false, | ||
followupPrepayment: false, | ||
outpatientLabPrepayment: false, | ||
outpatientImagingPrepayment: false, | ||
outpatientMedicationPrepayment: false | ||
} | ||
})); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{#edit-panel editPanelProps=editPanelProps}} | ||
<div class="panel panel-primary"> | ||
<div class="panel-body"> | ||
{{#em-form model=model submitButton=false }} | ||
{{em-checkbox label=(t 'admin.workflow.admission_deposit_label') property="value.admissionDeposit"}} | ||
{{em-checkbox label=(t 'admin.workflow.clinic_prepayment_label') property="value.clinicPrepayment"}} | ||
{{em-checkbox label=(t 'admin.workflow.followup_prepayment_label') property="value.followupPrepayment"}} | ||
{{em-checkbox label=(t 'admin.workflow.outpatient_lab_label') property="value.outpatientLabPrepayment"}} | ||
{{em-checkbox label=(t 'admin.workflow.outpatient_imaging_label') property="value.outpatientImagingPrepayment"}} | ||
{{em-checkbox label=(t 'admin.workflow.outpatient_medication_label') property="value.outpatientMedicationPrepayment"}} | ||
{{/em-form}} | ||
</div> | ||
</div> | ||
{{/edit-panel}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Ember from 'ember'; | ||
import { moduleForModel, test } from 'ember-qunit'; | ||
|
||
moduleForModel('visit', 'Unit | Model | visit', { | ||
// Specify the other units that are required for this test. | ||
needs: [ | ||
'ember-validations@validator:local/acceptance', | ||
'ember-validations@validator:local/presence', | ||
'model:procedure', | ||
'model:imaging', | ||
'model:lab', | ||
'model:medication', | ||
'model:patient', | ||
'model:patient-note', | ||
'model:proc-charge', | ||
'model:vital', | ||
'model:visit', | ||
'service:validations' | ||
] | ||
}); | ||
|
||
test('paymentState', function(assert) { | ||
let model = this.subject(); | ||
|
||
Ember.run(() => { | ||
model.setProperties({ | ||
paymentState: 'bad value' | ||
}); | ||
}); | ||
assert.equal(model.get('paymentState'), 'bad value'); | ||
assert.ok(model.errors.paymentState.length, 'there should errors'); | ||
|
||
Ember.run(() => { | ||
model.setProperties({ | ||
paymentState: 'clear' | ||
}); | ||
}); | ||
assert.equal(model.get('paymentState'), 'clear'); | ||
assert.ok(!model.errors.paymentState.length, 'there should be no error'); | ||
}); |