|
@@ -1,73 +1,81 @@
|
|
|
-<div id="cm-default-{{ $careMonth->uid }}">
|
|
|
- <input type="hidden" class="w-100 mb-2" name="contentText" v-model="contentText">
|
|
|
- <input type="hidden" class="w-100 mb-2" name="contentDetail" v-model="contentDetail">
|
|
|
- <div class="mb-2" style="">
|
|
|
+<div id="cm-entry-{{ $careMonth->uid }}">
|
|
|
+ <div class="mb-2">
|
|
|
<label class="mb-0 d-block d-flex align-items-center">
|
|
|
- <input type="checkbox" v-model="called_patient" name="called_patient" class="mr-1">
|
|
|
- <span>Called the patient</span>
|
|
|
+ <span class="mr-1">Template</span>
|
|
|
+ <select class="form-control form-control-sm" v-model="template">
|
|
|
+ <option value="">-- Select Template --</option>
|
|
|
+ @foreach($cmTemplates as $template)
|
|
|
+ <option value="{{ $template }}">{{ ucwords($template) }}</option>
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
</label>
|
|
|
- <div class="pl-4 mt-2" v-if="called_patient">
|
|
|
- <div class="mb-2">
|
|
|
- <label class="mb-0 d-block d-flex align-items-center">
|
|
|
- <input type="radio" v-model="called_patient_result" name="called_patient_result" class="mr-1" value="no_answer">
|
|
|
- <span>No Answer</span>
|
|
|
- </label>
|
|
|
- <div class="pl-4 mt-2" v-if="called_patient_result === 'no_answer'">
|
|
|
- <div class="mb-2">
|
|
|
- <div class="mb-2">
|
|
|
- <label class="mb-0 d-block d-flex align-items-center">
|
|
|
- <input type="radio" v-model="no_answer_result" name="no_answer_result" value="left_voicemail" class="mr-1">
|
|
|
- <span>Left voicemail on machine</span>
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- <div class="mb-2">
|
|
|
- <label class="mb-0 d-block d-flex align-items-center">
|
|
|
- <input type="radio" v-model="no_answer_result" name="no_answer_result" value="voicemailbox_full" class="mr-1">
|
|
|
- <span>Voicemail box was full</span>
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- <div class="mb-2">
|
|
|
- <label class="mb-0 d-block d-flex align-items-center">
|
|
|
- <input type="radio" v-model="no_answer_result" name="no_answer_result" value="will_try_later" class="mr-1">
|
|
|
- <span>Disconnected w/o voicemail, will try again later</span>
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="mb-2">
|
|
|
- <label class="mb-0 d-block d-flex align-items-center">
|
|
|
- <input type="radio" v-model="called_patient_result" name="called_patient_result" class="mr-1" value="spoke_to_patient">
|
|
|
- Spoke to patient
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- <div class="mb-2">
|
|
|
- <label class="mb-0 d-block d-flex align-items-center">
|
|
|
- <input type="radio" v-model="called_patient_result" name="called_patient_result" class="mr-1" value="spoke_to_other">
|
|
|
- Spoke to someone other than the patient
|
|
|
- </label>
|
|
|
- <div class="pl-4 mt-2" v-if="called_patient_result === 'spoke_to_other'">
|
|
|
- <div class="mb-2">
|
|
|
- <label class="mb-0 d-block d-flex align-items-center">
|
|
|
- <span class="mr-1">Who</span>
|
|
|
- <input type="text" v-model="spoke_to_whom" name="spoke_to_whom" class="form-control form-control-sm"></label>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <input type="hidden" class="w-100 mb-2" name="contentText" v-model="contentText">
|
|
|
+ <input type="hidden" class="w-100 mb-2" name="contentDetail" v-model="contentDetail">
|
|
|
+
|
|
|
+ @foreach($cmTemplates as $template)
|
|
|
+ <div class="mb-2" data-template="{{ $template }}" v-if="template === '{{ $template }}'">
|
|
|
+ <hr class="my-2">
|
|
|
+ <div id="cm-content-{{ $careMonth->uid }}" class="d-none">
|
|
|
+ @include('app/entry-templates/cm/' . $template . '-narration')
|
|
|
</div>
|
|
|
+ @include('app/entry-templates/cm/' . $template)
|
|
|
+ <hr class="my-2">
|
|
|
</div>
|
|
|
+ @endforeach
|
|
|
</div>
|
|
|
<script>
|
|
|
(function() {
|
|
|
- var cmEntryApp = new Vue({
|
|
|
- el: '#cm-default-{{ $careMonth->uid }}',
|
|
|
+ window.cmEntryApp = new Vue({
|
|
|
+ el: '#cm-entry-{{ $careMonth->uid }}',
|
|
|
+ delimiters: ['@{{', '}}'],
|
|
|
data: {
|
|
|
+ template: '',
|
|
|
contentText: '',
|
|
|
contentDetail: '',
|
|
|
- called_patient: '',
|
|
|
+ called_patient: false,
|
|
|
called_patient_result: '',
|
|
|
no_answer_result: '',
|
|
|
spoke_to_whom: '',
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ generateOutput: function() {
|
|
|
+ this.contentDetail = JSON.stringify({
|
|
|
+ called_patient: this.called_patient,
|
|
|
+ called_patient_result: this.called_patient_result,
|
|
|
+ no_answer_result: this.no_answer_result,
|
|
|
+ spoke_to_whom: this.spoke_to_whom,
|
|
|
+ });
|
|
|
+ var self = this;
|
|
|
+ Vue.nextTick(function () {
|
|
|
+ var html = $('#cm-content-{{ $careMonth->uid }}').html();
|
|
|
+ html = $.trim(html
|
|
|
+ .replace(/\s*\<\!----\>\s*/g, '')
|
|
|
+ .replace(/[\r\n]*/g, '')
|
|
|
+ .replace(/\s+/g, ' ')
|
|
|
+ .replace(/<div><\/div>/g, ''));
|
|
|
+ self.contentText = html;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ called_patient: function() {
|
|
|
+ console.log('Changed: called_patient');
|
|
|
+ this.generateOutput();
|
|
|
+ },
|
|
|
+ called_patient_result: function() {
|
|
|
+ console.log('Changed: called_patient_result');
|
|
|
+ this.generateOutput();
|
|
|
+ },
|
|
|
+ no_answer_result: function() {
|
|
|
+ console.log('Changed: no_answer_result');
|
|
|
+ this.generateOutput();
|
|
|
+ },
|
|
|
+ spoke_to_whom: function() {
|
|
|
+ console.log('Changed: spoke_to_whom');
|
|
|
+ this.generateOutput();
|
|
|
+ },
|
|
|
}
|
|
|
});
|
|
|
})();
|