tonic-discharge-guard / old /llamaprompt.py
Tonic's picture
refactor app
09daffd unverified
from huggingface_hub import InferenceClient
client = InferenceClient(api_key="YOUR_HF_TOKEN")
messages = [
{ "role": "user", "content": "" },
{ "role": "assistant", "content": "you are a senior expert medical health practitioner known for their abilities to produce discharge papers. you will recieve patient information and treatment cursus. Produce a complete discharge summary based on the information provided. produce complete discharge summary." },
{ "role": "user", "content": "Patient Name: Patient 1\nGender: Male\nAge: 65 years\n\nPresentation and Diagnosis:\nThe patient was diagnosed with acute myeloid leukemia (AML) in January 2020 based on leukocytosis, thrombocytopenia and anemia. Bone marrow aspiration revealed a hypercellular bone marrow with 50% blasts. The patient was further assessed using flow cytometry and cytogenetics, and molecular panel testing showed aberrations in ASXL1, CEBPA, JAK2, and RUNX1. AML with adverse risk was diagnosed according to genetic risk stratification.\n\nHospital Course:\nAfter one course of induction treatment with the IA regimen, the patient achieved complete remission with low minimal residual disease. Genetic analyses showed negative gene mutations, and the patient received consolidation therapies with the IA regimen and high-dose Ara-c (HiDAC) regimen. However, remission duration only lasted for 11 months, and in November 2020, relapsed BM morphology was detected, indicating relapsed AML with concurrent molecular aberration recurrence. The patient underwent several treatment regimens, including venetoclax combined with azacitidine and chidamide with venetoclax and azacitidine regimen. He achieved complete remission after one course of the chidamide combined regimen.\n\nOutcome:\nThe patient passed away due to disease progression three months after the completion of therapy." },
# { "role": "assistant", "content": "**DISCHARGE SUMMARY**\n\n**Patient Name:** Patient 1\n**Gender:** Male\n**Age:** 65 years\n**Medical Record Number:** [Insert MRN]\n**Date of Admission:** [Insert Date]\n**Date of Discharge:** [Insert Date]\n**Discharge Diagnosis:**\n1. Acute Myeloid Leukemia (AML) with adverse risk\n2. Relapsed AML with molecular aberration recurrence\n\n**History of Present Illness:**\nThe patient was initially diagnosed with Acute Myeloid Leukemia (AML) in January 2020, characterized by leukocytosis, thrombocytopenia, and anemia. Bone marrow aspiration revealed a hypercellular bone marrow with 50% blasts. Further genetic and molecular testing identified aberrations in ASXL1, CEBPA, JAK2, and RUNX1, categorizing the AML as high risk.\n\n**Treatment Course:**\n- The patient underwent induction therapy with the IA regimen, achieving complete remission with minimal residual disease.\n- Consolidation therapies included the IA regimen and high-dose Ara-c (HiDAC) regimen.\n- Despite initial remission, the patient relapsed 11 months later, with detection of relapsed BM morphology and concurrent molecular aberration recurrence.\n- Subsequent treatments included venetoclax combined with azacitidine and a regimen of chidamide with venetoclax and azacitidine, with the latter resulting in complete remission.\n\n**Outcome:**\nUnfortunately, the patient's disease progressed, and he passed away three months after completing the last therapy regimen.\n\n**Discharge Condition:**\nThe patient was discharged in a terminal condition due to disease progression.\n\n**Medications at Discharge:**\n[Insert list of medications the patient was on at the time of discharge, including dosages and frequencies]\n\n**Follow-Up Care:**\nGiven the patient's demise, follow-up care was not applicable. However, the family was counseled regarding the disease progression and the options for bereavement support.\n\n**Instructions to Patient/Family:**\nAt the time of discharge, the patient and family were informed about the terminal nature of the disease and the focus was shifted to palliative care. They were provided with information on hospice care services and bereavement counseling.\n\n**Condition at Time of Discharge:**\nThe patient's condition at discharge was terminal, with evidence of disease progression despite aggressive treatment.\n\n**Certification:**\nI, [Your Name], hereby certify that the information contained in this discharge summary is accurate and complete to the best of my knowledge. I can be reached at [Your Contact Information] for any further questions or clarifications.\n\n**Signature:** [Your Signature]\n**Date:** [Current Date]\n**Title:** Senior Expert Medical Health Practitioner" }
]
stream = client.chat.completions.create(
model="meta-llama/Llama-3.3-70B-Instruct",
messages=messages,
temperature=0.4,
max_tokens=3584,
top_p=0.7,
stream=True
)
for chunk in stream:
print(chunk.choices[0].delta.content)