Importing Add Book

cbezuidenhout wrote on Tuesday, May 29, 2012:

Good Day to you all,

A quick question, I have a CSV file with local specialists, I would like to create a SQL script to allow easy importing of these specialist, what tables need to be populated with what data in order to achieve this?

Thanks
  - Craig
    Tajemo Enterprises

deschel wrote on Tuesday, May 29, 2012:

Hi Craig,

I know this table well, because I am planning a major expansion to the address book.  The table is completely counter-intuitive, and in my opinion inappropriate. 

The table is “Users”.

Yes, that’s right - the same table that tracks Users for the database is also used for address book.  There are even password fields for each Address Book entry (they are just not used and left blank.)  Extremely poor database design - hope no one gets offended!

In the next month I will be presenting my improvements to the Address Book feature. 

Actually, I am planning on creating new tables with much more sophisticated database design, allowing one to many relationships between person and addresses and telephone numbers and etc.  Planning to use these tables for everything that needs an address - patients, insurance companies, secondary contacts, address book entries, users, and more. 

There will be separate tables from their sources, using one to many relationships.  I.E. Patient table will be related to contact; contact table will have a one to many relationship to an address table, to a telephone number table, etc.  Other tables that need to store contact info will also be related to the contact table.

The biggest problems will be mostly interface related, how to modify the demographic and other address screens to support this structure.

The database design that I would like to use as a model would be similar to the one in OpenMRS. 
See the link:  https://wiki.openmrs.org/display/docs/Data+Model.

I am still working on my design.   Much more to come . . .

David

bradymiller wrote on Tuesday, May 29, 2012:

Hi David,

Two key things to think about with database design (you’ve already thought about one):
1. Ensure the codebase gets refactored to support it
2. Ensure upgraders are supported

Looking very forward to your code,
-brady
OpenEMR