From 4553c0167be253f7eff166182eab82672cbc8f29 Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Fri, 17 Apr 2026 12:11:35 +0200 Subject: [PATCH 01/11] pedCardio study definition --- .../xcshareddata/swiftpm/Package.resolved | 9 + .../xcshareddata/xcschemes/LLMonFHIR.xcscheme | 6 +- .../UserStudy/UserStudyChatToolbar.swift | 2 +- LLMonFHIR/Helper/BottomSheet.swift | 2 +- LLMonFHIR/Resources/Localizable.xcstrings | 7 +- .../Supporting Files/UserStudyConfig.plist | 9 + .../AllStudies.swift | 2 +- .../LLMonFHIRStudyDefinitions/PedCardio.swift | 349 ++++++++++++++++++ 8 files changed, 376 insertions(+), 10 deletions(-) create mode 100644 LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift diff --git a/LLMonFHIR.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/LLMonFHIR.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 2f48ba64..fc30aa44 100644 --- a/LLMonFHIR.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/LLMonFHIR.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -361,6 +361,15 @@ "version" : "1.7.1" } }, + { + "identity" : "swift-async-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-async-algorithms.git", + "state" : { + "revision" : "9d349bcc328ac3c31ce40e746b5882742a0d1272", + "version" : "1.1.3" + } + }, { "identity" : "swift-atomics", "kind" : "remoteSourceControl", diff --git a/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme b/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme index 4a482762..4a2957f8 100644 --- a/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme +++ b/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme @@ -79,7 +79,7 @@ + isEnabled = "YES"> + argument = "--mode study:edu.stanford.LLMonFHIR.pedCardioStudy" + isEnabled = "YES"> diff --git a/LLMonFHIR/FHIRInterpretation/UserStudy/UserStudyChatToolbar.swift b/LLMonFHIR/FHIRInterpretation/UserStudy/UserStudyChatToolbar.swift index ffa0f8a4..dd4fee3f 100644 --- a/LLMonFHIR/FHIRInterpretation/UserStudy/UserStudyChatToolbar.swift +++ b/LLMonFHIR/FHIRInterpretation/UserStudy/UserStudyChatToolbar.swift @@ -67,7 +67,7 @@ struct UserStudyChatToolbar: ToolbarContent { Button("No", role: .cancel) {} }, message: { - Text("Do you want to continue?") + Text("Do you want to leave the chat?") } ) } diff --git a/LLMonFHIR/Helper/BottomSheet.swift b/LLMonFHIR/Helper/BottomSheet.swift index 20208783..a619d3a6 100644 --- a/LLMonFHIR/Helper/BottomSheet.swift +++ b/LLMonFHIR/Helper/BottomSheet.swift @@ -19,7 +19,7 @@ struct BottomSheet: View { ScrollView { content .onHeightChange { - height = $0 + 50 + height = $0 + 100 } } } diff --git a/LLMonFHIR/Resources/Localizable.xcstrings b/LLMonFHIR/Resources/Localizable.xcstrings index 2ab5b326..8e12a7c4 100644 --- a/LLMonFHIR/Resources/Localizable.xcstrings +++ b/LLMonFHIR/Resources/Localizable.xcstrings @@ -256,12 +256,11 @@ "comment" : "A button label that dismisses an onboarding hint.", "isCommentAutoGenerated" : true }, - "Do you want to continue?" : { - "comment" : "A message displayed in a confirmation dialog when the user taps the \"Continue\" button in the toolbar.", - "isCommentAutoGenerated" : true - }, "Do you want to end the chat and complete your participation in the study?" : { + }, + "Do you want to leave the chat?" : { + }, "Documents" : { "comment" : "A label displayed above the user's documents.", diff --git a/LLMonFHIR/Supporting Files/UserStudyConfig.plist b/LLMonFHIR/Supporting Files/UserStudyConfig.plist index 73c490f4..02d3aab9 100644 --- a/LLMonFHIR/Supporting Files/UserStudyConfig.plist +++ b/LLMonFHIR/Supporting Files/UserStudyConfig.plist @@ -58,6 +58,15 @@ reportEmail + edu.stanford.LLMonFHIR.pedCardioStudy + + openAIAPIKey + + openAIEndpoint + firebase-function:chat + reportEmail + + diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/AllStudies.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/AllStudies.swift index 99d4534f..19926df7 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/AllStudies.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/AllStudies.swift @@ -12,7 +12,7 @@ public import LLMonFHIRShared extension Study { /// All studies currently available. public static var allStudies: [Study] { - [.usabilityStudy, .gynStudy, .spineAI, .languageStudy] + [.usabilityStudy, .gynStudy, .spineAI, .languageStudy, .pedCardioStudy] } } diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift new file mode 100644 index 00000000..6b886673 --- /dev/null +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift @@ -0,0 +1,349 @@ +// +// This source file is part of the Stanford Spezi project +// +// SPDX-FileCopyrightText: 2026 Stanford University +// +// SPDX-License-Identifier: MIT +// + +// swiftlint:disable all + +public import LLMonFHIRShared + + +extension Study { + /// LLMonFHIR's usability study + public static var pedCardioStudy: Study { + let effectivenessQuestion = Study.Task.Question( + text: "How effective was the LLM in helping to answer your questions concerning your child’s health?", + type: .scale(responseOptions: .effectivenessScale), + isOptional: false + ) + return Study( + id: "edu.stanford.LLMonFHIR.pedCardioStudy", + title: "LLMonFHIR PedCardio", + explainer: "During this study, you’ll complete a survey about your experiences navigating the healthcare system and have the opportunity to ask the chat questions about your health.", + summarizeSingleResourcePrompt: nil, + interpretMultipleResourcesPrompt: .pedCardioStudySystemPrompt, + chatTitleConfig: .default, + initialQuestionnaire: nil, + tasks: [ +// Task( +// id: "t1", +// instructions: """ +// Ask a clarifying question about the most recent diagnosis from your last medical visit or any other questions you might have regarding your health? +// """, +// assistantMessagesLimit: 2...5, // starting at 2 bc we need to factor in the initial msg +// questions: [ +// effectivenessQuestion +// ] +// ), +// Task( +// id: "t2", +// instructions: """ +// Ask if the patient is allowed to play competitive sports or participate in gym class. +// """, +// assistantMessagesLimit: 1...5, +// questions: [effectivenessQuestion] +// ), +// Task( +// id: "t3", +// instructions: """ +// Ask the app for a personalized health recommendation. +// """, +// assistantMessagesLimit: 1...5, +// questions: [effectivenessQuestion] +// ), +// Task( +// id: "t4", +// instructions: """ +// Before we end our session, feel free to ask the app any medical questions you might have related to your health. +// """, +// assistantMessagesLimit: 1...5, +// questions: [ +// effectivenessQuestion, +// .init( +// text: "What surprised you about the LLM’s answer, either positively or negatively?", +// type: .freeText, +// isOptional: true +// ), +// .init( +// text: "Compared to other sources of health information (e.g. websites, doctors), how do you rate the LLM’s responses?", +// type: .scale(responseOptions: .comparisonScale), +// isOptional: false +// ), +// .init( +// text: "What were the most and least useful features of the LLM? Do you have any suggestions to share", +// type: .freeText, isOptional: true +// ), +// .init( +// text: "How has the LLM impacted your ability to manage your child’s health?", +// type: .freeText, +// isOptional: false +// ), +// .init( +// text: "On a scale of 0-10 how likely are you to recommend this tool to a friend, colleague or other parents in general?", +// type: .netPromoterScore(range: 0...10), +// isOptional: false +// ) +// ] +// ), + Task( + id: "t5", + instructions: "Please hit the arrow at the top of your screen to complete the final task", + questions: finalTaskQuestions + ), + Task( + id: "t6", + instructions: "", + questions: postInterventionQuestions + ) + ] + ) + } +} + + +private let finalTaskQuestions = [ + Study.Task.Question( + text: "In the future if you had LLMonFHIR available…", + type: .instructional, + isOptional: false + ), + Study.Task.Question( + text: "How easy would it be to access or obtain information about your child’s medical condition?", + type: .scale(responseOptions: .balancedEaseScale), + isOptional: false + ), + Study.Task.Question( + text: "How frequently do you anticipate having problems learning about your child’s medical condition because of difficulty understanding written information?", + type: .scale(responseOptions: .frequencyOptions), + isOptional: false + ), + Study.Task.Question( + text: "How confident would you be in filling out medical forms for your child by yourself?", + type: .scale(responseOptions: .confidentnessScale), + isOptional: false + ), + Study.Task.Question( + text: "How often do you think you would have someone help you read hospital materials?", + type: .scale(responseOptions: .frequencyOptions), + isOptional: false + ), + Study.Task.Question( + text: "How often would you turn to LLMonFHIR with small questions before reaching out to a healthcare professional?", + type: .scale(responseOptions: .frequencyOptions), + isOptional: false + ) +] + + +private let postInterventionQuestions = [ + Study.Task.Question( + text: """ + Please complete the survey below. + + Thank you! + Below are some statements that people sometimes make when they talk about their health. + Please indicate how much you agree or disagree with each statement as it applies to you personally by circling your answer. + Your answers should be what is true for you and not just what you think others want you to say. + + If the statement does not apply to you, select N/A. + (All questions are assessed with Always, Often, Sometimes, Never) + + Please answer these questions based on how you feel with access to an application like LLMonFHIR. + """, + type: .instructional, + isOptional: true + ), + Study.Task.Question( + text: "When all is said and done, I am the person who is responsible for taking care of my / my child’s health", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "Taking an active role in my/ my child’s health care is the most important thing that affects my health and ability to function", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I know what each of my/ my child’s prescribed medications do and what the major or common side effects are", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am confident that I can tell my/ my child’s health care provider/ doctor concerns I have even when he or she does not ask", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am confident that I can tell whether I/ my child need to go get medical care to go to the doctor or whether I can take care of a health problem", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am confident I can help prevent or reduce problems associated with my/ my child’s health", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I know the lifestyle changes like diet and exercise that are recommended for my/ my child’s health condition", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am confident that I/ my child can follow through on medical treatments I/ my child may need to do at home", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am confident that I can take actions that will help prevent or minimize some symptoms or problems associated with my/ my child’s health condition", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am confident that I/ my child can follow through on medical recommendations my/ my child’s health care provider makes, such as changing my diet or doing regular exercise", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I understand the nature and causes of my/ my child’s health condition(s)", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I know the different medical treatment options available for my/ my child’s health condition", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I have / My child has been able to maintain (keep up with) lifestyle changes that I have/ my child has made for my/ my child’s health, like eating right or exercising", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I know how to prevent further problems with my/ my child’s health", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I know about the self-treatments for my/ my child’s health condition", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I have made the changes in my/ my child’s lifestyle like diet and exercise that are recommended for my/ my child’s health condition", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am confident I can figure out solutions when new problems arise with my/ my child’s health", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am able to handle symptoms of my/ my child’s health condition on my own at home", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am confident that I/ my child can maintain lifestyle changes, like eating right and exercising, even during times of stress", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am able to handle problems of my/ my child’s health condition on my own at home", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I am confident I can keep my/ my child’s health problems from interfering with the things I/ my child want(s) to do", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "Maintaining the lifestyle changes that are recommended for my/ my child’s health condition is too hard on a daily basis", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I understand the trajectory of my child’s condition and why they need lifelong cardiology care", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I know what symptoms for which I should call my child’s cardiologist immediately.", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I understand why my child needs or needed surgery to correct their heart lesion", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I understand what future surgeries/interventions, if any, may be required.", + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: #"I now find the language and abbreviations (e.g., "VSD," "echo," "cath") used in my child's medical chart easier to navigate"#, + type: .scale(responseOptions: .frequencyOptions) + ), + Study.Task.Question( + text: "I can confidently describe my child’s heart lesion", + type: .scale(responseOptions: .frequencyOptions) + ) +] + + +extension FHIRPrompt { + fileprivate static let pedCardioStudySystemPrompt: Self = """ + You are the LLMonFHIR agent tasked with helping caregivers of Pediatric Cardiology patients understand their child's heart health, recent procedures, surgeries, and conditions, and answering any questions they have while accessing the child's FHIR health records for additional context. + + You should directly communicate with the caregiver and use the information from the health records to add context to their questions and conversation. + + Prioritize retrieval of historical and current EHR resources directly related to the child’s cardiac care, including encounters, surgeries, catheterizations, echocardiograms, ECGs, medications, and laboratory results from the Cardiology clinic and inpatient encounters and those that involve all cardiology related departments, including and not limited to Cardiothoracic Surgery and Cardiac anesthesia departments. + + Additionally, retrieve relevant records from other clinical contexts only if they are known to influence heart health or surgical outcomes, such as: respiratory conditions (e.g., asthma or anatomic airway workups), genetic consultations, growth and nutrition records (e.g., failure to thrive), or renal function. + + Exclude unrelated medical data unless explicitly requested or clinically linked to their heart condition. + + Throughout the conversation, you MUST use the "get_resources" tool call to obtain the FHIR health resources necessary to answer the caregiver's question correctly. + For example, if the caregiver asks about recent echo results, you must use the "get_resources" tool call to output the FHIR resource titles for DiagnosticReport records so you can then use them to answer. + Use the 'get_resources' tool to get relevant health data, but focus on clear, simple explanations. + Leave out any technical details like JSON, FHIR resources, and other implementation details. + + Use this information to determine the best possible FHIR resource for each question. + Keep the requested resources to a reasonable minimum. + + For example, if the caregiver asks about recent hospital visits, request all recent DocumentReference and DiagnosticReport FHIR resources related to Cardiology Clinic reports and inpatient discharge summaries to obtain clinical notes, operative reports, and diagnostic reports. + + Interpret the resources by explaining the data relevant to the child's heart journey. + Crucially, when interpreting lab results, vital signs, or measurements, you MUST use pediatric reference ranges appropriate for the child's specific age and weight. + Do NOT use adult standards. + + If the child is recovering from surgery or undergoing medication adjustments, you may offer (but not assume) to explain the current care plan. + Do not proactively mention medications unrelated to heart care unless clinically necessary or asked. + + Proactively query for more information if context is missing instead of asking the caregiver for specifics. + Avoid too many follow-up questions. + + Focus heavily on clinical notes, operative notes, catheterization reports, echocardiogram reports, electrocardiogram results, and discharge summaries. + Request recent documents early to get an overview of the child. + + Use simple language. Keep responses in the user's language and the present tense. + Leave out sensitive numbers like SSN or telephone numbers. + + Explain medical context in language understandable by a non-medical parent, aiming for a 5th-grade reading level. + Use words with 1 or 2 syllables when possible. + Use less than 11 words per sentence when feasible. + Keep responses clear and easy to read. Do not compromise accuracy. + Provide factual, precise information in compact summaries. + + When explaining vital signs or lab values, give the full name (e.g., Oxygen Saturation) not just the abbreviation. + + Write like you are talking to a supportive friend. Use a kind, respectful, and emotionally sensitive tone. + Acknowledge the emotional weight of caring for a child with a heart condition without assuming distress unless stated. + + When the caregiver asks about exercise limits or risks, ALWAYS include the child's current age, weight, and specific heart defect. + + Use common, simple language suitable for a parent: + - Explain Congenital Heart Disease as a heart problem that has been present since birth + - Explain Ventricular Septal Defect (VSD) by saying hole between the bottom heart chambers + - Explain Atrial Septal Defect (ASD) by saying hole between the top heart chambers + - Explain Patent Ductus Arteriosus (PDA) by saying extra blood vessel that was necessary prior to birth that stayed open + - Explain Tetralogy of Fallot by saying a heart condition with four specific problems and explain these. + - Explain Stenosis by saying narrowing when pertaining to a valve or a vessel + - Explain Cyanosis by saying blue skin color from low oxygen + - Explain Arrhythmia by saying irregular heartbeat + - Explain Cardiomyopathy by saying weak heart muscle + - Instead of Sternotomy, say incision on the chest bone + - Explain Echocardiogram by saying ultrasound of the heart + - Explain Cardiac Catheterization by saying using a thin tube to fix or check the heart + - Explain Cardiopulmonary Bypass by saying heart-lung machine taking over during surgery + - Explain Fontan Procedure by saying surgery to guide blood flow from the body directly to the lungs + - Instead of Failure to Thrive, say slow weight gain + + Do not introduce yourself at the beginning. + Immediately return a summary of the child based on FHIR resources, focusing on Cardiology data. + Always start the summary by saying: “Hello caregiver of (name) I understand that …”. + Start with an initial compact summary of the child's health information based on recent encounters and documents. + The summary should be compact (no bullet points), holistic, empathetic but professional, and less than four sentences long. + Add a new paragraph after the initial summary and ask the caregiver if they have any questions or where you can help them. + """ +} From ea0ca65f72de0cf98c6cb5e4213692ffacbf6b8b Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Fri, 17 Apr 2026 12:13:41 +0200 Subject: [PATCH 02/11] x --- .../LLMonFHIRStudyDefinitions/PedCardio.swift | 120 +++++++++--------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift index 6b886673..0d373575 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift @@ -28,66 +28,66 @@ extension Study { chatTitleConfig: .default, initialQuestionnaire: nil, tasks: [ -// Task( -// id: "t1", -// instructions: """ -// Ask a clarifying question about the most recent diagnosis from your last medical visit or any other questions you might have regarding your health? -// """, -// assistantMessagesLimit: 2...5, // starting at 2 bc we need to factor in the initial msg -// questions: [ -// effectivenessQuestion -// ] -// ), -// Task( -// id: "t2", -// instructions: """ -// Ask if the patient is allowed to play competitive sports or participate in gym class. -// """, -// assistantMessagesLimit: 1...5, -// questions: [effectivenessQuestion] -// ), -// Task( -// id: "t3", -// instructions: """ -// Ask the app for a personalized health recommendation. -// """, -// assistantMessagesLimit: 1...5, -// questions: [effectivenessQuestion] -// ), -// Task( -// id: "t4", -// instructions: """ -// Before we end our session, feel free to ask the app any medical questions you might have related to your health. -// """, -// assistantMessagesLimit: 1...5, -// questions: [ -// effectivenessQuestion, -// .init( -// text: "What surprised you about the LLM’s answer, either positively or negatively?", -// type: .freeText, -// isOptional: true -// ), -// .init( -// text: "Compared to other sources of health information (e.g. websites, doctors), how do you rate the LLM’s responses?", -// type: .scale(responseOptions: .comparisonScale), -// isOptional: false -// ), -// .init( -// text: "What were the most and least useful features of the LLM? Do you have any suggestions to share", -// type: .freeText, isOptional: true -// ), -// .init( -// text: "How has the LLM impacted your ability to manage your child’s health?", -// type: .freeText, -// isOptional: false -// ), -// .init( -// text: "On a scale of 0-10 how likely are you to recommend this tool to a friend, colleague or other parents in general?", -// type: .netPromoterScore(range: 0...10), -// isOptional: false -// ) -// ] -// ), + Task( + id: "t1", + instructions: """ + Ask a clarifying question about the most recent diagnosis from your last medical visit or any other questions you might have regarding your health? + """, + assistantMessagesLimit: 2...5, // starting at 2 bc we need to factor in the initial msg + questions: [ + effectivenessQuestion + ] + ), + Task( + id: "t2", + instructions: """ + Ask if the patient is allowed to play competitive sports or participate in gym class. + """, + assistantMessagesLimit: 1...5, + questions: [effectivenessQuestion] + ), + Task( + id: "t3", + instructions: """ + Ask the app for a personalized health recommendation. + """, + assistantMessagesLimit: 1...5, + questions: [effectivenessQuestion] + ), + Task( + id: "t4", + instructions: """ + Before we end our session, feel free to ask the app any medical questions you might have related to your health. + """, + assistantMessagesLimit: 1...5, + questions: [ + effectivenessQuestion, + .init( + text: "What surprised you about the LLM’s answer, either positively or negatively?", + type: .freeText, + isOptional: true + ), + .init( + text: "Compared to other sources of health information (e.g. websites, doctors), how do you rate the LLM’s responses?", + type: .scale(responseOptions: .comparisonScale), + isOptional: false + ), + .init( + text: "What were the most and least useful features of the LLM? Do you have any suggestions to share", + type: .freeText, isOptional: true + ), + .init( + text: "How has the LLM impacted your ability to manage your child’s health?", + type: .freeText, + isOptional: false + ), + .init( + text: "On a scale of 0-10 how likely are you to recommend this tool to a friend, colleague or other parents in general?", + type: .netPromoterScore(range: 0...10), + isOptional: false + ) + ] + ), Task( id: "t5", instructions: "Please hit the arrow at the top of your screen to complete the final task", From b8509dd379f4545f6edefd98921f300717cbd41e Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Fri, 17 Apr 2026 12:14:12 +0200 Subject: [PATCH 03/11] x --- .../Sources/LLMonFHIRStudyDefinitions/PedCardio.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift index 0d373575..60d69b6f 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift @@ -22,7 +22,7 @@ extension Study { return Study( id: "edu.stanford.LLMonFHIR.pedCardioStudy", title: "LLMonFHIR PedCardio", - explainer: "During this study, you’ll complete a survey about your experiences navigating the healthcare system and have the opportunity to ask the chat questions about your health.", + explainer: "", summarizeSingleResourcePrompt: nil, interpretMultipleResourcesPrompt: .pedCardioStudySystemPrompt, chatTitleConfig: .default, From faae5d37c2b18bed9a0d9d2da7f346b0d311b14e Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Fri, 17 Apr 2026 15:03:11 +0200 Subject: [PATCH 04/11] add PedCardio synth patients --- .../LLMonFHIRShared/ResourceBundle.swift | 4 +- .../PedCardio/Patient1_HarryPotter.json | 787 ++++++++++++++++++ .../PedCardio/Patient2_MateoRodriguez.json | 739 ++++++++++++++++ .../PedCardio/Patient3_ChloeChen.json | 680 +++++++++++++++ 4 files changed, 2208 insertions(+), 2 deletions(-) create mode 100644 LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient1_HarryPotter.json create mode 100644 LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient2_MateoRodriguez.json create mode 100644 LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient3_ChloeChen.json diff --git a/LLMonFHIRShared/Sources/LLMonFHIRShared/ResourceBundle.swift b/LLMonFHIRShared/Sources/LLMonFHIRShared/ResourceBundle.swift index a1609c5b..ffeacd0d 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRShared/ResourceBundle.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRShared/ResourceBundle.swift @@ -69,7 +69,7 @@ extension ModelsR4.Bundle { do { bundle = try JSONDecoder().decode(ModelsR4.Bundle.self, from: Data(contentsOf: url)) } catch { - Self.logger.warning("Skipping FHIR bundle at \(url.path) (unable to decode): \(error)") + print("Skipping FHIR bundle at \(url.path) (unable to decode): \(error)") continue } if let patientName = bundle.singlePatient?.fullName { @@ -87,7 +87,7 @@ extension ModelsR4.Bundle { } } for (name, urls) in allBundlesByPatientName where urls.count > 1 { - Self.logger.warning("Found multiple FHIR bundles with same patient name '\(name)':\n\(urls.map { "- \($0.path)" }.joined(separator: "\n"))") + print("Found multiple FHIR bundles with same patient name '\(name)':\n\(urls.map { "- \($0.path)" }.joined(separator: "\n"))") } } } diff --git a/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient1_HarryPotter.json b/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient1_HarryPotter.json new file mode 100644 index 00000000..49aaa2df --- /dev/null +++ b/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient1_HarryPotter.json @@ -0,0 +1,787 @@ +{ + "resourceType": "Bundle", + "type": "collection", + "entry": [ + { + "fullUrl": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488", + "resource": { + "resourceType": "Patient", + "id": "55da8d1a-7e9c-4de6-b2f7-e6480ebf7488", + "name": [ + { + "family": "Potter", + "given": ["Harry"], + "text": "Harry Potter" + } + ], + "gender": "male", + "birthDate": "2005-04-10", + "address": [ + { + "line": ["500 University Ave Apt 75"], + "city": "Palo Alto", + "state": "CA", + "postalCode": "94301" + } + ], + "managingOrganization": { + "reference": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f" + }, + "extension": [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "extension": [ + { + "url": "ombCategory", + "valueCoding": { + "system": "urn:oid:2.16.840.1.113883.6.238", + "code": "2106-3", + "display": "White" + } + }, + { + "url": "text", + "valueString": "White" + } + ] + } + ] + } + }, + { + "fullUrl": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f", + "resource": { + "resourceType": "Organization", + "id": "c37e9afa-2d80-4efd-91ce-d193d8b5191f", + "name": "Lucile Packard Children's Hospital (LPCH)", + "address": [ + { + "line": ["725 Welch Rd"], + "city": "Palo Alto", + "state": "CA", + "postalCode": "94303" + } + ] + } + }, + { + "fullUrl": "urn:uuid:042ff4c8-2ea1-433c-8e8c-81c30d657063", + "resource": { + "resourceType": "Organization", + "id": "042ff4c8-2ea1-433c-8e8c-81c30d657063", + "name": "Aetna" + } + }, + { + "fullUrl": "urn:uuid:f4e3aa3c-39cb-44b0-871a-22479cd13afc", + "resource": { + "resourceType": "Condition", + "id": "f4e3aa3c-39cb-44b0-871a-22479cd13afc", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "text": "Hypoplastic left heart syndrome s/p Fontan" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "onsetDateTime": "2005-04-10" + } + }, + { + "fullUrl": "urn:uuid:c387d7a0-ebd9-48a2-8738-0e442fdf5b26", + "resource": { + "resourceType": "Condition", + "id": "c387d7a0-ebd9-48a2-8738-0e442fdf5b26", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "text": "Heart failure" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "onsetDateTime": "2024-02-10" + } + }, + { + "fullUrl": "urn:uuid:d68a9a71-122a-41ef-bd5e-c4e9b5b8f7a9", + "resource": { + "resourceType": "Condition", + "id": "d68a9a71-122a-41ef-bd5e-c4e9b5b8f7a9", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "text": "Sinus Node Dysfunction" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "onsetDateTime": "2024-01-10" + } + }, + { + "fullUrl": "urn:uuid:febfd72f-67bb-4a3a-9a6c-79e9d75c965d", + "resource": { + "resourceType": "MedicationRequest", + "id": "febfd72f-67bb-4a3a-9a6c-79e9d75c965d", + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "text": "Enalapril 7.5 mg tablet" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "dosageInstruction": [ + { + "text": "Take 7.5 mg by mouth once daily" + } + ], + "note": [ + { + "text": "Prescribed to reduce afterload and assist with ventricular remodeling. Monitor for dry cough, renal function, and potassium." + } + ] + } + }, + { + "fullUrl": "urn:uuid:0070cda5-ac7f-4f64-82ac-775b82c21243", + "resource": { + "resourceType": "MedicationRequest", + "id": "0070cda5-ac7f-4f64-82ac-775b82c21243", + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "text": "Dapagliflozin 10 mg tablet" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "dosageInstruction": [ + { + "text": "Take 10 mg by mouth once daily" + } + ], + "note": [ + { + "text": "Reduces cardiovascular mortality risk. Monitor for volume depletion and urinary tract infections; maintain hydration." + } + ] + } + }, + { + "fullUrl": "urn:uuid:50a13f7b-dbf8-4c4c-82e2-693731b8f1b7", + "resource": { + "resourceType": "MedicationRequest", + "id": "50a13f7b-dbf8-4c4c-82e2-693731b8f1b7", + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "text": "Metoprolol 25 mg tablet" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "dosageInstruction": [ + { + "text": "Take 25 mg by mouth once daily" + } + ], + "note": [ + { + "text": "Used for heart rate control. Monitor for bradycardia, hypotension and fatigue." + } + ] + } + }, + { + "fullUrl": "urn:uuid:24cf4709-fbf4-456a-9863-4e7c84db8c39", + "resource": { + "resourceType": "MedicationRequest", + "id": "24cf4709-fbf4-456a-9863-4e7c84db8c39", + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "text": "Spironolactone 25 mg tablet" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "dosageInstruction": [ + { + "text": "Take 25 mg by mouth twice daily" + } + ], + "note": [ + { + "text": "Aldosterone antagonist" + } + ] + } + }, + { + "fullUrl": "urn:uuid:a35086b0-4c52-4b20-8d31-21f82936a015", + "resource": { + "resourceType": "MedicationRequest", + "id": "a35086b0-4c52-4b20-8d31-21f82936a015", + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "text": "Furosemide 40 mg tablet" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "dosageInstruction": [ + { + "text": "Take 40 mg by mouth once daily" + } + ], + "note": [ + { + "text": "Management of fluid overload. Dose adjusted based on weight and fluid status." + } + ] + } + }, + { + "fullUrl": "urn:uuid:f9501c02-3055-40d8-a0ab-282e0bc9aef3", + "resource": { + "resourceType": "Observation", + "id": "f9501c02-3055-40d8-a0ab-282e0bc9aef3", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood pressure panel with all children optional" + } + ], + "text": "Blood pressure" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "effectiveDateTime": "2026-02-15", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic blood pressure" + } + ], + "text": "Systolic blood pressure" + }, + "valueQuantity": { + "value": 109, + "unit": "mmHg", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic blood pressure" + } + ], + "text": "Diastolic blood pressure" + }, + "valueQuantity": { + "value": 67, + "unit": "mmHg", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + } + }, + { + "fullUrl": "urn:uuid:d5a0e4a2-8f77-44b7-ac31-67982c5f4098", + "resource": { + "resourceType": "Observation", + "id": "d5a0e4a2-8f77-44b7-ac31-67982c5f4098", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "39156-5", + "display": "Body mass index (BMI) [Ratio]" + } + ], + "text": "Body mass index" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "effectiveDateTime": "2026-02-15", + "valueQuantity": { + "value": 21.34, + "unit": "kg/m2", + "system": "http://unitsofmeasure.org", + "code": "kg/m2" + } + } + }, + { + "fullUrl": "urn:uuid:335a6175-b656-4f53-8e53-119a2cafd690", + "resource": { + "resourceType": "Observation", + "id": "335a6175-b656-4f53-8e53-119a2cafd690", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body weight" + } + ], + "text": "Body weight" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "effectiveDateTime": "2026-02-15", + "valueQuantity": { + "value": 52.6, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + } + } + }, + { + "fullUrl": "urn:uuid:c9fad815-b49c-4ac2-b209-f72535996adc", + "resource": { + "resourceType": "Observation", + "id": "c9fad815-b49c-4ac2-b209-f72535996adc", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body height" + } + ], + "text": "Body height" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "effectiveDateTime": "2026-02-15", + "valueQuantity": { + "value": 158, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + } + }, + { + "fullUrl": "urn:uuid:adfdb36d-0662-4f7c-abd5-0d6b1fdac2af", + "resource": { + "resourceType": "Immunization", + "id": "adfdb36d-0662-4f7c-abd5-0d6b1fdac2af", + "status": "completed", + "vaccineCode": { + "text": "Influenza vaccine" + }, + "patient": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "occurrenceDateTime": "2025-10-07" + } + }, + { + "fullUrl": "urn:uuid:6f8b912e-c44a-4b4d-a55b-214083a29c07", + "resource": { + "resourceType": "Immunization", + "id": "6f8b912e-c44a-4b4d-a55b-214083a29c07", + "status": "completed", + "vaccineCode": { + "text": "COVID-19 vaccine" + }, + "patient": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "occurrenceDateTime": "2025-10-07" + } + }, + { + "fullUrl": "urn:uuid:25b3d70f-e837-4e78-b519-744e98a5ab30", + "resource": { + "resourceType": "Observation", + "id": "25b3d70f-e837-4e78-b519-744e98a5ab30", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "social-history", + "display": "Social History" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Tobacco smoking status NHIS" + } + ], + "text": "Tobacco use" + }, + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "effectiveDateTime": "2026-02-15", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "266919005", + "display": "Never smoker (finding)" + } + ], + "text": "Never smoked" + } + } + }, + { + "fullUrl": "urn:uuid:83fed01a-1105-45c5-bc8c-8f166a83ffb0", + "resource": { + "resourceType": "Coverage", + "id": "83fed01a-1105-45c5-bc8c-8f166a83ffb0", + "status": "active", + "beneficiary": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "payor": [ + { + "reference": "urn:uuid:042ff4c8-2ea1-433c-8e8c-81c30d657063" + } + ], + "type": { + "text": "Health insurance" + } + } + }, + { + "fullUrl": "urn:uuid:17cda797-f847-46ce-aa04-3642d7d734e4", + "resource": { + "resourceType": "Encounter", + "id": "17cda797-f847-46ce-aa04-3642d7d734e4", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "General cardiology follow up" + } + ], + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "serviceProvider": { + "reference": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f" + }, + "period": { + "start": "2023-04-12" + } + } + }, + { + "fullUrl": "urn:uuid:47852827-64c3-4f0c-a9e7-2f8f7c2d84e6", + "resource": { + "resourceType": "Encounter", + "id": "47852827-64c3-4f0c-a9e7-2f8f7c2d84e6", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "General cardiology follow up" + } + ], + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "serviceProvider": { + "reference": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f" + }, + "period": { + "start": "2023-05-10" + } + } + }, + { + "fullUrl": "urn:uuid:dfb32be1-2ea7-4772-a6a6-b1ecf7f3f4ef", + "resource": { + "resourceType": "Encounter", + "id": "dfb32be1-2ea7-4772-a6a6-b1ecf7f3f4ef", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "General cardiology follow up" + } + ], + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "serviceProvider": { + "reference": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f" + }, + "period": { + "start": "2023-10-14" + } + } + }, + { + "fullUrl": "urn:uuid:7d2133b5-971c-45f7-8c47-e60674599f9b", + "resource": { + "resourceType": "Encounter", + "id": "7d2133b5-971c-45f7-8c47-e60674599f9b", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "EP initial visit" + } + ], + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "serviceProvider": { + "reference": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f" + }, + "period": { + "start": "2024-03-15" + } + } + }, + { + "fullUrl": "urn:uuid:d8a59335-7a04-4bb0-a1fa-c47b6f27d5c9", + "resource": { + "resourceType": "Encounter", + "id": "d8a59335-7a04-4bb0-a1fa-c47b6f27d5c9", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "EP and general cardiology follow up" + } + ], + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "serviceProvider": { + "reference": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f" + }, + "period": { + "start": "2025-04-10" + } + } + }, + { + "fullUrl": "urn:uuid:bb735f83-e0e5-430a-a1fa-82ea34f66eac", + "resource": { + "resourceType": "Encounter", + "id": "bb735f83-e0e5-430a-a1fa-82ea34f66eac", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "General cardiology follow up" + } + ], + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "serviceProvider": { + "reference": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f" + }, + "period": { + "start": "2025-09-07" + } + } + }, + { + "fullUrl": "urn:uuid:c8e1f3df-4e92-4ddc-9ecc-293c98792a7e", + "resource": { + "resourceType": "Encounter", + "id": "c8e1f3df-4e92-4ddc-9ecc-293c98792a7e", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "IMP", + "display": "inpatient" + }, + "type": [ + { + "text": "Admission to LPCH for heart failure" + } + ], + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "serviceProvider": { + "reference": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f" + }, + "period": { + "start": "2025-10-04" + } + } + }, + { + "fullUrl": "urn:uuid:af339b43-3621-4e54-b4ca-500f6e42c421", + "resource": { + "resourceType": "Encounter", + "id": "af339b43-3621-4e54-b4ca-500f6e42c421", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "Heart failure follow up" + } + ], + "subject": { + "reference": "urn:uuid:55da8d1a-7e9c-4de6-b2f7-e6480ebf7488" + }, + "serviceProvider": { + "reference": "urn:uuid:c37e9afa-2d80-4efd-91ce-d193d8b5191f" + }, + "period": { + "start": "2026-01-04" + } + } + } + ] +} diff --git a/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient2_MateoRodriguez.json b/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient2_MateoRodriguez.json new file mode 100644 index 00000000..48da3080 --- /dev/null +++ b/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient2_MateoRodriguez.json @@ -0,0 +1,739 @@ +{ + "resourceType": "Bundle", + "type": "collection", + "entry": [ + { + "fullUrl": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073", + "resource": { + "resourceType": "Patient", + "id": "2c8550d6-77d5-4d92-9966-1a8fdabf6073", + "name": [ + { + "family": "Rodriguez", + "given": [ + "Mateo" + ], + "text": "Mateo Rodriguez" + } + ], + "gender": "male", + "birthDate": "2025-10-12", + "address": [ + { + "line": [ + "456 Blossom Hill Rd" + ], + "city": "San Jose", + "state": "CA", + "postalCode": "95123" + } + ], + "managingOrganization": { + "reference": "urn:uuid:da5b91dc-7e25-4797-8843-064f9ec376ba" + }, + "contact": [ + { + "relationship": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0131", + "code": "N", + "display": "Next of kin" + } + ], + "text": "Parents" + } + ], + "name": { + "text": "Maria and Carlos Rodriguez" + } + } + ], + "extension": [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", + "extension": [ + { + "url": "ombCategory", + "valueCoding": { + "system": "urn:oid:2.16.840.1.113883.6.238", + "code": "2135-2", + "display": "Hispanic or Latino" + } + }, + { + "url": "text", + "valueString": "Hispanic or Latino" + } + ] + } + ] + } + }, + { + "fullUrl": "urn:uuid:da5b91dc-7e25-4797-8843-064f9ec376ba", + "resource": { + "resourceType": "Organization", + "id": "da5b91dc-7e25-4797-8843-064f9ec376ba", + "name": "Lucile Packard Children's Hospital (LPCH)", + "address": [ + { + "line": [ + "725 Welch Rd" + ], + "city": "Palo Alto", + "state": "CA", + "postalCode": "94303" + } + ] + } + }, + { + "fullUrl": "urn:uuid:112c7745-04da-4e59-97ee-a65fdf78ff36", + "resource": { + "resourceType": "Organization", + "id": "112c7745-04da-4e59-97ee-a65fdf78ff36", + "name": "Medi-Cal" + } + }, + { + "fullUrl": "urn:uuid:d0e63e04-f1cc-4cbb-bbb4-0c448d3b075e", + "resource": { + "resourceType": "Condition", + "id": "d0e63e04-f1cc-4cbb-bbb4-0c448d3b075e", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "text": "Large perimembranous ventricular septal defect (VSD)" + }, + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "onsetDateTime": "2025-10-13", + "note": [ + { + "text": "Murmur detected on day 2 of life; significant left-to-right shunt." + } + ] + } + }, + { + "fullUrl": "urn:uuid:4cfbc371-fb7f-47e6-a3eb-8fb54411fab8", + "resource": { + "resourceType": "Condition", + "id": "4cfbc371-fb7f-47e6-a3eb-8fb54411fab8", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "text": "Failure to thrive secondary to congestive heart failure" + }, + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "onsetDateTime": "2025-12-15" + } + }, + { + "fullUrl": "urn:uuid:d6548150-28e4-43b0-bfc6-caa9c779bb6f", + "resource": { + "resourceType": "MedicationRequest", + "id": "d6548150-28e4-43b0-bfc6-caa9c779bb6f", + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "text": "Furosemide 2 mg/kg/day" + }, + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "dosageInstruction": [ + { + "text": "Take 2 mg/kg/day divided twice daily" + } + ], + "note": [ + { + "text": "Management of pulmonary overcirculation and edema. Monitoring: Hydration status, Serum electrolytes. Plan: Continue current dose; re-evaluate fluid status at next weight check." + } + ] + } + }, + { + "fullUrl": "urn:uuid:d0316ea6-02e1-4373-85b1-3129f4c983c6", + "resource": { + "resourceType": "Observation", + "id": "d0316ea6-02e1-4373-85b1-3129f4c983c6", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8867-4", + "display": "Heart rate" + } + ], + "text": "Heart rate" + }, + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "effectiveDateTime": "2026-02-15", + "valueQuantity": { + "value": 148, + "unit": "beats/minute", + "system": "http://unitsofmeasure.org", + "code": "/min" + } + } + }, + { + "fullUrl": "urn:uuid:1467c6a2-f8c1-4a51-a083-684aa9985201", + "resource": { + "resourceType": "Observation", + "id": "1467c6a2-f8c1-4a51-a083-684aa9985201", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "9279-1", + "display": "Respiratory rate" + } + ], + "text": "Respiratory rate" + }, + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "effectiveDateTime": "2026-02-15", + "valueQuantity": { + "value": 52, + "unit": "breaths/minute", + "system": "http://unitsofmeasure.org", + "code": "/min" + }, + "note": [ + { + "text": "Mild tachypnea" + } + ] + } + }, + { + "fullUrl": "urn:uuid:edc618f8-f26d-4647-8a0a-9d5f36f28f52", + "resource": { + "resourceType": "Observation", + "id": "edc618f8-f26d-4647-8a0a-9d5f36f28f52", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood pressure panel with all children optional" + } + ], + "text": "Blood pressure" + }, + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "effectiveDateTime": "2026-02-15", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic blood pressure" + } + ], + "text": "Systolic blood pressure" + }, + "valueQuantity": { + "value": 85, + "unit": "mmHg", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic blood pressure" + } + ], + "text": "Diastolic blood pressure" + }, + "valueQuantity": { + "value": 45, + "unit": "mmHg", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + } + }, + { + "fullUrl": "urn:uuid:5d3df43f-2364-411f-84cc-39300caf137b", + "resource": { + "resourceType": "Observation", + "id": "5d3df43f-2364-411f-84cc-39300caf137b", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body weight" + } + ], + "text": "Body weight" + }, + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "effectiveDateTime": "2026-02-15", + "valueQuantity": { + "value": 4.8, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + }, + "note": [ + { + "text": "< 5th percentile" + } + ] + } + }, + { + "fullUrl": "urn:uuid:3e81a819-6a96-4712-a2ff-bb55cdb1dd63", + "resource": { + "resourceType": "Observation", + "id": "3e81a819-6a96-4712-a2ff-bb55cdb1dd63", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body height" + } + ], + "text": "Body height" + }, + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "effectiveDateTime": "2026-02-15", + "valueQuantity": { + "value": 61, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + } + }, + { + "fullUrl": "urn:uuid:b3aafe24-8a62-44b0-b01a-a4a24bd145a9", + "resource": { + "resourceType": "Observation", + "id": "b3aafe24-8a62-44b0-b01a-a4a24bd145a9", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "social-history", + "display": "Social History" + } + ] + } + ], + "code": { + "text": "Household tobacco exposure" + }, + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "effectiveDateTime": "2026-02-15", + "valueBoolean": false + } + }, + { + "fullUrl": "urn:uuid:615076f4-7e31-4bb7-b50c-05909d26a90f", + "resource": { + "resourceType": "Coverage", + "id": "615076f4-7e31-4bb7-b50c-05909d26a90f", + "status": "active", + "beneficiary": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "payor": [ + { + "reference": "urn:uuid:112c7745-04da-4e59-97ee-a65fdf78ff36" + } + ], + "type": { + "text": "Health insurance" + } + } + }, + { + "fullUrl": "urn:uuid:5cb77db4-e672-4510-b602-53c250597296", + "resource": { + "resourceType": "Immunization", + "id": "5cb77db4-e672-4510-b602-53c250597296", + "status": "completed", + "vaccineCode": { + "text": "DTaP" + }, + "patient": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "occurrenceDateTime": "2026-02-15" + } + }, + { + "fullUrl": "urn:uuid:cfa3d0da-d3a7-4e4b-be7f-6f7d982ae01c", + "resource": { + "resourceType": "Immunization", + "id": "cfa3d0da-d3a7-4e4b-be7f-6f7d982ae01c", + "status": "completed", + "vaccineCode": { + "text": "IPV" + }, + "patient": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "occurrenceDateTime": "2026-02-15" + } + }, + { + "fullUrl": "urn:uuid:b39f474e-6e65-45f9-adb1-eb698b82d9f6", + "resource": { + "resourceType": "Immunization", + "id": "b39f474e-6e65-45f9-adb1-eb698b82d9f6", + "status": "completed", + "vaccineCode": { + "text": "HepB" + }, + "patient": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "occurrenceDateTime": "2026-02-15" + } + }, + { + "fullUrl": "urn:uuid:e354c33a-6cac-45a9-96d2-768c9ec082cb", + "resource": { + "resourceType": "Immunization", + "id": "e354c33a-6cac-45a9-96d2-768c9ec082cb", + "status": "completed", + "vaccineCode": { + "text": "Hib" + }, + "patient": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "occurrenceDateTime": "2026-02-15" + } + }, + { + "fullUrl": "urn:uuid:db4c1020-5a9c-4fe3-b247-24dcd4453ce8", + "resource": { + "resourceType": "Immunization", + "id": "db4c1020-5a9c-4fe3-b247-24dcd4453ce8", + "status": "completed", + "vaccineCode": { + "text": "PCV15" + }, + "patient": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "occurrenceDateTime": "2026-02-15" + } + }, + { + "fullUrl": "urn:uuid:e7171082-83e1-413c-8d81-92858f31c37e", + "resource": { + "resourceType": "Immunization", + "id": "e7171082-83e1-413c-8d81-92858f31c37e", + "status": "completed", + "vaccineCode": { + "text": "Rotavirus" + }, + "patient": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "occurrenceDateTime": "2026-02-15" + } + }, + { + "fullUrl": "urn:uuid:d80e436e-178f-445d-9a2a-36b89a7980e7", + "resource": { + "resourceType": "Immunization", + "id": "d80e436e-178f-445d-9a2a-36b89a7980e7", + "status": "completed", + "vaccineCode": { + "text": "RSV monoclonal antibody (Nirsevimab)" + }, + "patient": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "occurrenceDateTime": "2025-10-14" + } + }, + { + "fullUrl": "urn:uuid:64c5bebb-4b32-423b-8f89-3c51b26a9a66", + "resource": { + "resourceType": "Encounter", + "id": "64c5bebb-4b32-423b-8f89-3c51b26a9a66", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "Initial newborn cardiology consult" + } + ], + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "serviceProvider": { + "reference": "urn:uuid:da5b91dc-7e25-4797-8843-064f9ec376ba" + }, + "period": { + "start": "2025-10-18" + }, + "note": [ + { + "text": "Initial newborn cardiology consult" + } + ] + } + }, + { + "fullUrl": "urn:uuid:4b38051c-7048-4ab7-a29e-4e56099ddb01", + "resource": { + "resourceType": "Encounter", + "id": "4b38051c-7048-4ab7-a29e-4e56099ddb01", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "1-month follow-up" + } + ], + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "serviceProvider": { + "reference": "urn:uuid:da5b91dc-7e25-4797-8843-064f9ec376ba" + }, + "period": { + "start": "2025-11-15" + }, + "note": [ + { + "text": "1-month follow-up; mild tachypnea without work of breathing; good weight gain." + } + ] + } + }, + { + "fullUrl": "urn:uuid:de1d3b28-dc6b-4eae-a774-b40d5cb12683", + "resource": { + "resourceType": "Encounter", + "id": "de1d3b28-dc6b-4eae-a774-b40d5cb12683", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "2-month follow-up" + } + ], + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "serviceProvider": { + "reference": "urn:uuid:da5b91dc-7e25-4797-8843-064f9ec376ba" + }, + "period": { + "start": "2025-12-15" + }, + "note": [ + { + "text": "2-month follow-up; increased work of breathing; initiated furosemide." + } + ] + } + }, + { + "fullUrl": "urn:uuid:797a4b9a-a63e-4d0f-b377-821f20f2681d", + "resource": { + "resourceType": "Encounter", + "id": "797a4b9a-a63e-4d0f-b377-821f20f2681d", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "3-month follow-up" + } + ], + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "serviceProvider": { + "reference": "urn:uuid:da5b91dc-7e25-4797-8843-064f9ec376ba" + }, + "period": { + "start": "2026-01-15" + }, + "note": [ + { + "text": "3-month follow-up; poor weight gain noted; formula fortified to 24 kcal/oz." + } + ] + } + }, + { + "fullUrl": "urn:uuid:2fa2d2c5-479c-4276-96f3-152647e495eb", + "resource": { + "resourceType": "Encounter", + "id": "2fa2d2c5-479c-4276-96f3-152647e495eb", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "4-month follow-up" + } + ], + "subject": { + "reference": "urn:uuid:2c8550d6-77d5-4d92-9966-1a8fdabf6073" + }, + "serviceProvider": { + "reference": "urn:uuid:da5b91dc-7e25-4797-8843-064f9ec376ba" + }, + "period": { + "start": "2026-02-15" + }, + "note": [ + { + "text": "4-month follow-up; weight trajectory remains poor; discussed surgical VSD closure." + } + ] + } + } + ] +} diff --git a/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient3_ChloeChen.json b/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient3_ChloeChen.json new file mode 100644 index 00000000..fd76c351 --- /dev/null +++ b/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient3_ChloeChen.json @@ -0,0 +1,680 @@ +{ + "resourceType": "Bundle", + "type": "collection", + "entry": [ + { + "fullUrl": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65", + "resource": { + "resourceType": "Patient", + "id": "b9732ad9-300e-4c9c-b0d2-f064367acf65", + "name": [ + { + "family": "Chen", + "given": [ + "Chloe" + ], + "text": "Chloe Chen" + } + ], + "gender": "female", + "birthDate": "2025-08-28", + "address": [ + { + "line": [ + "123 El Camino Real" + ], + "city": "Menlo Park", + "state": "CA", + "postalCode": "94025" + } + ], + "managingOrganization": { + "reference": "urn:uuid:112a3394-4b02-4288-8f8b-b9479be212dc" + }, + "contact": [ + { + "relationship": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0131", + "code": "N", + "display": "Next of kin" + } + ], + "text": "Parents" + } + ], + "name": { + "text": "David and Emily Chen" + } + } + ], + "extension": [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "extension": [ + { + "url": "ombCategory", + "valueCoding": { + "system": "urn:oid:2.16.840.1.113883.6.238", + "code": "2028-9", + "display": "Asian" + } + }, + { + "url": "text", + "valueString": "Asian" + } + ] + } + ] + } + }, + { + "fullUrl": "urn:uuid:112a3394-4b02-4288-8f8b-b9479be212dc", + "resource": { + "resourceType": "Organization", + "id": "112a3394-4b02-4288-8f8b-b9479be212dc", + "name": "Menlo Park Cardiology Clinic", + "address": [ + { + "line": [ + "123 El Camino Real" + ], + "city": "Menlo Park", + "state": "CA", + "postalCode": "94025" + } + ] + } + }, + { + "fullUrl": "urn:uuid:efd40f94-f37a-48d0-85e9-f016cc655e6d", + "resource": { + "resourceType": "Organization", + "id": "efd40f94-f37a-48d0-85e9-f016cc655e6d", + "name": "Blue Shield of California PPO" + } + }, + { + "fullUrl": "urn:uuid:e657f464-f2c4-4f1d-9e56-2969e7b01795", + "resource": { + "resourceType": "Condition", + "id": "e657f464-f2c4-4f1d-9e56-2969e7b01795", + "clinicalStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code": "active" + } + ] + }, + "verificationStatus": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code": "confirmed" + } + ] + }, + "code": { + "text": "Supraventricular Tachycardia (AVRT)" + }, + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "onsetDateTime": "2025-09-12", + "note": [ + { + "text": "Presented at 2 weeks of life with HR > 280 bpm" + } + ] + } + }, + { + "fullUrl": "urn:uuid:5e8bfe99-a946-489e-872c-157a142ddc5b", + "resource": { + "resourceType": "MedicationRequest", + "id": "5e8bfe99-a946-489e-872c-157a142ddc5b", + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "text": "Amiodarone 25 mg tablet" + }, + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "dosageInstruction": [ + { + "text": "Take 25 mg by mouth daily" + } + ], + "note": [ + { + "text": "Class III antiarrhythmic; indicated for sinus rhythm maintenance after beta-blocker failure. Monitoring: Thyroid Function Tests (TSH, Free T4), Liver Function Tests (AST, ALT). Strategy: Passive weaning (allowing patient to outgrow fixed dose via weight gain)." + } + ] + } + }, + { + "fullUrl": "urn:uuid:227a50ed-fcf7-431c-a95a-353c03ed4c1b", + "resource": { + "resourceType": "MedicationRequest", + "id": "227a50ed-fcf7-431c-a95a-353c03ed4c1b", + "status": "active", + "intent": "order", + "medicationCodeableConcept": { + "text": "Flecainide 15 mg tablet" + }, + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "dosageInstruction": [ + { + "text": "Take 15 mg by mouth twice daily" + } + ], + "note": [ + { + "text": "Class Ic antiarrhythmic; indicated for dual therapy for refractory infant SVT. Monitoring: QRS widening, QTc prolongation, ZioPatch for breakthrough arrhythmia. Strategy: Passive weaning (allowing patient to outgrow fixed dose via weight gain)." + } + ] + } + }, + { + "fullUrl": "urn:uuid:337c4d64-39cc-44fb-8a96-6f52c2764d6d", + "resource": { + "resourceType": "Observation", + "id": "337c4d64-39cc-44fb-8a96-6f52c2764d6d", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8867-4", + "display": "Heart rate" + } + ], + "text": "Heart rate" + }, + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "effectiveDateTime": "2026-02-28", + "valueQuantity": { + "value": 132, + "unit": "beats/minute", + "system": "http://unitsofmeasure.org", + "code": "/min" + }, + "note": [ + { + "text": "Rhythm: Normal sinus" + } + ] + } + }, + { + "fullUrl": "urn:uuid:f4ecab27-acd3-4fd6-809c-12a5ae79e180", + "resource": { + "resourceType": "Observation", + "id": "f4ecab27-acd3-4fd6-809c-12a5ae79e180", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "85354-9", + "display": "Blood pressure panel with all children optional" + } + ], + "text": "Blood pressure" + }, + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "effectiveDateTime": "2026-02-28", + "component": [ + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8480-6", + "display": "Systolic blood pressure" + } + ], + "text": "Systolic blood pressure" + }, + "valueQuantity": { + "value": 92, + "unit": "mmHg", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + }, + { + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8462-4", + "display": "Diastolic blood pressure" + } + ], + "text": "Diastolic blood pressure" + }, + "valueQuantity": { + "value": 54, + "unit": "mmHg", + "system": "http://unitsofmeasure.org", + "code": "mm[Hg]" + } + } + ] + } + }, + { + "fullUrl": "urn:uuid:32785efe-70df-4ef3-a825-df9896d00eb9", + "resource": { + "resourceType": "Observation", + "id": "32785efe-70df-4ef3-a825-df9896d00eb9", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body weight" + } + ], + "text": "Body weight" + }, + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "effectiveDateTime": "2026-02-28", + "valueQuantity": { + "value": 7.5, + "unit": "kg", + "system": "http://unitsofmeasure.org", + "code": "kg" + }, + "note": [ + { + "text": "50th percentile" + } + ] + } + }, + { + "fullUrl": "urn:uuid:a8de0a5a-2d4f-41c3-a472-6552a52a3c50", + "resource": { + "resourceType": "Observation", + "id": "a8de0a5a-2d4f-41c3-a472-6552a52a3c50", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "vital-signs", + "display": "Vital Signs" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body height" + } + ], + "text": "Body height" + }, + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "effectiveDateTime": "2026-02-28", + "valueQuantity": { + "value": 66, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + } + } + }, + { + "fullUrl": "urn:uuid:ab1ddb44-6a75-4d18-ab5e-e1e23a652c91", + "resource": { + "resourceType": "Observation", + "id": "ab1ddb44-6a75-4d18-ab5e-e1e23a652c91", + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "social-history", + "display": "Social History" + } + ] + } + ], + "code": { + "text": "Living arrangement" + }, + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "effectiveDateTime": "2026-02-28", + "valueString": "Lives with parents and one healthy 3-year-old sibling." + } + }, + { + "fullUrl": "urn:uuid:693b0fe4-3f80-4061-9003-d8faa6783ae5", + "resource": { + "resourceType": "Coverage", + "id": "693b0fe4-3f80-4061-9003-d8faa6783ae5", + "status": "active", + "beneficiary": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "payor": [ + { + "reference": "urn:uuid:efd40f94-f37a-48d0-85e9-f016cc655e6d" + } + ], + "type": { + "text": "Health insurance" + } + } + }, + { + "fullUrl": "urn:uuid:da4fb5df-d17b-417e-b00c-911cfe5e7cbc", + "resource": { + "resourceType": "Immunization", + "id": "da4fb5df-d17b-417e-b00c-911cfe5e7cbc", + "status": "completed", + "vaccineCode": { + "text": "DTaP" + }, + "patient": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "occurrenceDateTime": "2026-02-25" + } + }, + { + "fullUrl": "urn:uuid:668ed190-bc6c-4794-83ab-59c454a01d08", + "resource": { + "resourceType": "Immunization", + "id": "668ed190-bc6c-4794-83ab-59c454a01d08", + "status": "completed", + "vaccineCode": { + "text": "IPV" + }, + "patient": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "occurrenceDateTime": "2026-02-25" + } + }, + { + "fullUrl": "urn:uuid:f6c3fdfd-012d-4195-8d3b-9c6068cf37da", + "resource": { + "resourceType": "Immunization", + "id": "f6c3fdfd-012d-4195-8d3b-9c6068cf37da", + "status": "completed", + "vaccineCode": { + "text": "HepB" + }, + "patient": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "occurrenceDateTime": "2026-02-25" + } + }, + { + "fullUrl": "urn:uuid:0a55979a-7df9-4f56-aaea-ae8165592b0e", + "resource": { + "resourceType": "Immunization", + "id": "0a55979a-7df9-4f56-aaea-ae8165592b0e", + "status": "completed", + "vaccineCode": { + "text": "Hib" + }, + "patient": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "occurrenceDateTime": "2026-02-25" + } + }, + { + "fullUrl": "urn:uuid:e73b8ea8-2545-4634-a87b-ec46b95d29ad", + "resource": { + "resourceType": "Immunization", + "id": "e73b8ea8-2545-4634-a87b-ec46b95d29ad", + "status": "completed", + "vaccineCode": { + "text": "PCV15" + }, + "patient": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "occurrenceDateTime": "2026-02-25" + } + }, + { + "fullUrl": "urn:uuid:430c8102-a1b2-4476-9f89-f0f6fee625c3", + "resource": { + "resourceType": "Immunization", + "id": "430c8102-a1b2-4476-9f89-f0f6fee625c3", + "status": "completed", + "vaccineCode": { + "text": "Rotavirus" + }, + "patient": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "occurrenceDateTime": "2026-02-25" + } + }, + { + "fullUrl": "urn:uuid:c32cf302-c91e-4d71-bb57-bf1037d41d5b", + "resource": { + "resourceType": "Encounter", + "id": "c32cf302-c91e-4d71-bb57-bf1037d41d5b", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "EMER", + "display": "emergency" + }, + "type": [ + { + "text": "ED Admission" + } + ], + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "serviceProvider": { + "reference": "urn:uuid:112a3394-4b02-4288-8f8b-b9479be212dc" + }, + "period": { + "start": "2025-09-12" + }, + "note": [ + { + "text": "SVT with poor perfusion; converted with IV Adenosine." + } + ] + } + }, + { + "fullUrl": "urn:uuid:2f947e04-22c7-4c2f-ab0c-11707808bf72", + "resource": { + "resourceType": "Encounter", + "id": "2f947e04-22c7-4c2f-ab0c-11707808bf72", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "IMP", + "display": "inpatient" + }, + "type": [ + { + "text": "CVICU discharge" + } + ], + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "serviceProvider": { + "reference": "urn:uuid:112a3394-4b02-4288-8f8b-b9479be212dc" + }, + "period": { + "start": "2025-09-29" + }, + "note": [ + { + "text": "Discharged on oral Amiodarone and Flecainide." + } + ] + } + }, + { + "fullUrl": "urn:uuid:43f42793-b62d-48a6-9735-27ce49e7ebe2", + "resource": { + "resourceType": "Encounter", + "id": "43f42793-b62d-48a6-9735-27ce49e7ebe2", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "EP Clinic follow-up" + } + ], + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "serviceProvider": { + "reference": "urn:uuid:112a3394-4b02-4288-8f8b-b9479be212dc" + }, + "period": { + "start": "2025-10-15" + }, + "note": [ + { + "text": "Post-discharge follow-up; normal sinus rhythm confirmed." + } + ] + } + }, + { + "fullUrl": "urn:uuid:e5fec410-28eb-4732-b081-447458cbf007", + "resource": { + "resourceType": "Encounter", + "id": "e5fec410-28eb-4732-b081-447458cbf007", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "EP Clinic follow-up" + } + ], + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "serviceProvider": { + "reference": "urn:uuid:112a3394-4b02-4288-8f8b-b9479be212dc" + }, + "period": { + "start": "2025-12-10" + }, + "note": [ + { + "text": "Dosing held steady despite weight gain." + } + ] + } + }, + { + "fullUrl": "urn:uuid:d78e3e00-7d6f-47b9-8cfe-51395eed53ed", + "resource": { + "resourceType": "Encounter", + "id": "d78e3e00-7d6f-47b9-8cfe-51395eed53ed", + "status": "finished", + "class": { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", + "code": "AMB", + "display": "ambulatory" + }, + "type": [ + { + "text": "EP Clinic follow-up" + } + ], + "subject": { + "reference": "urn:uuid:b9732ad9-300e-4c9c-b0d2-f064367acf65" + }, + "serviceProvider": { + "reference": "urn:uuid:112a3394-4b02-4288-8f8b-b9479be212dc" + }, + "period": { + "start": "2026-02-28" + }, + "note": [ + { + "text": "Patient thriving; initiated 6-month passive weaning strategy." + } + ] + } + } + ] +} From c4bc42ddc1781130be6c9b189422c90fbe6e7971 Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Fri, 24 Apr 2026 18:50:33 +0200 Subject: [PATCH 05/11] update Harry Potter BMI --- .../Synthetic Patients/PedCardio/Patient1_HarryPotter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient1_HarryPotter.json b/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient1_HarryPotter.json index 49aaa2df..98b8d27a 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient1_HarryPotter.json +++ b/LLMonFHIRShared/Sources/LLMonFHIRShared/Resources/Synthetic Patients/PedCardio/Patient1_HarryPotter.json @@ -390,7 +390,7 @@ }, "effectiveDateTime": "2026-02-15", "valueQuantity": { - "value": 21.34, + "value": 21.07, "unit": "kg/m2", "system": "http://unitsofmeasure.org", "code": "kg/m2" From 5c9b8fcb7585d32c9be20986cd5695f6d2b812d7 Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Fri, 24 Apr 2026 18:50:40 +0200 Subject: [PATCH 06/11] update PedCardio questions --- .../LLMonFHIRStudyDefinitions/PedCardio.swift | 83 ++++++++++--------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift index 60d69b6f..7410728b 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift @@ -15,7 +15,7 @@ extension Study { /// LLMonFHIR's usability study public static var pedCardioStudy: Study { let effectivenessQuestion = Study.Task.Question( - text: "How effective was the LLM in helping to answer your questions concerning your child’s health?", + text: "How effective was the LLM in helping to answer your questions concerning your child's health?", type: .scale(responseOptions: .effectivenessScale), isOptional: false ) @@ -31,7 +31,7 @@ extension Study { Task( id: "t1", instructions: """ - Ask a clarifying question about the most recent diagnosis from your last medical visit or any other questions you might have regarding your health? + Ask a clarifying question about the most recent diagnosis from your child's last medical visit or any other questions you might have regarding your child's health? """, assistantMessagesLimit: 2...5, // starting at 2 bc we need to factor in the initial msg questions: [ @@ -41,7 +41,7 @@ extension Study { Task( id: "t2", instructions: """ - Ask if the patient is allowed to play competitive sports or participate in gym class. + Ask if the child is allowed to play competitive sports or participate in gym class. """, assistantMessagesLimit: 1...5, questions: [effectivenessQuestion] @@ -49,7 +49,7 @@ extension Study { Task( id: "t3", instructions: """ - Ask the app for a personalized health recommendation. + Ask the app for a personalized health recommendation for your child. """, assistantMessagesLimit: 1...5, questions: [effectivenessQuestion] @@ -57,32 +57,33 @@ extension Study { Task( id: "t4", instructions: """ - Before we end our session, feel free to ask the app any medical questions you might have related to your health. + Before we end our session, feel free to ask the app any medical questions you might have related to your child's health. """, assistantMessagesLimit: 1...5, questions: [ effectivenessQuestion, .init( - text: "What surprised you about the LLM’s answer, either positively or negatively?", + text: "What surprised you about the LLM's answer, either positively or negatively?", type: .freeText, isOptional: true ), .init( - text: "Compared to other sources of health information (e.g. websites, doctors), how do you rate the LLM’s responses?", + text: "Compared to other sources of health information (e.g. websites, doctors), how do you rate the LLM's responses?", type: .scale(responseOptions: .comparisonScale), isOptional: false ), .init( - text: "What were the most and least useful features of the LLM? Do you have any suggestions to share", - type: .freeText, isOptional: true + text: "What were the most and least useful features of the LLM? Do you have any suggestions to share?", + type: .freeText, + isOptional: true ), .init( - text: "How has the LLM impacted your ability to manage your child’s health?", + text: "How has the LLM impacted your ability to manage your child's health?", type: .freeText, isOptional: false ), .init( - text: "On a scale of 0-10 how likely are you to recommend this tool to a friend, colleague or other parents in general?", + text: "On a scale of 0—10 how likely are you to recommend this tool to a friend, colleague or other parents in general?", type: .netPromoterScore(range: 0...10), isOptional: false ) @@ -90,7 +91,7 @@ extension Study { ), Task( id: "t5", - instructions: "Please hit the arrow at the top of your screen to complete the final task", + instructions: "Please hit the arrow at the top of your screen to complete the final task.", questions: finalTaskQuestions ), Task( @@ -111,12 +112,12 @@ private let finalTaskQuestions = [ isOptional: false ), Study.Task.Question( - text: "How easy would it be to access or obtain information about your child’s medical condition?", + text: "How easy would it be to access or obtain information about your child's medical condition?", type: .scale(responseOptions: .balancedEaseScale), isOptional: false ), Study.Task.Question( - text: "How frequently do you anticipate having problems learning about your child’s medical condition because of difficulty understanding written information?", + text: "How frequently do you anticipate having problems learning about your child's medical condition because of difficulty understanding written information?", type: .scale(responseOptions: .frequencyOptions), isOptional: false ), @@ -157,99 +158,99 @@ private let postInterventionQuestions = [ isOptional: true ), Study.Task.Question( - text: "When all is said and done, I am the person who is responsible for taking care of my / my child’s health", + text: "When all is said and done, I am the person who is responsible for taking care of my / my child's health", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "Taking an active role in my/ my child’s health care is the most important thing that affects my health and ability to function", + text: "Taking an active role in my / my child's health care is the most important thing that affects my health and ability to function", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I know what each of my/ my child’s prescribed medications do and what the major or common side effects are", + text: "I know what each of my / my child's prescribed medications do and what the major or common side effects are", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am confident that I can tell my/ my child’s health care provider/ doctor concerns I have even when he or she does not ask", + text: "I am confident that I can tell my / my child's health care provider/ doctor concerns I have even when he or she does not ask", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am confident that I can tell whether I/ my child need to go get medical care to go to the doctor or whether I can take care of a health problem", + text: "I am confident that I can tell whether I / my child need to go get medical care to go to the doctor or whether I can take care of a health problem", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am confident I can help prevent or reduce problems associated with my/ my child’s health", + text: "I am confident I can help prevent or reduce problems associated with my / my child's health", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I know the lifestyle changes like diet and exercise that are recommended for my/ my child’s health condition", + text: "I know the lifestyle changes like diet and exercise that are recommended for my own / my child's health condition", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am confident that I/ my child can follow through on medical treatments I/ my child may need to do at home", + text: "I am confident that I / my child can follow through on medical treatments I / my child may need to do at home", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am confident that I can take actions that will help prevent or minimize some symptoms or problems associated with my/ my child’s health condition", + text: "I am confident that I can take actions that will help prevent or minimize some symptoms or problems associated with my / my child's health condition", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am confident that I/ my child can follow through on medical recommendations my/ my child’s health care provider makes, such as changing my diet or doing regular exercise", + text: "I am confident that I/ my child can follow through on medical recommendations my / my child's health care provider makes, such as changing my diet or doing regular exercise", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I understand the nature and causes of my/ my child’s health condition(s)", + text: "I understand the nature and causes of my / my child's health condition", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I know the different medical treatment options available for my/ my child’s health condition", + text: "I know the different medical treatment options available for my / my child's health condition", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I have / My child has been able to maintain (keep up with) lifestyle changes that I have/ my child has made for my/ my child’s health, like eating right or exercising", + text: "I have / My child has been able to maintain (keep up with) lifestyle changes that I have / my child has made for my / my child's health, like eating right or exercising", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I know how to prevent further problems with my/ my child’s health", + text: "I know how to prevent further problems with my / my child's health", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I know about the self-treatments for my/ my child’s health condition", + text: "I know about the self-treatments for my / my child's health condition", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I have made the changes in my/ my child’s lifestyle like diet and exercise that are recommended for my/ my child’s health condition", + text: "I have made the changes in my / my child's lifestyle like diet and exercise that are recommended for my / my child's health condition", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am confident I can figure out solutions when new problems arise with my/ my child’s health", + text: "I am confident I can figure out solutions when new problems arise with my / my child's health", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am able to handle symptoms of my/ my child’s health condition on my own at home", + text: "I am able to handle symptoms of my / my child's health condition on my own at home", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am confident that I/ my child can maintain lifestyle changes, like eating right and exercising, even during times of stress", + text: "I am confident that I / my child can maintain lifestyle changes, like eating right and exercising, even during times of stress", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am able to handle problems of my/ my child’s health condition on my own at home", + text: "I am able to handle problems of my / my child's health condition on my own at home", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I am confident I can keep my/ my child’s health problems from interfering with the things I/ my child want(s) to do", + text: "I am confident I can keep my / my child's health problems from interfering with the things I / my child want(s) to do", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "Maintaining the lifestyle changes that are recommended for my/ my child’s health condition is too hard on a daily basis", + text: "Maintaining the lifestyle changes that are recommended for my / my child's health condition is too hard on a daily basis", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I understand the trajectory of my child’s condition and why they need lifelong cardiology care", + text: "I understand the trajectory of my child's condition and why they need lifelong cardiology care", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I know what symptoms for which I should call my child’s cardiologist immediately.", + text: "I know what symptoms for which I should call my child's cardiologist immediately", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( @@ -257,7 +258,7 @@ private let postInterventionQuestions = [ type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I understand what future surgeries/interventions, if any, may be required.", + text: "I understand what future surgeries/interventions, if any, may be required", type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( @@ -265,7 +266,7 @@ private let postInterventionQuestions = [ type: .scale(responseOptions: .frequencyOptions) ), Study.Task.Question( - text: "I can confidently describe my child’s heart lesion", + text: "I can confidently describe my child's heart lesion", type: .scale(responseOptions: .frequencyOptions) ) ] @@ -277,7 +278,7 @@ extension FHIRPrompt { You should directly communicate with the caregiver and use the information from the health records to add context to their questions and conversation. - Prioritize retrieval of historical and current EHR resources directly related to the child’s cardiac care, including encounters, surgeries, catheterizations, echocardiograms, ECGs, medications, and laboratory results from the Cardiology clinic and inpatient encounters and those that involve all cardiology related departments, including and not limited to Cardiothoracic Surgery and Cardiac anesthesia departments. + Prioritize retrieval of historical and current EHR resources directly related to the child's cardiac care, including encounters, surgeries, catheterizations, echocardiograms, ECGs, medications, and laboratory results from the Cardiology clinic and inpatient encounters and those that involve all cardiology related departments, including and not limited to Cardiothoracic Surgery and Cardiac anesthesia departments. Additionally, retrieve relevant records from other clinical contexts only if they are known to influence heart health or surgical outcomes, such as: respiratory conditions (e.g., asthma or anatomic airway workups), genetic consultations, growth and nutrition records (e.g., failure to thrive), or renal function. From e0168fab9a58e29eefa8cc383bee1a916aea8b2e Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Fri, 24 Apr 2026 19:15:35 +0200 Subject: [PATCH 07/11] some more changes and fixes --- .../xcshareddata/xcschemes/LLMonFHIR.xcscheme | 2 +- LLMonFHIRShared/Package.swift | 4 +- .../Task/TaskQuestionType+AnswerOptions.swift | 13 +- .../LLMonFHIRStudyDefinitions/PedCardio.swift | 184 +++++------------- 4 files changed, 68 insertions(+), 135 deletions(-) diff --git a/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme b/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme index 4a2957f8..5b0a1163 100644 --- a/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme +++ b/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme @@ -79,7 +79,7 @@ + isEnabled = "NO"> Date: Sat, 2 May 2026 10:33:53 -0700 Subject: [PATCH 08/11] x --- .../UserStudy/QuestionnaireResponses+Summary.swift | 3 +-- .../Sources/LLMonFHIRStudyDefinitions/GynStudy.swift | 10 +++++----- .../Sources/LLMonFHIRStudyDefinitions/PedCardio.swift | 4 ++-- .../LLMonFHIRStudyDefinitions/UsabilityStudy.swift | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/LLMonFHIR/FHIRInterpretation/UserStudy/QuestionnaireResponses+Summary.swift b/LLMonFHIR/FHIRInterpretation/UserStudy/QuestionnaireResponses+Summary.swift index d0c4383e..c7587819 100644 --- a/LLMonFHIR/FHIRInterpretation/UserStudy/QuestionnaireResponses+Summary.swift +++ b/LLMonFHIR/FHIRInterpretation/UserStudy/QuestionnaireResponses+Summary.swift @@ -152,7 +152,7 @@ extension QuestionnaireResponses.ImageAnnotation { let pipelineExplanation = """ You operate as part of an image analysis pipeline, where an image annotated by a user is interpreted using an LLM. The user was presented an image, in an iOS app, and asked to draw onto the image, to annotate (highlight) regions where a certain condition is true - (e.g. "mark all areas where you feel pain in red"). + (e.g., "mark all areas where you feel pain in red"). The pipeline is as follows: 1. Base image description: @@ -173,7 +173,6 @@ extension QuestionnaireResponses.ImageAnnotation { - the output from step 2 (the textual description of the annotated/highlighted image) - the user's question - output: a response to the user's question, taking into account the context generated by step 2, and other context passed along. - """ let baseImageExplanation: String = try await runner.oneShot(with: schema, context: [ LLMContextEntity( diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/GynStudy.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/GynStudy.swift index 54a4f846..accad5d0 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/GynStudy.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/GynStudy.swift @@ -86,7 +86,7 @@ extension Study { isOptional: false ), Study.Task.Question( - text: "Compared to other sources of health information (e.g. websites, informational leaflets, doctors) how do you rate the LLM’s responses?", + text: "Compared to other sources of health information (e.g., websites, informational leaflets, doctors) how do you rate the LLM’s responses?", type: .scale(responseOptions: .comparisonScale), isOptional: false ), @@ -101,7 +101,7 @@ extension Study { isOptional: false ), Study.Task.Question( - text: "On a scale of 0-10 how likely are you to recommend this tool to a friend or colleague?", + text: "On a scale of 0–10 how likely are you to recommend this tool to a friend or colleague?", type: .netPromoterScore(range: 1...10), isOptional: false ) @@ -212,7 +212,7 @@ private let postInterventionQuestions = [ isOptional: false ), Study.Task.Question( - text: "I know what my hormone levels (e.g. AMH) signify", + text: "I know what my hormone levels (e.g., AMH) signify", type: .scale(responseOptions: .frequencyOptions), isOptional: false ), @@ -279,7 +279,7 @@ extension FHIRPrompt { You are the LLMonFHIR agent tasked with helping Reproductive Endocrinology & Infertility (REI) patients understand their current health, recent procedures and conditions related to their fertility and any questions they have while accessing their FHIR health records for additional context. You should directly communicate with the user and use the information from the health records to add context to the user's questions and conversation. Prioritise retrieval of historical and current EHR resources directly related to the patient’s fertility journey, including encounters, procedures, diagnostics, medications, and laboratory results from REI clinics and gynaecology departments. - Additionally, retrieve relevant records from other clinical contexts only if they are known to influence fertility, pregnancy outcomes, or REI treatment decisions, such as: cardiovascular conditions (e.g. hypertension, heart disease), lifestyle factors (e.g. smoking history), endocrine or metabolic conditions, genetic consultations or test results. + Additionally, retrieve relevant records from other clinical contexts only if they are known to influence fertility, pregnancy outcomes, or REI treatment decisions, such as: cardiovascular conditions (e.g., hypertension, heart disease), lifestyle factors (e.g., smoking history), endocrine or metabolic conditions, genetic consultations or test results. Exclude unrelated medical data unless explicitly requested or clinically linked to fertility or pregnancy outcomes. Throughout the conversation with the user, you MUST use the "get_resources" tool call to obtain the FHIR health resources necessary to answer the user's question correctly. For example, if the user asks about their allergies, you must use the "get_resources" tool call to output the FHIR resource titles for allergy records so you can then use them to answer the question. Use the 'get_resources' tool to get relevant health data, but focus on clear, simple explanations for the user. Leave out any technical details like JSON, FHIR resources, and other implementation details of the underlying data resources. Use this information to determine the best possible FHIR resource for each question. Try to keep the requested resources to a reasonable minimum to answer the user questions or to fulfill your task. @@ -294,7 +294,7 @@ extension FHIRPrompt { Ensure to leave out sensitive numbers like SSN, passport number, and telephone number. Explain the relevant medical context in a language understandable by a user who is not a medical professional and aim to respond to the user at a 5th-grade reading level. When possible, use words with 1 or 2 syllables. When feasible, use less than 11 words per sentence. Keep responses clear and easy to read. Use non-technical language. Do not compromise the quality or accuracy of the information. You MUST provide factual and precise information in a compact summary in short responses. Write like you are talking to a friend. Use a kind, respectful, and emotionally sensitive tone. When appropriate, acknowledge the complexity and emotional burden of fertility care without assuming or stating that the patient has experienced loss, unless the user explicitly indicates this. - When the user asks about the likelihood of getting pregnant make sure to ALWAYS include their current age AND BMI as well as risk factors from other diagnoses (e.g. a genetic predisposition). + When the user asks about the likelihood of getting pregnant make sure to ALWAYS include their current age AND BMI as well as risk factors from other diagnoses (e.g., a genetic predisposition). Use common, simple language. For example: 1. Instead of anovulation, say not releasing an egg diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift index 3fbb616d..6627a6fd 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift @@ -68,7 +68,7 @@ extension Study { isOptional: true ), .init( - text: "Compared to other sources of health information (e.g. websites, doctors), how do you rate the LLM's responses?", + text: "Compared to other sources of health information (e.g., websites, doctors), how do you rate the LLM's responses?", type: .scale(responseOptions: .comparisonScale), isOptional: false ), @@ -83,7 +83,7 @@ extension Study { isOptional: false ), .init( - text: "On a scale of 0—10 how likely are you to recommend this tool to a friend, colleague or other parents in general?", + text: "On a scale of 0–10 how likely are you to recommend this tool to a friend, colleague or other parents in general?", type: .netPromoterScore(range: 0...10), isOptional: false ) diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/UsabilityStudy.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/UsabilityStudy.swift index 857702f6..d21e5293 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/UsabilityStudy.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/UsabilityStudy.swift @@ -99,7 +99,7 @@ extension Study { isOptional: true ), Study.Task.Question( - text: "On a scale of 0-10, how likely are you to recommend this tool to a friend or colleague?", + text: "On a scale of 0–10, how likely are you to recommend this tool to a friend or colleague?", type: .netPromoterScore(range: 0...10), isOptional: false ) From 1f8f582387ffebd5d9a53fc2952aa28cfe95fa51 Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Sat, 2 May 2026 10:39:27 -0700 Subject: [PATCH 09/11] x --- .../Sources/LLMonFHIRStudyDefinitions/PedCardio.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift index 6627a6fd..15b64a2c 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift @@ -264,7 +264,8 @@ extension FHIRPrompt { Do not introduce yourself at the beginning. Immediately return a summary of the child based on FHIR resources, focusing on Cardiology data. - Always start the summary by saying: “Hello caregiver of (name) I understand that …”. + Always start the summary by saying: “Hello caregiver of {name of child}, I understand that …”. + (Where `{name of child}` is a placeholder for substituting in the name of the child, if known.) Start with an initial compact summary of the child's health information based on recent encounters and documents. The summary should be compact (no bullet points), holistic, empathetic but professional, and less than four sentences long. Add a new paragraph after the initial summary and ask the caregiver if they have any questions or where you can help them. From f27627c86267cd7a8b59e2a7c5b6c178a2b527fa Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Sat, 2 May 2026 10:39:51 -0700 Subject: [PATCH 10/11] x --- LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme b/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme index 5b0a1163..fbae6d0c 100644 --- a/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme +++ b/LLMonFHIR.xcodeproj/xcshareddata/xcschemes/LLMonFHIR.xcscheme @@ -111,7 +111,7 @@ + isEnabled = "NO"> From 1d9da4d4b26c82dfaa6c1ba240149e63ba925bb0 Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Sat, 2 May 2026 17:53:59 -0700 Subject: [PATCH 11/11] update questions --- .../LLMonFHIRStudyDefinitions/PedCardio.swift | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift index 15b64a2c..d6ecee38 100644 --- a/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift +++ b/LLMonFHIRShared/Sources/LLMonFHIRStudyDefinitions/PedCardio.swift @@ -141,28 +141,28 @@ private let finalTaskQuestions = [ private let postInterventionQuestions: [Study.Task.Question] = { let questions = [ - "When all is said and done, I am the person who is responsible for taking care of my / my child's health", - "Taking an active role in my / my child's health care is the most important thing that affects my health and ability to function", - "I know what each of my / my child's prescribed medications do and what the major or common side effects are", - "I am confident that I can tell my / my child's health care provider/ doctor concerns I have even when he or she does not ask", - "I am confident that I can tell whether I / my child need to go get medical care to go to the doctor or whether I can take care of a health problem", - "I am confident I can help prevent or reduce problems associated with my / my child's health", - "I know the lifestyle changes like diet and exercise that are recommended for my own / my child's health condition", - "I am confident that I / my child can follow through on medical treatments I / my child may need to do at home", - "I am confident that I can take actions that will help prevent or minimize some symptoms or problems associated with my / my child's health condition", - "I am confident that I/ my child can follow through on medical recommendations my / my child's health care provider makes, such as changing my diet or doing regular exercise", - "I understand the nature and causes of my / my child's health condition", - "I know the different medical treatment options available for my / my child's health condition", - "I have / My child has been able to maintain (keep up with) lifestyle changes that I have / my child has made for my / my child's health, like eating right or exercising", - "I know how to prevent further problems with my / my child's health", - "I know about the self-treatments for my / my child's health condition", - "I have made the changes in my / my child's lifestyle like diet and exercise that are recommended for my / my child's health condition", - "I am confident I can figure out solutions when new problems arise with my / my child's health", - "I am able to handle symptoms of my / my child's health condition on my own at home", - "I am confident that I / my child can maintain lifestyle changes, like eating right and exercising, even during times of stress", - "I am able to handle problems of my / my child's health condition on my own at home", - "I am confident I can keep my / my child's health problems from interfering with the things I / my child want(s) to do", - "Maintaining the lifestyle changes that are recommended for my / my child's health condition is too hard on a daily basis", + "When all is said and done, I am the person who is responsible for taking care of my child's health", + "Taking an active role in my child's health care is the most important thing that affects their health and ability to function", + "I know what each of my child's prescribed medications do and what the major or common side effects are", + "I am confident that I can tell my child's health care provider/doctor concerns I have even when he or she does not ask", + "I am confident that I can tell whether my child needs to go get medical care to go to the doctor or whether I can take care of a health problem", + "I am confident I can help prevent or reduce problems associated with my child's health", + "I know the lifestyle changes like diet and exercise that are recommended for my child's health condition", + "I am confident that my child can follow through on medical treatments they may need to do at home", + "I am confident that I can take actions that will help prevent or minimize some symptoms or problems associated with my child's health condition", + "I am confident that my child can follow through on medical recommendations their health care provider makes, such as changing diet or doing regular exercise", + "I understand the nature and causes of my child's health condition", + "I know the different medical treatment options available for my child's health condition", + "My child has been able to maintain (keep up with) lifestyle changes that we have made for their health, like eating right or exercising", + "I know how to prevent further problems with my child's health", + "I know about the self-treatments for my child's health condition", + "I have made the changes in my child's lifestyle like diet and exercise that are recommended for their health condition", + "I am confident I can figure out solutions when new problems arise with my child's health", + "I am able to handle symptoms of my child's health condition on my own at home", + "I am confident that my child can maintain lifestyle changes, like eating right and exercising, even during times of stress", + "I am able to handle problems of my child's health condition on my own at home", + "I am confident I can keep my child's health problems from interfering with the things my child wants to do", + "Maintaining the lifestyle changes that are recommended for my child's health condition is too hard on a daily basis", "I understand the trajectory of my child's condition and why they need lifelong cardiology care", "I know what symptoms for which I should call my child's cardiologist immediately", "I understand why my child needs or needed surgery to correct their heart lesion",