Issue in Auto name in Frappe

Hi everyone,

I have 3 doctypes “Patients” , “Visit details” and “Medical Details” .I used naming series as format:PATIENT-{first_name}-{#}for patient ,format:VISIT-{patient_name}-{####} for visit details and format:MEDET-{patient_name}-{#####} for medical details.When add 10 data to patients and then when adding data to visit details the naming series of visit details continues as VISIT-{patient_name}-0011 . I want to know how to reset that number to 001.

Please help me with this

First - Let me welcome you to the ERPNext community. It is good to see new users interested in setting up their own ERP systems. :smiley:

I think I know what you are asking…

Essentially you want Visits and Med Details to number smoothly on a PER PATIENT structure. (At least that is what I think you are asking).

However, “Naming Series” are structured to work “Per DocType”

So all Visits, regardless of associated Patient, will number consecutively. The same is true for all “Med Details” will number independently of Patient.

ERPNext is not structured to do nested Naming Series at this time.

You may get closer to what you want (likely a searchable record set by Patient) if you add a DATE to the Naming Series for “Visits” and “Med Details”. This would allow you to search by Patient and group them together by visit dates.

One last thing…

Some countries have patient security laws that restrict human readable medical data from being associated with human readable patient names on screens or other displays that could potentially be seen by the general public (or anyone NOT specifically connected to direct patient care). If you live an an area where this is true you may want to consider replacing the patient name with some permanent patient ID number in the Naming Series. This will prevent accidental leaking Patient names to anyone that happens to see a list of Visits or Med Details.

Probably NOT the answer you were hoping for here, but if you have enough developer resources available to you, it might be possible to contract someone to add the nested level of Naming Series that you want for your system.

Hope this helps…

BKM :sunglasses:

Hi @Sanjusha,

It’s same topic and posted a few hours before your post.

For your help please check this topic:

Thank You!

Thank you for your reply

First of all I apologize for the mistake on my part. The question I asked earlier was wrong and all I really wanted was the auto name in Frappe,We are using Frappe only and we used auto name field to generate naming not naming series.Please help me to find out this