-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/flatten_and_llm' into develop
- Loading branch information
Showing
20 changed files
with
1,103 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Example of using LLMs with FHIRy | ||
git clone https://github.com/dermatologist/fhiry.git@develop | ||
cd fhiry | ||
pip install -e .[llm] | ||
""" | ||
# Import any LLMs that llama_index supports and you have access to | ||
# Require OpenAI API key to use OpenAI LLMs | ||
from llama_index.llms import Vertex | ||
from fhiry.fhirsearch import Fhirsearch | ||
|
||
fs = Fhirsearch(fhir_base_url = "https://hapi.fhir.org/baseR4/") | ||
df = fs.search(resource_type = "Condition", search_parameters = {}) | ||
# print(df.info()) | ||
|
||
# Create a Vertex LLM | ||
llm = Vertex( | ||
model="chat-bison" | ||
) | ||
query = "How many patients have a disease like rheumatoid arthritis?" | ||
_command = fs.llm_query(query, llm) | ||
|
||
print(_command) | ||
|
||
print(df["resource.code.text"].str.contains("rheumatoid arthritis").sum()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.