Skip to content

Commit

Permalink
Don't filter out duplicate fac/phys (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
depryf committed Sep 22, 2023
1 parent 019db3b commit f13784b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public String getId() {
* @return generated FacilityFrequencyDto
*/
private FacilityFrequencyDto generateFacility(ProviderDataGeneratorOptions options) {
// make sure options are never null
if (options == null)
options = new ProviderDataGeneratorOptions();

Expand All @@ -48,16 +47,12 @@ private FacilityFrequencyDto generateFacility(ProviderDataGeneratorOptions optio
* @return list of generated facilities
*/
public List<FacilityFrequencyDto> generateFacilities(int numProviders, ProviderDataGeneratorOptions options) {
// make sure options are never null
if (options == null)
options = new ProviderDataGeneratorOptions();

List<FacilityFrequencyDto> facilities = new ArrayList<>();
for (int i = 0; i < numProviders; i++) {
FacilityFrequencyDto facility = generateFacility(options);
if (!facilities.contains(facility))
facilities.add(facility);
}
for (int i = 0; i < numProviders; i++)
facilities.add(generateFacility(options));

return facilities;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public String getId() {
* @return generated PhysicianFrequencyDto
*/
private PhysicianFrequencyDto generatePhysician(ProviderDataGeneratorOptions options) {
// make sure options are never null
if (options == null)
options = new ProviderDataGeneratorOptions();

Expand All @@ -48,16 +47,12 @@ private PhysicianFrequencyDto generatePhysician(ProviderDataGeneratorOptions opt
* @return list of generated physicians
*/
public List<PhysicianFrequencyDto> generatePhysicians(int numProviders, ProviderDataGeneratorOptions options) {
// make sure options are never null
if (options == null)
options = new ProviderDataGeneratorOptions();

List<PhysicianFrequencyDto> physicians = new ArrayList<>();
for (int i = 0; i < numProviders; i++) {
PhysicianFrequencyDto physician = generatePhysician(options);
if (!physicians.contains(physician))
physicians.add(physician);
}
for (int i = 0; i < numProviders; i++)
physicians.add(generatePhysician(options));

return physicians;
}
Expand Down

0 comments on commit f13784b

Please sign in to comment.