Skip to content

Commit

Permalink
View consistency enhancements, small bug fixes including entitlements…
Browse files Browse the repository at this point in the history
… fix (#92)

# View consistency, small bug fixes, including entitlements fix

## ♻️ Current situation & Problem
As of now, some views in the Intake app seem out of place because of
different color choices than the main accent color. Furthermore, when
using real health records from HealthKit, a crash occurs because of
missing entitlements.


## ⚙️ Release Notes 
- View consistency enhancements, small bug fixes including entitlements
fix


## 📚 Documentation
--


## ✅ Testing
--


## 📝 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
philippzagar authored Apr 7, 2024
1 parent dd1dedd commit 3de281d
Show file tree
Hide file tree
Showing 20 changed files with 68 additions and 86 deletions.
22 changes: 4 additions & 18 deletions Intake.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
2F1AC9DF2B4E840E00C24973 /* Intake.docc in Sources */ = {isa = PBXBuildFile; fileRef = 2F1AC9DE2B4E840E00C24973 /* Intake.docc */; };
2F49B7762980407C00BCB272 /* Spezi in Frameworks */ = {isa = PBXBuildFile; productRef = 2F49B7752980407B00BCB272 /* Spezi */; };
2F4E237E2989A2FE0013F3D9 /* LaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4E237D2989A2FE0013F3D9 /* LaunchTests.swift */; };
2F4E23832989D51F0013F3D9 /* IntakeTestingSetup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4E23822989D51F0013F3D9 /* IntakeTestingSetup.swift */; };
Expand Down Expand Up @@ -118,7 +117,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
2F1AC9DE2B4E840E00C24973 /* Intake.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = Intake.docc; sourceTree = "<group>"; };
2F4E237D2989A2FE0013F3D9 /* LaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchTests.swift; sourceTree = "<group>"; };
2F4E23822989D51F0013F3D9 /* IntakeTestingSetup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntakeTestingSetup.swift; sourceTree = "<group>"; };
2F5E32BC297E05EA003432F8 /* IntakeDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntakeDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -182,7 +180,6 @@
5AEA5F412B90710B00F1577A /* EditPatient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditPatient.swift; sourceTree = "<group>"; };
5AEA5F462B93034A00F1577A /* ReactionPDF.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionPDF.swift; sourceTree = "<group>"; };
5AEA5F492B96F63A00F1577A /* AllergyLLMAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllergyLLMAssistant.swift; sourceTree = "<group>"; };
637BE1D42B572B4800EA19C6 /* Questionnaire.json.license */ = {isa = PBXFileReference; lastKnownFileType = text; path = Questionnaire.json.license; sourceTree = "<group>"; };
653A254D283387FE005D4D48 /* Intake.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Intake.app; sourceTree = BUILT_PRODUCTS_DIR; };
653A2550283387FE005D4D48 /* Intake.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Intake.swift; sourceTree = "<group>"; };
653A255428338800005D4D48 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -257,7 +254,6 @@
2FAEC07F297F583900C11C42 /* Intake.entitlements */,
653A258928339462005D4D48 /* Info.plist */,
2F6025CA29BBE70F0045459E /* GoogleService-Info.plist */,
2F1AC9DE2B4E840E00C24973 /* Intake.docc */,
);
path = "Supporting Files";
sourceTree = "<group>";
Expand All @@ -281,7 +277,6 @@
653A255428338800005D4D48 /* Assets.xcassets */,
2FA0BFEC2ACC977500E0EF83 /* Localizable.xcstrings */,
2FE5DC2C29EDD78E004B9AB4 /* ConsentDocument.md */,
637BE1D42B572B4800EA19C6 /* Questionnaire.json.license */,
3CD23D602BA137D500AB9914 /* Intake.docc */,
);
path = Resources;
Expand Down Expand Up @@ -348,6 +343,8 @@
5A2B9F832B69E06B005CA63F /* SettingsView */ = {
isa = PBXGroup;
children = (
5A2B9F842B69E06B005CA63F /* SettingsView.swift */,
5A2B9F852B69E06B005CA63F /* ResourceSelection.swift */,
);
path = SettingsView;
sourceTree = "<group>";
Expand Down Expand Up @@ -426,9 +423,9 @@
3C89F6682B9D939500A4F52D /* PatientView */,
F42AB1DA2B637C5F002E13A6 /* ChiefComplaintView */,
5A2B9F762B69AE07005CA63F /* MedicalHistoryView */,
511827942B740191002033A0 /* SurgeryView */,
519E830A2B7C4F1600A2D92D /* MedicationView */,
5A2B9FB32B6AFE1F005CA63F /* AllergyView */,
511827942B740191002033A0 /* SurgeryView */,
AC2A17272B70684D00F560D0 /* SocialHistoryView */,
ACF862BC2B96E28400ACBA1E /* ExportView */,
5A2B9F832B69E06B005CA63F /* SettingsView */,
Expand Down Expand Up @@ -488,21 +485,11 @@
970157162BB929DB00335713 /* HomeView */ = {
isa = PBXGroup;
children = (
97FE2EA72BB93C6C006A3B8E /* Settings */,
97FE2EA52BB935A2006A3B8E /* LoadLastButton.swift */,
97FE2EA32BB93582006A3B8E /* StartButton.swift */,
);
path = HomeView;
sourceTree = "<group>";
};
97FE2EA72BB93C6C006A3B8E /* Settings */ = {
isa = PBXGroup;
children = (
970157172BB929FC00335713 /* SettingsButton.swift */,
5A2B9F842B69E06B005CA63F /* SettingsView.swift */,
5A2B9F852B69E06B005CA63F /* ResourceSelection.swift */,
);
path = Settings;
path = HomeView;
sourceTree = "<group>";
};
97FE2EA82BB9410F006A3B8E /* Models */ = {
Expand Down Expand Up @@ -764,7 +751,6 @@
2FC975A82978F11A00BA99FE /* Home.swift in Sources */,
51805C1D2B818A4400D17109 /* IntakeMedicationInstance.swift in Sources */,
2FE5DC3729EDD7CA004B9AB4 /* OnboardingFlow.swift in Sources */,
2F1AC9DF2B4E840E00C24973 /* Intake.docc in Sources */,
2FF53D8D2A8729D600042B76 /* IntakeStandard.swift in Sources */,
2FE5DC4729EDD7F2004B9AB4 /* CodableArray+RawRepresentable.swift in Sources */,
5A2B9FAB2B69E430005CA63F /* FHIRStore+Extensions.swift in Sources */,
Expand Down
10 changes: 1 addition & 9 deletions Intake.xcodeproj/xcshareddata/xcschemes/Intake.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "--disableFirebase"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--testCondition"
isEnabled = "NO">
Expand Down Expand Up @@ -111,7 +107,7 @@
</CommandLineArgument>
<CommandLineArgument
argument = "--skipOnboarding"
isEnabled = "YES">
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--testSchedule"
Expand All @@ -121,10 +117,6 @@
argument = "--testMedication"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--useFirebaseEmulator"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
Expand Down
43 changes: 24 additions & 19 deletions Intake/AllergyView/AddAllergy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,32 @@ struct EditAllergyView: View {
@Environment(NavigationPathWrapper.self) private var navigationPath
@Environment(\.presentationMode) var presentationMode


var body: some View {
VStack(alignment: .leading, spacing: 10) {
let index = data.allergyData.firstIndex(of: item) ?? 0
@Bindable var data = data
TextField("Allergy Name", text: $data.allergyData[index].allergy)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding([.horizontal, .top])
.accessibilityLabel("Add Allergy Field")
ReactionSectionView(index: index)
Spacer()
saveButton

ZStack {
VStack {
TextField("Allergy Name", text: $data.allergyData[index].allergy)
.textFieldStyle(PlainTextFieldStyle())
.padding([.horizontal, .top])
.accessibilityLabel("Add Allergy Field")

ReactionSectionView(index: index)

Spacer(minLength: 62)
}

VStack {
Spacer()

saveButton
}
}
}
.navigationBarTitle("Allergy Name")
.navigationBarTitle("Allergy")
}

private var saveButton: some View {
Expand All @@ -38,17 +51,9 @@ struct EditAllergyView: View {
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color.blue)
.cornerRadius(10)
.background(.accent)
.cornerRadius(8)
}
.padding()
.padding()
}
}


// #Preview {
// EditAllergyView(allergyItem: AllergyItem(allergy: "", reaction: []), showingReaction: <#T##Binding<Bool>#>, allergyRecords: <#T##Binding<[AllergyItem]>#>, showingReaction: .constant(true), allergyRecords: .constant([]))
// .previewWith {
// FHIRStore()
// }
// }
1 change: 0 additions & 1 deletion Intake/AllergyView/AllergyRecords.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct ChatButton: View {
Image(systemName: "message")
.font(.largeTitle)
.padding()
.background(Color.blue)
.foregroundColor(Color.white)
.clipShape(Circle())
.accessibilityLabel("Message")
Expand Down
4 changes: 3 additions & 1 deletion Intake/AllergyView/ReactionSectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ struct ReactionSectionView: View {
Form { // Use Form instead of List
Section(header: headerTitle) {
@Bindable var data = data

ForEach($data.allergyData[index].reaction) { $item in
HStack {
TextField("Reactions", text: $item.reaction)
}
}
.onDelete(perform: delete)
.onDelete(perform: delete)

Button(action: {
data.allergyData[index].reaction.append(ReactionItem(reaction: ""))
}) {
Expand Down
3 changes: 0 additions & 3 deletions Intake/ChiefComplaintView/LLMOnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ struct LLMOnboardingView: View {
OnboardingStack(onboardingFlowComplete: !$showOnboarding) {
// OpenAI Onboarding
LLMOpenAITokenOnboarding()

// Local Onboarding
// LLMLocalDownloadOnboarding()
}
.interactiveDismissDisabled(showOnboarding)
}
Expand Down
6 changes: 1 addition & 5 deletions Intake/ExportView/ExportView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@ struct ExportView: View {
}
}
}
.if(isSharing, transform: { view in
view
.padding()
})
}
// swiftlint:enable closure_body_length

Expand All @@ -221,7 +217,7 @@ struct ExportView: View {

@MainActor
func exportToPDF() async -> PDFDocument? {
let renderer = ImageRenderer(content: self.wrappedBody)
let renderer = ImageRenderer(content: self.wrappedBody.padding())

let proposedHeightOptional = renderer.uiImage?.size.height

Expand Down
4 changes: 2 additions & 2 deletions Intake/ExportView/ScrollablePDF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct HeaderTitle: View {
navigationPath.path.append(nextView)
}) {
Text("EDIT")
.foregroundColor(.blue)
.foregroundColor(.accentColor)
.padding()
.cornerRadius(10)
}
Expand Down Expand Up @@ -65,7 +65,7 @@ struct ScrollablePDF: View {
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color.blue)
.background(.accent)
.cornerRadius(8)
}
}
Expand Down
6 changes: 3 additions & 3 deletions Intake/Helper/ViewElements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct SkipButton: View {
Button(action: action) {
Text("Skip")
.font(.headline)
.foregroundColor(.blue)
.foregroundColor(.accentColor)
.padding(8) // Add padding for better appearance
.cornerRadius(8) // Round the corners
}
Expand All @@ -42,7 +42,7 @@ struct SubmitButton: View {
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color.blue)
.background(.accent)
.cornerRadius(8)
}
}
Expand All @@ -68,7 +68,7 @@ struct SubmitButtonWithAction: View {
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color.blue)
.background(.accent)
.cornerRadius(8)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Intake/Home.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct HomeView: View {
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 100, height: 100)
.foregroundColor(.blue)
.foregroundColor(.accentColor)
.accessibilityLabel(Text("HOME_LOGO"))
}

