Closed MorganBergen closed 1 month ago
index.html
<link href='https://clinicaltables.nlm.nih.gov/autocomplete-lhc-versions/19.2.4/autocomplete-lhc.min.css' rel="stylesheet">
<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js'></script>
<script src='https://clinicaltables.nlm.nih.gov/autocomplete-lhc-versions/19.2.4/autocomplete-lhc.min.js'></script>
<input type="text" id="condition" placeholder="Condition">
autocomplete-lhc.min.js
new Def.Autocompleter.Search('condition',
'https://clinicaltables.nlm.nih.gov/api/conditions/v3/search');
autocomplete-lhc.min.css
#searchResults{visibility:hidden;color:#000;font-size:100%;z-index:1000}#searchCount{display:none;font-size:90%;background-color:#e3e7ea;padding-left:3px;padding-right:3px;overflow:hidden}#searchHint{display:none;font-weight:400;font-style:italic;font-size:90%;background-color:#e3e7ea;padding-left:3px;padding-right:3px;overflow:hidden}#moreResults{display:none;font-size:90%;background-color:#fff;color:#00f;padding-left:3px;padding-right:3px;border:2px solid #259;border-top-width:0;cursor:pointer}#moreResults:hover{text-decoration:underline}.ansList:focus,.search_field:focus{background-color:#fff8c6}.loading-indicator-container{position:relative;display:inline-block}.loading-indicator-container progress{display:none;position:absolute;bottom:0;left:0;width:100%;height:5px}.loading-indicator-container progress.show{display:inline-block}.auto_complete{width:auto;background-color:#fff;position:relative;overflow:auto;overflow-x:hidden}.auto_complete>ul{margin:0;padding:0;list-style:none}.auto_complete>ul>li{border-bottom:1px solid #dfdfdf;font-size:90%;padding:3px 10px 3px 10px;break-inside:avoid;-webkit-column-break-inside:avoid}.auto_complete>ul>li:last-child{border:0}.auto_complete.multi_col>ul>li:last-child{border-bottom:1px solid #dfdfdf}.form_auto_complete{position:absolute;font-weight:400;overflow:hidden}.suggestion{color:#001a33}.auto_complete .selected{background-color:#bcd}.auto_complete li:hover,.auto_complete tr:hover{background-color:#d1e1f0}.auto_complete>ul>li.heading:hover{background-color:#001a33}.heading{background-color:#001a33;color:#fff}.listNum{color:#368325}.ansList.no_match,.search_field.no_match,input[type=text].ansList.no_match{background-color:#f8da74;color:#000;font-style:italic}.ansList.invalid,.search_field.invalid{border:2px solid red}.multi_col{-moz-column-count:2;-webkit-column-count:2;column-count:2;-moz-column-gap:0;-webkit-column-gap:0;column-gap:0}#completionOptionsScroller{background:none repeat scroll 0 0 #fff;border:1px solid #838383;border-top-color:#dfdfdf;overflow-y:auto;padding:0}.searchButton{margin-left:1.2em;border:0;vertical-align:middle}input.search_field,textarea.search_field{background-image:url(./magnifying_glass.png);background-repeat:no-repeat;background-position:right 2px center;padding-right:14px}.ansList.ac_multiple,.ansList.ac_multiple:focus{background-image:url(./down_arrow_gray_10_10.png);background-repeat:no-repeat;background-position:right 2px center;padding-right:14px}@media print{.ansList.ac_multiple,.ansList.ac_multiple:focus,input.search_field,textarea.search_field{background-image:none}}.autocomp_selected{border:1px solid gray;padding:1px;display:inline-block}.autocomp_selected input,.autocomp_selected textarea{border-width:1px;width:100%;box-sizing:border-box}.autocomp_selected ul{list-style-type:none;margin:.5em 0 .25em .25em;padding-left:0}.autocomp_selected li{display:inline-block;border-radius:5px;border:1px solid #444;background-color:#d7dadd;padding-left:.25em;padding-right:.25em;margin-right:.25em;margin-bottom:.25em;white-space:nowrap}.autocomp_selected li>button{border:0;background-color:#d7dadd;font-weight:800;padding-left:.25em;padding-right:.25em;line-height:.9em;padding-bottom:.1em}.autocomp_selected li>button:hover{background-color:#999}.screen_reader_only{height:0;width:0;overflow:hidden;position:fixed;left:-1000px;top:-1000px}#completionOptionsScroller table{border-collapse:collapse;border-style:hidden;width:100%;margin:0;padding:0}#completionOptionsScroller tbody{font-size:90%}#completionOptionsScroller td{border:1px solid #dfdfdf;margin:0;padding:0;padding-left:.25em;padding-right:.75em}#completionOptionsScroller th{border-right:1px solid gray;font-size:85%;background-color:#d7dadd;padding-left:.25em;padding-right:.75em}
update using the api
clinical tables by the nih.gov