Skip to content

Conversation

@filipowm
Copy link
Contributor

This is initial PR to migrate existing Medical provider. The next one will be to migrate BloodType and Disease providers. Then I will move on adding new ones.

I marked Medical provider as deprecated since 2.4.0, yet I'm not sure whether it shouldn't be 2.3.0 or some other.

@what-the-diff
Copy link

what-the-diff bot commented Apr 28, 2024

PR Summary

  • Introduction of 'HealthcareProviders' Interface
    To enable better handling and organization, we introduced the HealthcareProviders interface and categorized it into specific classes namely CareProvider, Medication, MedicalProcedure, and Observation.

  • Deprecating 'Medical' Class
    The older Medical class with its methods have been sunsetted. This move aims to promote the usage of the new, more specific healthcare-geared classes for a more precise data representation.

  • Inclusion of Healthcare-related Files
    Entries pertinent to healthcare files have been inserted within the service/files directory via EnFile.

  • Addition of Healthcare-related YAML Files
    We have added healthcare-related YAML files care_provider.yml, medical_procedure.yml, medication.yml, observation.yml in the resources/en directory to facilitate proper structuring of healthcare data.

  • Tests for New Classes
    To ensure the robustness and efficacy of the newly implemented classes, test cases have been designed and added for CareProvider, Medication, and Observation classes.

@filipowm filipowm force-pushed the feat/initialize-healthcare-providers branch from 75c6919 to 31b8045 Compare April 28, 2024 22:26
@filipowm filipowm force-pushed the feat/initialize-healthcare-providers branch from 31b8045 to 7a9ca5e Compare April 28, 2024 22:29
import net.datafaker.providers.base.AbstractProvider;

/**
* Generate random types of health care providers

Choose a reason for hiding this comment

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

All providers require a "since" property, so I think a since 2.3.0 would be good, even though we might release this as part of 2.2.3, not sure yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. I added it in all new classes and interface.

}

/**
* @deprecated since 2.4.0. For removal in 3.0.0 version. Use {@link net.datafaker.providers.healthcare.CareProvider#medicalProfession()} instead.
Copy link

@erikpragt-connectid erikpragt-connectid Apr 29, 2024

Choose a reason for hiding this comment

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

I probably wouldn't add the "for removal in". The 3.0.0 can be released next week, or it can be done 5 years from now, that's hard to say, we usually keep these things around 1-2 releases, and then remove them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, adjusted.

@filipowm filipowm force-pushed the feat/initialize-healthcare-providers branch from f56e2a0 to 991714b Compare April 29, 2024 11:33

/**
* Generate random hospital name
* @return A hospital name
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need javadoc which just repeats the actual method name here and in the rest?
IMHO: if javadoc can not bring more info than existing name then probably we don't need that javadoc

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I agree too. However existing codebase is inconsistent, cause in some places there are such dummy javadocs, in other not. So I preferred to add it cause I didn't know which one you prefer.

So I will remove those.

* @deprecated since 2.3.0. This faker is deprecated due to migration
* to healthcare-specific aggregated into {@link net.datafaker.providers.healthcare.HealthcareFaker} fakers with similar methods.
*/
@Deprecated(since = "2.3.0", forRemoval = true)
Copy link
Collaborator

@snuyanzin snuyanzin Apr 29, 2024

Choose a reason for hiding this comment

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

If we are going to remove it
what is the replacement for Medical#diseaseName and Medical#diagnosisCode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add it in next PR, cause it touches Disease which I mentioned.

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 92.15%. Comparing base (b37c566) to head (bae4c1a).
Report is 84 commits behind head on main.

Files Patch % Lines
...atafaker/providers/healthcare/HealthcareFaker.java 20.00% 8 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1179      +/-   ##
============================================
- Coverage     92.35%   92.15%   -0.20%     
- Complexity     2821     2861      +40     
============================================
  Files           292      299       +7     
  Lines          5609     5676      +67     
  Branches        599      601       +2     
============================================
+ Hits           5180     5231      +51     
- Misses          275      292      +17     
+ Partials        154      153       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bodiam
Copy link
Contributor

bodiam commented May 1, 2024

I think this PR is good to go right? Any objections if I merge it?

Copy link
Collaborator

@kingthorin kingthorin left a comment

Choose a reason for hiding this comment

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

LGTM

@bodiam bodiam merged commit cd4c93f into datafaker-net:main May 1, 2024
@bodiam
Copy link
Contributor

bodiam commented May 1, 2024

Thanks @filipowm , it's merged!

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.

6 participants