Expand Down
2 changes: 1 addition & 1 deletion Intake/HomeView/LoadLastButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct LoadLastButton: View {
.fontWeight(.bold)
.foregroundColor(Color.white)
.padding()
.background(disabled ? Color.blue.opacity(0.5) : Color.blue)
.background(disabled ? .accent.opacity(0.5) : .accent)
.cornerRadius(10)
}
.disabled(disabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct SettingsButton: View {
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 30, height: 30)
.foregroundColor(.blue)
.foregroundColor(.accentColor)
.accessibilityLabel("SETTINGS")
}
)
Expand Down
2 changes: 1 addition & 1 deletion Intake/HomeView/StartButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct StartButton: View {
.fontWeight(.bold)
.foregroundColor(.white)
.padding()
.background(Color.blue)
.background(.accent)
.cornerRadius(10)
}.accessibilityIdentifier("Create New Form")
}
Expand Down
12 changes: 6 additions & 6 deletions Intake/Resources/ConsentDocument.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### Introduction
### **Introduction**

This consent form is designed for adult users of the ReForm mobile application ("ReForm" or "the App"). By agreeing to this consent, you authorize ReForm to access your Apple Health Records and Apple HealthKit's health data store to autofill your medical intake forms.

### Consent to Access Health Information
### **Consent to Access Health Information**

