Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend data type definition & Frontend user input data UI #5

Merged
merged 22 commits into from
Feb 12, 2025
Merged

Conversation

dusixian
Copy link
Contributor

@dusixian dusixian commented Feb 4, 2025

Backend data type definition & Frontend user input data UI

♻️ Current situation & Problem

The project requires backend data structures to store manually entered health data and a corresponding frontend UI for users to input these values. This PR introduces data models and a input interface for manual health data entry.

⚙️ Release Notes

Backend Data Type Definitions:

  • Heart Rate (HeartRateEntry) – measured in BPM.
  • Temperature (TemperatureEntry) – stored in Celsius or Fahrenheit with unit handling.
  • Oxygen Saturation (OxygenSaturationEntry) – percentage validation included.
  • Blood Pressure (BloodPressureEntry) – systolic & diastolic values with validation.
  • Lab Results (LabEntry) – categorized using LabTestType enum.
  • Implemented isValidDate() function to ensure data timestamps are not set in the future.

Frontend UI for Manual Data Entry:

  1. DataInputForm View:
    • Displays an input form based on the selected health data type.
    • Includes date & time pickers for accurate timestamping.
    • Supports multiple field types (text fields, number inputs, pickers).
    • Dynamically validates input to ensure correct data entry.
  2. AddData View:
    • Displays 6 data categories for user to choose.

📚 Documentation

Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.

✅ Testing

Unit Tests Ensured numeric validation for all manual entry fields (e.g., temperature, blood pressure). Confirmed correct data structure initialization with sample values.

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 11.41141% with 295 lines in your changes missing coverage. Please review.

Project coverage is 62.67%. Comparing base (26edeff) to head (65cc57f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
NeutroFeverGuard/DataInputForm.swift 0.00% 230 Missing ⚠️
NeutroFeverGuard/AddDataView.swift 0.00% 41 Missing ⚠️
NeutroFeverGuard/HelperFunc.swift 0.00% 14 Missing ⚠️
NeutroFeverGuard/DataError.swift 0.00% 10 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main       #5       +/-   ##
===========================================
- Coverage   86.75%   62.67%   -24.07%     
===========================================
  Files          21       26        +5     
  Lines         709     1042      +333     
===========================================
+ Hits          615      653       +38     
- Misses         94      389      +295     
Files with missing lines Coverage Δ
NeutroFeverGuard/DataType.swift 100.00% <100.00%> (ø)
NeutroFeverGuard/DataError.swift 0.00% <0.00%> (ø)
NeutroFeverGuard/HelperFunc.swift 0.00% <0.00%> (ø)
NeutroFeverGuard/AddDataView.swift 0.00% <0.00%> (ø)
NeutroFeverGuard/DataInputForm.swift 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26edeff...65cc57f. Read the comment docs.

@PSchmiedmayer
Copy link
Member

@dusixian As noted in https://github.com/orgs/CS342/discussions/113#discussioncomment-12051489, ensure that you update all dependencies to the latest version in Xcode and committing all the updated project files + Package.resolved file. You need to run File -> Swift Packages -> Update to Latest Package Versions in Xcode. This might fix your current testing errors.

@dusixian dusixian added the enhancement New feature or request label Feb 7, 2025
@mmervecerit
Copy link
Contributor

Hi @dusixian,

I reviewed your PR, here is my feedback:

  • Your changes in eventview and scheduleview should be reverted i believe, since those lines were added by Paul to the original template to fix issues, and i added them in my previous PR.
    -Also the units of lab tests are important to know, and critical to input/show in UI. (hemoglobin for example, it is g/dL and WBC is usually cells per microliter) This might be good to talk with @viraj28m when he is implementing FHIR records of the lab values and have unit conversions if required.

@dusixian
Copy link
Contributor Author

@mmervecerit Hi Merve! Thanks for your advice. I've changed the eventview and scheduleview following your commits. And for the unit of lab variables, I changed the frontend so the current UI shows the unit when user entry the lab values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dusixian these were the changes are from the main template Paul pushed, so we should keep them?

@dusixian dusixian merged commit 5777f18 into main Feb 12, 2025
8 of 10 checks passed
@dusixian dusixian deleted the sixian branch February 12, 2025 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants