diff --git a/tutorials/Certification_Trainings/Medical_Language_Models/April_2025/Notebooks/Terminology_Demo.ipynb b/tutorials/Certification_Trainings/Medical_Language_Models/April_2025/Notebooks/Terminology_Demo.ipynb new file mode 100644 index 000000000..483435a2b --- /dev/null +++ b/tutorials/Certification_Trainings/Medical_Language_Models/April_2025/Notebooks/Terminology_Demo.ipynb @@ -0,0 +1,120 @@ +{ + "cells": [ + { + "metadata": {}, + "cell_type": "code", + "outputs": [], + "execution_count": null, + "source": [ + "url = \"demo_url\"\n", + "import requests" + ] + }, + { + "metadata": {}, + "cell_type": "code", + "outputs": [], + "execution_count": null, + "source": [ + "valuesets = requests.get(url + \"/api/valuesets\")\n", + "valuesets.json()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "vs_metadata = requests.get(url+\"/api/valueset_details/10\")\n", + "vs_metadata.json()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2025-04-10T14:46:21.924929Z", + "start_time": "2025-04-10T14:46:21.918887Z" + } + }, + "outputs": [], + "source": [ + "def search_concept(chunks: list, topk: int = 3, vocabulary=[], domain_id=[], search_type=\"\", filter_by_valueset=False, valueset_metadata_ids=[]):\n", + " search_url = url + \"/search\"\n", + " payload = {\"chunks\": chunks,\n", + " \"topk\": topk,\n", + " \"vocabulary_id\": vocabulary,\n", + " \"domain_id\": domain_id,\n", + " \"search_type\": search_type,\n", + " \"filter_by_valueset\": filter_by_valueset,\n", + " \"valueset_metadata_ids\": valueset_metadata_ids}\n", + "\n", + " result = requests.post(search_url, json=payload)\n", + " return result.json()\n", + "\n", + "\n", + "def search_concept_with_vocabs(chunk: str, vocabulary, target_vocabulary):\n", + " search_url = url + \"/search\"\n", + " result = requests.post(search_url, json={\"chunks\": [chunk],\n", + " \"topk\": 1,\n", + " \"vocabulary_id\": [vocabulary],\n", + " \"source_vocabulary\": vocabulary,\n", + " \"target_vocabulary\": target_vocabulary})\n", + " return result.json()\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2025-04-10T14:47:03.777470Z", + "start_time": "2025-04-10T14:47:02.573031Z" + } + }, + "outputs": [], + "source": [ + "search_concept(\n", + " ['hypertension'],\n", + " # domain_id=['Condition'],\n", + " # topk=2,\n", + " # search_type=\"exact\",\n", + " # filter_by_valueset=True,\n", + " # valueset_metadata_ids = [10]\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "search_concept_with_vocabs(\"hypertension\", vocabulary=\"ICD10CM\", target_vocabulary=\"UMLS\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/tutorials/Certification_Trainings/Medical_Language_Models/April_2025/Slides/Terminology Server 202504.pdf b/tutorials/Certification_Trainings/Medical_Language_Models/April_2025/Slides/Terminology Server 202504.pdf new file mode 100644 index 000000000..9335021ea Binary files /dev/null and b/tutorials/Certification_Trainings/Medical_Language_Models/April_2025/Slides/Terminology Server 202504.pdf differ