You hereby give consent to ReForm to:

Expand All @@ -11,7 +11,7 @@ You hereby give consent to ReForm to:
3. Use OpenAI's ChatGPT to assist in summarizing your health history for the purposes of autofilling the medical intake form.
4. Allow you to query your health information using OpenAI's ChatGPT.

### Data Privacy and Protection
### **Data Privacy and Protection**

ReForm is committed to protecting your privacy and the security of your health data:

Expand All @@ -20,19 +20,19 @@ ReForm is committed to protecting your privacy and the security of your health d
- Access to your health data by ReForm is controlled by your explicit permission settings.
- ReForm will comply with all applicable privacy laws and regulations, including but not limited to the Health Insurance Portability and Accountability Act (HIPAA).

### User Control and Rights
### **User Control and Rights**

As a user, you have the right to:

- Withdraw your consent at any time.
- Manage and revoke permissions granted to ReForm for accessing your health data under your device's settings[6].
- Exercise your rights as outlined in OpenAI's privacy policy, including the right to object to how your personal information is processed.

### Changes to Consent Form
### **Changes to Consent Form**

ReForm reserves the right to update this consent form as necessary. You will be notified of any changes to our privacy practices and given the opportunity to review and agree to the updated consent.

### Acknowledgment and Agreement
### **Acknowledgment and Agreement**

By using ReForm, you acknowledge that you have read this consent form, understand it, and agree to its terms. You understand that ReForm is not a healthcare provider and that the autofilled medical intake forms should be reviewed for accuracy and completeness before submission to your healthcare provider.

Expand Down
5 changes: 4 additions & 1 deletion Intake/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@
},
"Allergies:" : {

},
"Allergy" : {

},
"Allergy Assistant" : {

Expand Down Expand Up @@ -281,7 +284,7 @@
"DELETE_REACTION" : {

},
"DELETE_SURGERY" : {
"Done" : {

},
"Download your medical records from your health system." : {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions Intake/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSHealthClinicalHealthRecordsShareUsageDescription</key>
<string>The Intake app uses your clinical health records in Apple Health to prefill electronic Intake forms.</string>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>ITSAppUsesNonExemptEncryption</key>
Expand Down
Loading

0 comments on commit 3de281d

Please sign in to comment.