import_and_export:importing_names

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
import_and_export:importing_names [2020/08/20 06:51] – [Setting up the import file] Mark Gloverimport_and_export:importing_names [2024/04/04 15:07] (current) – [Setting up the import file] Gary Willetts
Line 1: Line 1:
 {{indexmenu_n>30}} {{indexmenu_n>30}}
-====== 16.03. Importing names ====== +====== 17.03. Importing names ====== 
-<WRAP round important 60%> +In mSupply, //Names// are customers, suppliers, manufacturers, patientsdonors and benchmark suppliers.
-\\ In mSupply, //Names// are customers, suppliers, manufacturers, patients and donors +
-</WRAP>+
  
 ==== Introduction ==== ==== Introduction ====
-<WRAP center round tip60%> 
-Importing a large number of names can really bog down the server.  How much depends on the server hardware, but a realistic expectation is an hour per 10,000 names. 
  
-We recommend that you do it when other users are not trying to do anything with mSupply!+<WRAP center round tip 60%> 
 +  * Importing a large number of names can really bog down the server.  How much depends on the server hardware, but a realistic expectation is an hour per 10,000 names. 
 +  * We recommend that you do it when other users are not trying to do anything with mSupply!
 </WRAP> </WRAP>
  
Line 16: Line 14:
  
  
-<WRAP center round tip 60%> +<WRAP center round important 60%> 
-If you are in a [[other_stuff:virtual_stores|multi store system]], do the names need to be visible to all stores?  If not, consider setting the //Names created in other stores not visible in this store// or //Patients created in other stores not visible in this store// preferences in other stores. See the [[other_stuff:virtual_stores#preferences_tab|Store preferences]] section for details.+  If you are in a [[other_stuff:virtual_stores|multi store system]], do the names need to be visible in all stores?  If not, consider setting the //Names created in other stores not visible in this store// or //Patients created in other stores not visible in this store// preferences in other stores. See the [[other_stuff:virtual_stores#preferences_tab|Store preferences]] section for details
 +  * If the relevant preference is turned on, all new names will be visible in the store you are logged into <wrap em>only</wrap>. If it is turned off, then all new names will be visible in <wrap em>all</wrap> stores.
 </WRAP> </WRAP>
 +
  
 ==== Setting up the import file ==== ==== Setting up the import file ====
Line 24: Line 24:
  
 ^ Column  ^ Field     ^ ^ Column  ^ Field     ^
-| A       | Code                      | +| A       | Code. **Mandatory**                      | 
-| B       | Name                      +| B       | Name. **Mandatory**                       
-| C       | Type - see below for more details |+| C       | Type - see below for more details. **Mandatory**  |
 | D       | Address 1                 | | D       | Address 1                 |
 | E       | Address 2                 | | E       | Address 2                 |
Line 36: Line 36:
 | K       | Last name. This column is the difference between a customer and a patient:  A customer will have a blank last name, a patient **must** have a non-blank last name | | K       | Last name. This column is the difference between a customer and a patient:  A customer will have a blank last name, a patient **must** have a non-blank last name |
 | L       | First name (applies only to people)         | | L       | First name (applies only to people)         |
-| M       | Date of birth (please use 4-digit year)     |+| M       | Date of birth (use 4-digit years)     |
 | N       | Gender (enter "F" or "True" for females. All other values taken as male) | | N       | Gender (enter "F" or "True" for females. All other values taken as male) |
 | O       | Custom 1                  | | O       | Custom 1                  |
Line 48: Line 48:
 | W       | Postcode (Zip code)       | | W       | Postcode (Zip code)       |
 | X       | On hold ("T" or "Y" for true, anything else, including blank, for false) | | X       | On hold ("T" or "Y" for true, anything else, including blank, for false) |
 +| Y       | Latitude (positive or negative decimal number)  |
 +| Z       | Longitude (positive or negative decimal number) |
 +| AA      | ID. The ID of the name record in the mSupply database. Optional and ignored unless updating a name. If you're updating a name then it is mandatory. During an update, the name this ID belongs to is compared with the name the code in column A belongs to. If they are the same record then the update will proceed, otherwise this line in the import file will be skipped. |
  
 Column C describes the type of the name being imported. That is, whether it is a customer, supplier, manufacturer, donor or patient. A name could be any one of these or several of them. To indicate which of these the name is, simply include the letter shown in the table below in the type field (letter order is not important): Column C describes the type of the name being imported. That is, whether it is a customer, supplier, manufacturer, donor or patient. A name could be any one of these or several of them. To indicate which of these the name is, simply include the letter shown in the table below in the type field (letter order is not important):
