-
Notifications
You must be signed in to change notification settings - Fork 225
feat: migrate part of existing medical provider under specific healthcare providers (#1137) #1179
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
Merged
bodiam
merged 6 commits into
datafaker-net:main
from
filipowm:feat/initialize-healthcare-providers
May 1, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4b2e4a6
feat: migrate existing medical provider under specific healthcare pro…
filipowm 2b586c0
test: add tests for migrated medical provider into specific healthcar…
filipowm 7a9ca5e
chore: format module-info to use spaces instead of tabs
filipowm 8ca8477
chore: adjust deprecation notices to 2.3.0 and add since label to new…
filipowm 991714b
chore: apply spotless to fix formatting issues
filipowm bae4c1a
remove unnecessary javadocs
filipowm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/net/datafaker/providers/healthcare/CareProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package net.datafaker.providers.healthcare; | ||
|
|
||
| import net.datafaker.providers.base.AbstractProvider; | ||
|
|
||
| /** | ||
| * @since 2.3.0 | ||
| */ | ||
| public class CareProvider extends AbstractProvider<HealthcareProviders> { | ||
| protected CareProvider(HealthcareProviders faker) { | ||
| super(faker); | ||
| } | ||
|
|
||
| public String hospitalName() { | ||
| return resolve("healthcare.care_provider.hospital_name"); | ||
| } | ||
|
|
||
| public String medicalProfession() { | ||
| return resolve("healthcare.care_provider.medical_profession"); | ||
| } | ||
| } |
34 changes: 34 additions & 0 deletions
34
src/main/java/net/datafaker/providers/healthcare/HealthcareFaker.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package net.datafaker.providers.healthcare; | ||
|
|
||
| import net.datafaker.providers.base.BaseFaker; | ||
| import net.datafaker.service.FakeValuesService; | ||
| import net.datafaker.service.FakerContext; | ||
| import net.datafaker.service.RandomService; | ||
|
|
||
| import java.util.Locale; | ||
| import java.util.Random; | ||
|
|
||
| /** | ||
| * @since 2.3.0 | ||
| */ | ||
| public class HealthcareFaker extends BaseFaker implements HealthcareProviders { | ||
| public HealthcareFaker() { | ||
| super(); | ||
| } | ||
|
|
||
| public HealthcareFaker(Locale locale) { | ||
| super(locale); | ||
| } | ||
|
|
||
| public HealthcareFaker(Random random) { | ||
| super(random); | ||
| } | ||
|
|
||
| public HealthcareFaker(Locale locale, RandomService randomService) { | ||
| super(locale, randomService); | ||
| } | ||
|
|
||
| public HealthcareFaker(FakeValuesService fakeValuesService, FakerContext context) { | ||
| super(fakeValuesService, context); | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
src/main/java/net/datafaker/providers/healthcare/HealthcareProviders.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package net.datafaker.providers.healthcare; | ||
|
|
||
| import net.datafaker.providers.base.ProviderRegistration; | ||
|
|
||
| /** | ||
| * @since 2.3.0 | ||
| */ | ||
| public interface HealthcareProviders extends ProviderRegistration { | ||
|
|
||
| default CareProvider careProvider() { | ||
| return getProvider(CareProvider.class, CareProvider::new); | ||
| } | ||
|
|
||
| default Medication medication() { | ||
| return getProvider(Medication.class, Medication::new); | ||
| } | ||
|
|
||
| default MedicalProcedure medicalProcedure() { | ||
| return getProvider(MedicalProcedure.class, MedicalProcedure::new); | ||
| } | ||
|
|
||
| default Observation observation() { | ||
| return getProvider(Observation.class, Observation::new); | ||
| } | ||
| } |
17 changes: 17 additions & 0 deletions
17
src/main/java/net/datafaker/providers/healthcare/MedicalProcedure.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package net.datafaker.providers.healthcare; | ||
|
|
||
| import net.datafaker.providers.base.AbstractProvider; | ||
|
|
||
| /** | ||
| * @since 2.3.0 | ||
| */ | ||
| public class MedicalProcedure extends AbstractProvider<HealthcareProviders> { | ||
| protected MedicalProcedure(HealthcareProviders faker) { | ||
| super(faker); | ||
| } | ||
|
|
||
| public String icd10() { | ||
| String regex = resolve("healthcare.medical_procedure.icd10"); | ||
| return faker.regexify(regex); | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/main/java/net/datafaker/providers/healthcare/Medication.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package net.datafaker.providers.healthcare; | ||
|
|
||
| import net.datafaker.providers.base.AbstractProvider; | ||
|
|
||
| /** | ||
| * @since 2.3.0 | ||
| */ | ||
| public class Medication extends AbstractProvider<HealthcareProviders> { | ||
| protected Medication(HealthcareProviders faker) { | ||
| super(faker); | ||
| } | ||
|
|
||
| public String drugName() { | ||
| return resolve("healthcare.medication.drug_name"); | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/main/java/net/datafaker/providers/healthcare/Observation.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package net.datafaker.providers.healthcare; | ||
|
|
||
| import net.datafaker.providers.base.AbstractProvider; | ||
|
|
||
| /** | ||
| * @since 2.3.0 | ||
| */ | ||
| public class Observation extends AbstractProvider<HealthcareProviders> { | ||
| protected Observation(HealthcareProviders faker) { | ||
| super(faker); | ||
| } | ||
|
|
||
| public String symptom() { | ||
| return resolve("healthcare.observation.symptom"); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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#diseaseNameandMedical#diagnosisCode?There was a problem hiding this comment.
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
Diseasewhich I mentioned.