|
@@ -695,6 +695,9 @@
|
|
|
.append($('<option/>').attr('value', 1).text(this.currentPrescription_DRUG.clinicalDetailJson.strength))
|
|
|
.val(1);*/
|
|
|
}
|
|
|
+ else if(this.currentPrescriptionType === 'LAB' || this.currentPrescriptionType === 'IMAGING') {
|
|
|
+ this.initICDAutoSuggest();
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
savePrescription: function() {
|
|
@@ -1137,7 +1140,39 @@
|
|
|
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ addICD: function(_category) {
|
|
|
+ this['currentPrescription_' + _category].clinicalDetailJson.icds.push('');
|
|
|
+ Vue.nextTick(() => {
|
|
|
+ this.initICDAutoSuggest();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ initICDAutoSuggest: function() {
|
|
|
+ let self = this;
|
|
|
+ let parentSegment = $('#prescriptions-{{$patient->id}}');
|
|
|
+ parentSegment.find('input[type="text"][data-field="icd"]:not([ac-initialized])').each(function() {
|
|
|
+ var elem = this,
|
|
|
+ dynID = 'icd-' + Math.ceil(Math.random() * 1000000),
|
|
|
+ vueIndex = $(this).attr('data-index'),
|
|
|
+ category = $(this).attr('data-category');
|
|
|
+ $(elem).attr('id', dynID);
|
|
|
+ new window.Def.Autocompleter.Search(dynID,
|
|
|
+ 'https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search?sf=code,name&ef=name', {
|
|
|
+ tableFormat: true,
|
|
|
+ valueCols: [0],
|
|
|
+ colHeaders: ['Code', 'Name'],
|
|
|
+ }
|
|
|
+ );
|
|
|
+ window.Def.Autocompleter.Event.observeListSelections(dynID, function() {
|
|
|
+ let autocomp = elem.autocomp, acData = autocomp.getSelectedItemData();
|
|
|
+ // self.data['next_cc']['list'][vueIndex].icd = acData[0].code;
|
|
|
+ // self.data['next_cc']['list'][vueIndex].memo = acData[0].data['name'];
|
|
|
+ self['currentPrescription_' + category].clinicalDetailJson.icds[vueIndex] = acData[0].code;
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+ $(elem).attr('ac-initialized', 1);
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
mounted: function() {
|
|
|
let self = this;
|