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

Add medical module #2309

Open
zlock55 opened this issue Aug 12, 2023 · 19 comments
Open

Add medical module #2309

zlock55 opened this issue Aug 12, 2023 · 19 comments
Labels
c: feature Request for new feature s: awaiting more info Additional information are requested s: waiting for user interest Waiting for more users interested in this feature
Milestone

Comments

@zlock55
Copy link

zlock55 commented Aug 12, 2023

Clear and concise description of the problem

Would you please add medical terms in the generated data space

Suggested solution

like chemical terms you've already built it

Alternative

No response

Additional context

No response

@zlock55 zlock55 added c: feature Request for new feature s: pending triage Pending Triage s: waiting for user interest Waiting for more users interested in this feature labels Aug 12, 2023
@github-actions
Copy link
Contributor

Thank you for your feature proposal.

We marked it as "waiting for user interest" for now to gather some feedback from our community:

  • If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
  • If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.

We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.

We will start the implementation based on:

  • the number of votes (:+1:) and comments
  • the relevance for the ecosystem
  • availability of alternatives and workarounds
  • and the complexity of the requested feature

We do this because:

  • There are plenty of languages/countries out there and we would like to ensure that every method can cover all or almost all of them.
  • Every feature we add to faker has "costs" associated to it:
    • initial costs: design, implementation, reviews, documentation
    • running costs: awareness of the feature itself, more complex module structure, increased bundle size, more work during refactors

View more issues which are waiting for user interest

@ST-DDT
Copy link
Member

ST-DDT commented Aug 12, 2023

Sorry, I'm not exactly sure what you are referring to.
Are you referring to chemicals (used in/being) medicine or do you want any chemicals even raw chemicals used in the production of medicine or just various names of medicines?
Do you only need the names?
What is your use case for that list?
Is it okay to have fictional names that use the common combination strategies such as Carbondioxide?

@ST-DDT ST-DDT added this to the vFuture milestone Aug 12, 2023
@ST-DDT ST-DDT added the s: awaiting more info Additional information are requested label Aug 12, 2023
@xDivisionByZerox xDivisionByZerox removed the s: pending triage Pending Triage label Sep 24, 2023
@xDivisionByZerox xDivisionByZerox changed the title About adding more data examples Add medical module Sep 24, 2023
@mmorris8
Copy link

I brought this up in a meeting today. I'm working for a hospital group. I'm going to start the process of getting permission to work on something like this in my spare time and publish something. In the mean while I also need to learn the process of setting up a module.

As to items that would be in such a module, off the top of my head:

  • medical degree codes (DO, MD, APN)
  • diseases/conditions (COVID, Flu, Cancer) - note this one can be further broke down
  • medical specialities (Urology, Radiology...)
  • pharmaceuticals - (Prescription medicine names)

@matthewmayer
Copy link
Contributor

You can take a look at https://dev.to/matthewmayer/leveling-up-your-custom-fake-data-with-fakerjs-3f7m for strategies on how to provide your own data when Faker doesn't have it built in.

@mmorris8
Copy link

Thanks. I will look into that for sure.

@matthewmayer
Copy link
Contributor

If you do create some useful arrays of data feel free to contribute them back here. That would definitely increase the chance of this getting implemented!

Typically we would have anywhere between 10 and 1000 entries per item, and avoid getting from copyrighted sources:

https://github.com/faker-js/faker/blob/next/CONTRIBUTING.md#sourcing-data-for-definitions

@ST-DDT
Copy link
Member

ST-DDT commented Mar 20, 2024

In the mean while I also need to learn the process of setting up a module.

Step 1) Explain what you need (including potential data structures) and in which context you need them

Aka do you need only the abbreviation or the full title as well? Where would you put them?
Is it standard for your field of work or just in your company. Is it for hospitals only or for other medical institutions as well? Which locales are you able to provide the data for?

Step 2) Get/Provide feedback

Step 3) Get upvotes/user interest -> get go ahead from from maintainers

Step 4) Implement, the easiest way might be copying the basics from the animal module.

@mmorris8
Copy link

Hmm..
Degree codes are international in and of themselves. There's only a handful of them, less than 50 probably, and my db only has around 30.

Most medical specialties are in Latin, so in western countries this will remain the same - i.e. "Urology" is "Urology" whether you're speaking English, German, French, and so on. There are some that have colloquial names though.

Pharmaceuticals are tricky. Most have a trademarked brand name - e.g. Tylenol - and a generic chemical name - acetaminophen. For the purposes of faker I think we can stick to the later just to be on the safe side.

Avoiding copyrighted sources entirely will be a bit of a problem. Names of certain procedures might be copyrighted or even trademarked. I'm not sure. Faker's usage is well within fair use guidelines - but that never stopped lawyers before (Exceptions in law are more worthless than used toilet paper and serve only as profit margins for lawyers).

@matthewmayer
Copy link
Contributor

For medicines there might be logic in using completely fictitious medicine brandnames so there's no confusing them with real medicines.

