-
Notifications
You must be signed in to change notification settings - Fork 647
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
how to add new names #908
Comments
Replace or edit the Just replace the names under If you want to add names for a new language without overwriting the current names (i.e. not Spanish or English), just add a language section (e.g. |
Hi. I've tried out adding new names this morning and modified the Edits to Names.java in case I'm making a mistake (likely)... public static String fakeFirstName(String gender, String language, Person person) {
List<String> choices;
if ("spanish".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("spanish." + gender);
} else if ("french".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("french." + gender);
} else if ("arabic".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("arabic." + gender);
} else if ("chinese".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("chinese." + gender);
} else if ("russian".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("russian." + gender);
} else {
choices = (List<String>) names.get("english." + gender);
} public static String fakeLastName(String language, Person person) {
List<String> choices;
if ("spanish".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("spanish.family");
} else if ("french".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("french.family");
} else if ("arabic".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("arabic.family");
} else if ("chinese".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("chinese.family");
} else if ("russian".equalsIgnoreCase(language)) {
choices = (List<String>) names.get("russian.family");
} else {
choices = (List<String>) names.get("english.family");
} |
If you want all names to have equal probability, the easiest solution is to just shove all the names under What you have done is fine. However, the reason that all names do not have equal probability, is that the number of patients who speak a foreign language as their primary language is a significant minority. If you want to edit that, you need to edit the primary language code (honestly, this should probably be in a configuration file somewhere): synthea/src/main/java/org/mitre/synthea/world/geography/Demographics.java Lines 130 to 231 in 6ed19ab
|
Thanks @jawalonoski I think I understand. When using Other Areas is the class |
Yes, it is still used. No, there is no way to currently override that except through code. As I said though, it really should be in a configuration file. We'd be happy to take that as a pull request if you or anyone else wants to make that contribution. |
Edit the following property to # If true, person names have numbers appended to them to make them more obviously fake
generate.append_numbers_to_person_names = true That being said, I do not recommend that you do this, since the numbers are a good indicator that these people are fake. |
got it. |
I hope a small follow-up is ok. For names, it looks like the project must be rebuilt after replacing name.yml. Is that also true for demographics/Other Areas, and is there some gradle/Java trick to not rebuild but still load the new files for testing? |
Gradle has a feature called compile avoidance, so it only rebuilds the things that have changed. If you use the |
Hello,
I am trying to add new names. I have 1000 names and surnames which needs to be added. and i need to generate 10k patients.
how to provide the names to randomize?
Do I need to change the language and ethnicity also? If it is mandatory please let me know how to change it or add new language and ethnicity.
Appreciate your response and time
Thankyou
The text was updated successfully, but these errors were encountered: