faker icon indicating copy to clipboard operation
faker copied to clipboard

Add medical module

Open zlock55 opened this issue 1 year ago • 19 comments

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 avatar Aug 12 '23 22:08 zlock55

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

github-actions[bot] avatar Aug 12 '23 22:08 github-actions[bot]

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 avatar Aug 12 '23 22:08 ST-DDT

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)

mmorris8 avatar Mar 19 '24 14:03 mmorris8

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.

matthewmayer avatar Mar 19 '24 23:03 matthewmayer

Thanks. I will look into that for sure.

mmorris8 avatar Mar 20 '24 11:03 mmorris8

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

matthewmayer avatar Mar 20 '24 11:03 matthewmayer

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.

ST-DDT avatar Mar 20 '24 11:03 ST-DDT

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).

mmorris8 avatar Mar 20 '24 12:03 mmorris8

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

matthewmayer avatar Mar 20 '24 12:03 matthewmayer

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.

mmorris8 avatar Mar 20 '24 12:03 mmorris8

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.

matthewmayer avatar Mar 20 '24 13:03 matthewmayer

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.

mmorris8 avatar Mar 20 '24 13:03 mmorris8

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).

ST-DDT avatar Mar 20 '24 13:03 ST-DDT

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).

matthewmayer avatar Mar 20 '24 13:03 matthewmayer

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.

mmorris8 avatar Mar 20 '24 17:03 mmorris8

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?

ST-DDT avatar Mar 20 '24 18:03 ST-DDT