From d7f8bc57a41f970439af1928abbd6aca3b33a36f Mon Sep 17 00:00:00 2001 From: kcallon Date: Sat, 9 Mar 2024 15:13:31 -0800 Subject: [PATCH 1/2] adding some medications --- .../IntakeMedicationViewModel.swift | 20 ++++++++++++++++++- .../MedicationContentView.swift | 2 +- Intake/Resources/Localizable.xcstrings | 13 +++++------- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Intake/Medication View/IntakeMedicationViewModel.swift b/Intake/Medication View/IntakeMedicationViewModel.swift index acd28ca..67bd7d5 100644 --- a/Intake/Medication View/IntakeMedicationViewModel.swift +++ b/Intake/Medication View/IntakeMedicationViewModel.swift @@ -69,7 +69,25 @@ class IntakeMedicationSettingsViewModel: Module, MedicationSettingsViewModel, Cu IntakeMedication( localizedDescription: "NDA020800 0.3 ML Epinephrine 1 MG/ML Auto-Injector", dosages: [ - IntakeDosage(localizedDescription: "0.3ML / 1 MG/ML") + IntakeDosage(localizedDescription: "0.3 ML/1 MG/ML") + ] + ), + IntakeMedication( + localizedDescription: "Clopidogrel 75 MG Oral Tablet", + dosages: [ + IntakeDosage(localizedDescription: "75 MG") + ] + ), + IntakeMedication( + localizedDescription: "Verapamil Hydrochloride 40 MG", + dosages: [ + IntakeDosage(localizedDescription: "40 MG") + ] + ), + IntakeMedication( + localizedDescription: "Simvastatin 20 MG Oral Tablet", + dosages: [ + IntakeDosage(localizedDescription: "20 MG") ] ) ] diff --git a/Intake/Medication View/MedicationContentView.swift b/Intake/Medication View/MedicationContentView.swift index 91d2b41..9873525 100644 --- a/Intake/Medication View/MedicationContentView.swift +++ b/Intake/Medication View/MedicationContentView.swift @@ -32,7 +32,7 @@ struct MedicationContentView: View { data.medicationData = medicationSettingsViewModel.medicationInstances navigationPath.path.append(NavigationViews.allergies) } - .navigationTitle("Medication Settings") + .navigationTitle("Medications") .navigationBarItems(trailing: NavigationLink(destination: MedicationLLMAssistant(presentingAccount: .constant(false))) { Text("Chat") }) diff --git a/Intake/Resources/Localizable.xcstrings b/Intake/Resources/Localizable.xcstrings index 042c3fd..320e0b6 100644 --- a/Intake/Resources/Localizable.xcstrings +++ b/Intake/Resources/Localizable.xcstrings @@ -229,12 +229,6 @@ }, "Edit Surgery" : { - }, - "End Date: %@" : { - - }, - "END_CALENDAR" : { - }, "Ex: Heavy bleeding on second day, fatigue..." : { @@ -723,8 +717,11 @@ "What brings you in today? Identify your primary concern(s)." : { }, - "Your Responses" : { - + "Yes" : { + + }, + "YYYY-MM-DD" : { + } }, "version" : "1.0" From 20e9caa8b03ed2694b6821655f89334e732b20fc Mon Sep 17 00:00:00 2001 From: kcallon Date: Sun, 10 Mar 2024 18:54:20 -0700 Subject: [PATCH 2/2] some final fixes --- .../xcshareddata/swiftpm/Package.resolved | 11 ++++++----- .../IntakeMedicationViewModel.swift | 6 ++++++ Intake/Resources/Localizable.xcstrings | 13 ++++++++++--- Intake/ScrollablePDF.swift | 15 ++++++++------- 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/Intake.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Intake.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 08be811..9f82483 100644 --- a/Intake.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Intake.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "cdbe60a3382a8a962c7fcc00210e56e13314cb3e246d0e01fe8e25a1268623d8", "pins" : [ { "identity" : "abseil-cpp-binary", @@ -149,8 +150,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/StanfordBDHG/ResearchKit", "state" : { - "revision" : "e4afb10ec636a70e06afc4a84fb98e457818439a", - "version" : "2.2.27" + "revision" : "64512d0a0a5cc3e9d5b3fc5217c54f11d0dc044c", + "version" : "2.2.28" } }, { @@ -275,8 +276,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/StanfordSpezi/SpeziQuestionnaire.git", "state" : { - "revision" : "f25580e95bfdad02383980dcb94406cf97b08ea8", - "version" : "1.0.2" + "revision" : "f9d9b6d99bb1e00bda2974b440dca8367733d591", + "version" : "1.1.0" } }, { @@ -379,5 +380,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Intake/Medication View/IntakeMedicationViewModel.swift b/Intake/Medication View/IntakeMedicationViewModel.swift index 67bd7d5..45342ac 100644 --- a/Intake/Medication View/IntakeMedicationViewModel.swift +++ b/Intake/Medication View/IntakeMedicationViewModel.swift @@ -89,6 +89,12 @@ class IntakeMedicationSettingsViewModel: Module, MedicationSettingsViewModel, Cu dosages: [ IntakeDosage(localizedDescription: "20 MG") ] + ), + IntakeMedication( + localizedDescription: "amLODIPine 2.5 MG Oral Tablet", + dosages: [ + IntakeDosage(localizedDescription: "2.5 MG") + ] ) ] diff --git a/Intake/Resources/Localizable.xcstrings b/Intake/Resources/Localizable.xcstrings index 320e0b6..717fe60 100644 --- a/Intake/Resources/Localizable.xcstrings +++ b/Intake/Resources/Localizable.xcstrings @@ -9,6 +9,16 @@ }, "*Click the details to view/edit the reactions" : { + }, + "%@ - %@" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "%1$@ - %2$@" + } + } + } }, "%@ Reactions" : { @@ -353,9 +363,6 @@ }, "Medical Intake Form" : { - }, - "Medication Settings" : { - }, "Medications" : { diff --git a/Intake/ScrollablePDF.swift b/Intake/ScrollablePDF.swift index 222c1b3..4ab51a7 100644 --- a/Intake/ScrollablePDF.swift +++ b/Intake/ScrollablePDF.swift @@ -93,15 +93,16 @@ struct ScrollablePDF: View { private struct MedicationSection: View { @Environment(DataStore.self) private var data @Environment(NavigationPathWrapper.self) private var navigationPath - var body: some View { + let medicationData = data.medicationData Section(header: HeaderTitle(title: "Medications", nextView: NavigationViews.medication)) { - VStack(alignment: .leading) { - ForEach(Array(data.medicationData)) { item in - HStack { - Text(item.type.localizedDescription) - .padding(.leading) - Spacer() + ForEach(Array(medicationData), id: \.self) { medicationInstance in + List { + VStack(alignment: .leading, spacing: 0) { + Text(medicationInstance.type.localizedDescription) + .font(.headline) + Text("\(medicationInstance.dosage.localizedDescription) - \(medicationInstance.schedule.frequency.description)") + .font(.subheadline) } } }