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

Victor Fernandes - Backend-interview Finished #38

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

victorhmf
Copy link

@victorhmf victorhmf commented Aug 18, 2024

Pull Request Template

Description

The solution was implemented in accordance with the challenge requirements, featuring an algorithm that processes a set of historical patient data to compute a score for each patient. This score, ranging from 1 (lowest) to 10 (highest), represents the likelihood of a patient accepting an appointment offer from the waitlist.

Implementation

The implementation follows a five-step process:

  • Calculate Distance: Determine the distance between the facility and each patient using the patient’s geolocation coordinates.
  • Compute Data Range: Identify the minimum and maximum values for relevant patient fields to establish a range for normalization.
  • Normalize Data: Scale the patient data to a range of 0 to 1, based on the previously calculated data range.
  • Calculate Patient Scores: Assign a score to each patient according to the provided weighting criteria and flag patients with little behavioral data based on empirically defined thresholds.
  • Generate Top Priority List: Create a prioritized list of patients, factoring in their scores and the littleBehaviorData flag to optimize appointment offers.

Technical decisions

The core code follows a service-oriented architecture, adhering to SOLID principles. Each service is designed with a clear, single responsibility, ensuring modularity and maintainability. A facade layer was also created to aggregate these services, allowing them to be seamlessly exposed as a single function within the library.

Each service and the facade have been thoroughly tested with unit tests to ensure reliability and correctness.

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

You can run unit tests:
npm run test:unit:cov

Or get information on README Api section, to test via endpoint.

Checklist:

  • I have performed a self-review of my own code
  • I have tested my code to prove my fix is effective or that my feature works
  • I have commented my code in areas where it's hard to make the code speak for itself
  • My changes breaks no tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant