Extract Initial Events V1
LangChain Hub prompt: foundation29/extract_initial_events_v1
Your task is to analyze the following question and answer, and extract the key events that are specific to the patient under discussion.
The key insights are: "name", "dob", "measurementSystem", "weightMetric", "heightCm", "ethnicGroup", "gender", "chronicConditions", "diagnosis", "familyHealthHistory", "familyHealthHistoryDetails", "knownAllergies", "allergiesDetails", "surgicalHistory", "surgicalHistoryDetails", "currentMedications" and "currentMedicationsDetails".
Avoid extracting too generic information that is not specific to the patient. The focus is on the patient's personal medical profile and history.
Present these key new events in a JSON format that includes the insight and the date of the event.
WEIGHT (weightMetric): Always output a single number in KILOGRAMS. If the patient says weight in pounds/lb/libras, convert to kg (divide by 2.205). If they say "kilos" or "kg", use that number. Examples: "68 kilos" → 68; "150 lb" → 68; "11 stone" → 70.
HEIGHT (heightCm): Always output a single number in CENTIMETERS. If the patient says height in meters (e.g. 1,71 or 1.71 or "uno setenta y uno"), convert to cm (multiply by 100 → 171). If they say feet/inches (e.g. 5 ft 8 in, 5'8"), convert to cm (1 ft = 30.48 cm, 1 in = 2.54 cm). Examples: "1,71 m" → 171; "5 foot 8" → 173; "170 cm" → 170.
These are the Patient Documents: {documents}
TODAY'S DATE: {today}
Avoid unnecessary characters or formatting such as triple quotes + JSON before the list of events.
The output format should be EXACTLY as follows:
[ ⟨ "insight": "[name of the patient - always in title case]" or null, "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "name" ⟩, ⟨ "insight": "[date of birth as YYYY-MM-DD]" or null, "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "dob" ⟩, ⟨ "insight": "[weight in kilograms - number only; convert from lb/libras/pounds if needed]" or null, "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "weightMetric" ⟩, ⟨ "insight": "[height in centimeters - number only; convert from meters (1.71→171) or feet/inches if needed]" or null, "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "heightCm" ⟩, ⟨ "insight": "[ethnic group - black african/white european/hispanic latino/south asian/east asian/middle eastern/pacific islander/multiracial other]", "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "ethnicGroup" ⟩, ⟨ "insight": "[gender - male/female/other - always in lower case]", "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "gender" ⟩, ⟨ "insight": "[chronic diagnosis conditions - yes/no]", "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "chronicConditions" ⟩, ⟨ "insight": "[main diagnosis or brief collection of symptoms]" or null, "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "diagnosis" ⟩, ⟨ "insight": "[family health history - yes/no]", "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "familyHealthHistory" ⟩, ⟨ "insight": "[details of family health history]" or null, "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "familyHealthHistoryDetails" ⟩, ⟨ "insight": "[known allergies - yes/no]", "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "knownAllergies" ⟩, ⟨ "insight": "[details of allergies]" or null, "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "allergiesDetails" ⟩, ⟨ "insight": "[surgical history - yes/no]", "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "surgicalHistory" ⟩, ⟨ "insight": "[details of surgical history]" or null, "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "surgicalHistoryDetails" ⟩, ⟨ "insight": "[current medications - yes/no]", "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "currentMedications" ⟩, ⟨ "insight": "[details of current medications]" or null, "date": "date in ISO format (YYYY-MM-DD) or 'unknown' if not present", "key": "currentMedicationsDetails" ⟩, ]
If any of the key insights is not present, if is a free text, output null (not string) for that key. If is a yes/no question, output only "yes" or "no" for that key. If is a multiple choice question, output only the best suited option for that key.
KEY INSIGHTS IN THE VALID FORMAT SPECIFIC ABOVE TO THE PATIENT:
This prompt contains variables shown as ⟨variable_name⟩. Replace them with your own values before using.
How to Use
Use with LangChain: hub.pull("foundation29/extract_initial_events_v1")
Related Prompts
More prompts in Data & Analytics
Sql Agent System Prompt
LangChain Hub prompt: langchain-ai/sql-agent-system-prompt
Buyer Persona Legend
Generate detailed User Personas for your Business with data neatly organized into a table.
Prompt For Text To SQL
Prompt for text-to-SQL
Unlock Etsy Success 2024
This prompt will help you take your Etsy store to the next level.
A Prompt To Generate Multiple Variations Of A Vector Store Query For Use In A MultiQueryRetriever
A prompt to generate multiple variations of a vector store query for use in a MultiQueryRetriever
Text To Postgres Sql
LangChain Hub prompt: jacob/text-to-postgres-sql