Line 53: Line 56:
 ^ Value ^ Meaning ^  ^ Value ^ Meaning ^ 
 | C | Customer or Patient. To be recognised as a patient, the line in the import file must have a non-blank last name | | C | Customer or Patient. To be recognised as a patient, the line in the import file must have a non-blank last name |
 +| P | Patient |
 | S | Supplier | | S | Supplier |
 | M | Manufacturer | | M | Manufacturer |
 | D | Donor | | D | Donor |
 +| B | Benchmark supplier (for use in tenders) |
 | (blank) | Both a customer and a supplier | | (blank) | Both a customer and a supplier |
  
Line 62: Line 67:
 You might find this template useful: {{ :import_and_export:name_import_template.xlsx |}} You might find this template useful: {{ :import_and_export:name_import_template.xlsx |}}
 or this export settings file: {{:import_and_export:names_export_order.4si.zip}} or this export settings file: {{:import_and_export:names_export_order.4si.zip}}
 +
 +The first 3 fields (**Code**, **Name** and **Type**) are mandatory for each name imported. If a row in the import file does not have values for these 3 fields then it will be skipped and ignored during the import process.
  
 <WRAP center round info 60%> <WRAP center round info 60%>
Line 69: Line 76:
     * Ignore the first line.  You will want to if you have used the first row for column headings     * Ignore the first line.  You will want to if you have used the first row for column headings
     * Strip out line feeds and quote characters.  You will want to do if you've used Excel to save the text file.     * Strip out line feeds and quote characters.  You will want to do if you've used Excel to save the text file.
 +  * If there are non-printable characters before or after the name, code, last name or first name they will be removed. Any non-printable characters in the name, code, last name or first name will be replaced with an underscore (<wrap em>_</wrap>) - but note that spaces in the code will not be affected.
 </WRAP> </WRAP>
  
Line 75: Line 83:
   * MS Excel tends to add extra characters (line feeds and quotes), but mSupply will gracefully remove these without complaining providing you select that option -see info box above.   * MS Excel tends to add extra characters (line feeds and quotes), but mSupply will gracefully remove these without complaining providing you select that option -see info box above.
   * Avoid having the Code field containing a space character as this can cause problems during import   * Avoid having the Code field containing a space character as this can cause problems during import
 +  * If the file you are importing has non-English characters (for example, accents), it is important to make sure the file is saved with a UTF-8 charset. You can check this by opening the file in Notepad (for Windows). When you save the file, you can choose the Charset used, as shown in image below.  
 +
 +{{  :import_and_export:pasted:20201216-023239.png }}
 +</WRAP>
 +
 +<WRAP important center round 90%>
 +If you import patients into a store which is not a dispensary, they will be imported but they will be **invisible** everywhere. You must make them **visible** in the appropriate dispensary stores before they can be used.
 </WRAP> </WRAP>
  
Line 84: Line 99:
  
 {{ :import_and_export:names_import.png? |}} {{ :import_and_export:names_import.png? |}}
- 
-<WRAP info center round 90%> 
-Please note that the visibility of any new names created will be subject to the state of the //Names created in this store not visible in other store// preference (see [[other_stuff:virtual_stores#the_preferences_tab|Virtual stores, the Preferences tab]] for details) - if the preference is turned on, all new names will be visible in the store you are logged into only. If it is turned off then all new names will be visible in all stores. 
-</WRAP> 
  
 If the first line of your import file contains column headers then check the **First line contains headers** checkbox. This tells mSupply to ignore the first line and start importing form the second line. If the first line of your import file contains column headers then check the **First line contains headers** checkbox. This tells mSupply to ignore the first line and start importing form the second line.
  • Last modified: 2020/08/20 06:51
  • by Mark Glover