|
@@ -274,6 +274,19 @@ $formID = rand(0, 100000);
|
|
|
});
|
|
|
$(elem).attr('ac-initialized', 1);
|
|
|
$(strengthElem).attr('ac-initialized', 1);
|
|
|
+
|
|
|
+ // if medication already filled, fetch and set strenths autocomplete
|
|
|
+ if($.trim($(this).val()) !== '') {
|
|
|
+ $.get('https://clinicaltables.nlm.nih.gov/api/rxterms/v3/search?' +
|
|
|
+ 'terms=' + encodeURIComponent($.trim($(this).val())) +
|
|
|
+ '&maxList=1' +
|
|
|
+ '&ef=STRENGTHS_AND_FORMS', _data => {
|
|
|
+ console.log('ALIX', _data);
|
|
|
+ if(_data && _data.length >= 1 && _data[2].STRENGTHS_AND_FORMS && _data[2].STRENGTHS_AND_FORMS[0]) {
|
|
|
+ strengthElem.autocomp.setListAndField(_data[2].STRENGTHS_AND_FORMS[0], '', true);
|
|
|
+ }
|
|
|
+ }, 'json');
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
isFavorite: function(_item) {
|