@mmorris8
Copy link

Brand names are unnecessary in my opinion. Also, the chemical names have the advantage of not needing internationalization in the western languages as, again, they are all Latin.

@matthewmayer
Copy link
Contributor

I'm just thinking if you had like a mockup of a fake prescription then it's probably not a good idea to have real medicines in there.

Like if you show ${faker.number.int({min:100, max:1000})}mg ${faker.health.medicine()}

If it is a real medicine like ibuprofen you might accidentally put in a dangerous-sounding dose.

If it's a fake medicine name like Zenaphase it won't matter.

In the same way as we try to avoid profanity in our words module.

@mmorris8
Copy link

Writing a test for such is a use case as well. It's a two-edged sword. I see no point in writing a module to create fake names - we have the lorem module already.

@ST-DDT
Copy link
Member

ST-DDT commented Mar 20, 2024

Like if you show ${faker.number.int({min:100, max:1000})}mg ${faker.health.medicine()}

That is possible, but the pestcription would be generated by our users and not in our code and I hope that our users are professional enough to understand test data as such.
Random names have either nothing in common with medicin if list based or might result in even worse texts if random (e.g. 1000mg brainamin).

@matthewmayer
Copy link
Contributor

I mean the project is called "Faker" 🤣 we generally try to create plausible looking, not real data.

But I get your point. Latin-sounding names can be easily made already with lorem.

We might need to warn people that you shouldn't take random medicines in the same way we warn them not to call phone numbers generated by faker.phone.number() (as they may be real).

@mmorris8
Copy link

I'd hazard a guess that the main users of this will be code monkeys for hospital groups like me. We know better. And while we can just the lib as is to with workarounds (medical degree codes are 2 or 3 letters, medicine names are between 5 to 15 letters on average) it's a nice to have.

Anyway, I'll take a stab at an API. Note - on the lists below I recommend excluding items that are gender specific to prevent the distraction of having test code spit out nonsense like a male patient with a hysterectomy in their history.

Healthcare: Overall module name

  • faker.healthcare.npi: Returns a valid NPI (see https://www.eclaims.com/articles/how-to-calculate-the-npi-check-digit/)
  • faker.healthcare.drug: Return one of the top 100 prescribed drugs according to the FDA (avoiding the copyright issue by sourcing from the US government which releases their publications to public domain)
  • faker.healthcare.degreeCode: Return an accredited degree code - MD, APN, DO, DDO, etc.
  • faker.healthcare.procedure Return a medical procedure - Appendectomy, Carotid endarterectomy.
  • faker.healthcare.service Return a medical service - Bariatric, Behavioral & Mental Health, Hospice, Cancer, etc.
  • faker.healthcare.icd10Code Return a random ICD10 code. These published codes are free to public uses. There's a couple thousand of them - the top 100 or so most frequently used ones will be sufficient for test systems.
  • faker.healthcare.specialty Return a medical specialty - Heart Surgery, Neurosurgery, etc.
  • faker.healthcare.condition Return a medical condition other than a contagious disease
  • faker.healthcare.disease Return a contagious disease

That's a start. The existing finance module covers most of the rest of the testing I have to do.

@ST-DDT
Copy link
Member

ST-DDT commented Mar 20, 2024

Thanks for the specific api suggestion list.

The existing finance module covers most of the rest of the testing I have to do.

Just for curiosity, which methods from the finance module do you use/plan to use?

@thoroc
Copy link

thoroc commented Sep 13, 2024

Just chiming in, but does faker-js not have the capability to create your own provider like the python equivalent has?

That would allow the community to create providers that are not tied up to the core faker-js project.

That being said, I guess one could extend locally and import that local version of faker.

import { FakerOptions, Faker as FakerJs } from '@faker-js/faker';
import { CustomModule } from './custom-module';

class Faker extends FakerJs {
  readonly customModule: CustomModule;

  constructor(options: FakerOptions) {
    super(options);
    this.customModule = new CustomModule(this);
  }
}

export default Faker;

@matthewmayer
Copy link
Contributor

Just chiming in, but does faker-js not have the capability to create your own provider like the python equivalent has?

That would allow the community to create providers that are not tied up to the core faker-js project.

That being said, I guess one could extend locally and import that local version of faker.

import { FakerOptions, Faker as FakerJs } from '@faker-js/faker';
import { CustomModule } from './custom-module';

class Faker extends FakerJs {
  readonly customModule: CustomModule;

  constructor(options: FakerOptions) {
    super(options);
    this.customModule = new CustomModule(this);
  }
}

export default Faker;

this has been proposed at #704

it's easy enough to make a function which uses faker helper functions to add your own custom data, see https://dev.to/matthewmayer/leveling-up-your-custom-fake-data-with-fakerjs-3f7m )

@thoroc
Copy link

thoroc commented Sep 14, 2024

Thank you. I've missed that one. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature s: awaiting more info Additional information are requested s: waiting for user interest Waiting for more users interested in this feature
Projects
None yet
Development

No branches or pull requests

6 participants