Skip to content

Commit

Permalink
Minor Updates to Medications including Scrollable PDF (#66)
Browse files Browse the repository at this point in the history
# *Minor Updates to Medications including Scrollable PDF*

## ♻️ Current situation & Problem
The medications final view was missing the frequency of the medications.
Additionally, some patients didn't have any medications assigned to
them, so I added some options.


## ⚙️ Release Notes 
*Add a bullet point list summary of the feature and possible migration
guides if this is a breaking change so this section can be added to the
release notes.*
*Include code snippets that provide examples of the feature implemented
or links to the documentation if it appends or changes the public
interface.*


## 📚 Documentation
*Please ensure that you properly document any additions in conformance
to [Spezi Documentation
Guide](https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md).*
*You can use this section to describe your solution, but we encourage
contributors to document your reasoning and changes using in-line
documentation.*


## ✅ Testing
*Please ensure that the PR meets the testing requirements set by CodeCov
and that new functionality is appropriately tested.*
*This section describes important information about the tests and why
some elements might not be testable.*


## 📝 Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md):
- [x ] I agree to follow the [Code of
Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
kcallon authored Mar 11, 2024
1 parent a8de6e9 commit 081ea98
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "cdbe60a3382a8a962c7fcc00210e56e13314cb3e246d0e01fe8e25a1268623d8",
"pins" : [
{
"identity" : "abseil-cpp-binary",
Expand Down Expand Up @@ -379,5 +380,5 @@
}
}
],
"version" : 2
"version" : 3
}
26 changes: 25 additions & 1 deletion Intake/Medication View/IntakeMedicationViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,31 @@ 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")
]
),
IntakeMedication(
localizedDescription: "amLODIPine 2.5 MG Oral Tablet",
dosages: [
IntakeDosage(localizedDescription: "2.5 MG")
]
)
]
Expand Down
2 changes: 1 addition & 1 deletion Intake/Medication View/MedicationContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})
Expand Down
13 changes: 10 additions & 3 deletions Intake/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
},
"%.2f" : {

},
"%@ - %@" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "%1$@ - %2$@"
}
}
}
},
"%@ Reactions" : {

Expand Down Expand Up @@ -404,9 +414,6 @@
},
"Medical Intake Form" : {

},
"Medication Settings" : {

},
"Medications" : {

Expand Down
12 changes: 10 additions & 2 deletions Intake/ScrollablePDF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,17 @@ struct ScrollablePDF: View {
@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) {
Text("fix medication")
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)
}
}
}
}
}
Expand Down

0 comments on commit 081ea98

Please sign in to comment.