|
@@ -94,28 +94,4 @@
|
|
|
@endif
|
|
|
</table>
|
|
|
</div>
|
|
|
- <script>
|
|
|
- (function() {
|
|
|
- function init() {
|
|
|
- $('input[type="text"][name="contentText"]').each(function() {
|
|
|
- var elem = this, dynID = 'rx-' + Math.ceil(Math.random() * 1000000);
|
|
|
- $(elem).attr('id', dynID);
|
|
|
- var strengthElem = $(elem).closest('form').find('[name="strength"]')[0],
|
|
|
- dynStrengthsID = 'rx-' + Math.ceil(Math.random() * 1000000) + '-strengths';
|
|
|
- $(strengthElem).attr('id', dynStrengthsID);
|
|
|
- new window.Def.Autocompleter.Prefetch(dynStrengthsID, []);
|
|
|
- new window.Def.Autocompleter.Search(dynID,
|
|
|
- 'https://clinicaltables.nlm.nih.gov/api/rxterms/v3/search?ef=STRENGTHS_AND_FORMS');
|
|
|
- window.Def.Autocompleter.Event.observeListSelections(dynID, function() {
|
|
|
- var autocomp = elem.autocomp;
|
|
|
- var strengths =
|
|
|
- autocomp.getSelectedItemData()[0].data['STRENGTHS_AND_FORMS'];
|
|
|
- if (strengths)
|
|
|
- strengthElem.autocomp.setListAndField(strengths, '');
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- addMCInitializer('patient-rx-list', init);
|
|
|
- })();
|
|
|
- </script>
|
|
|
@endsection
|