Purpose and Benefits
Bahmni supports data migration via CSV files. There are two types of data you can create, patient and encounter. With patient you can create patient attributes, address details, patient identity amount with core patient fields. Patient import allows you to specify the patient identity matching logic using a groovy script. Encounter import allows you to create encounters with observations (we don't support orders yet). The import automatically creates the visits for you based on the days supplied.
Types of CSV Imports
Bahmni has 4 different types of imports for transactional data. For each type of import we have attached a sample file with some example rows.
1. Patient
Patient Data - This is just to create the patients with their identifiers (used by the hospital). patient.csv
Registration Number,Registration Date,First Name,Middle Name,Last Name,Gender,Birth Date,Address.Village,Address.Tehsil,Address.District,Address.State
2. Encounters
Encounter import meant for importing all clinical information about the patient. This is meant for observations, diagnosis, lab order/results and drug orders. We do not support the last two yet. The visit and encounters are also imported via this same file. Here is a sample file encounter_import.csv. The encounter fields reference:
Key | Use | Mandatory |
---|
Registration Number | The identifier for the patient, for example GAN200189 | Y |
Patient.Name | | N |
Patient.AGE | | N |
Patient.Gender | | N |
Patient.Village | | N |
encounterType | Name of encounter type, for example Consultation. | N (Encounter level) |
visitType | Name of the visit type, for example Outpatient. | N |
Visit Start Date | If visit dates are not provided the encounter date would be used to create a visit for just one day. If there is already a visit in the database for that date then the import would use that visit. | N |
Visit End Date | | N |
EncounterDate | | N (Encounter level) |
Obs.Obs Path | In obs path you can provide the complete concept-set+concept path. For example: Diabetes Template.Nutritional Values.Height | N (Encounter level, Multiple allowed) |
Diagnosis | The name of diagnosis concept. It assumes all diagnosis to be be primary and confirmed. | N (Encounter level, Multiple allowed) |
3. Lab Results
Please refer to the sample import file.
4. Relationships
The CSV Relationship Import/Upload provides an ability to import/upload relationship information for patients using a CSV file.
Consider two assumptions:
- We have an existing patient (Person A) for whom we would like to add relationships, whose registration number should be entered in the Registration_Number field.
We should populate the Related_To_Registration_Number field for relationships between 2 persons in the system. We should populate the Provider_Name field for relationships between a person and provider. Relationship_StartDate and Relationship_EndDate are optional fields. If the are not specified then Relationship_StartDate will be saved as today's date and Relationship_EndDate will be null.
- There will be a global property "bahmni.relationshipTypeMap", which provides all required mapping for all possible relationships. This is used to validate information provided in the CSV file in the Relationship_Type column.
The following is an example for a global property relationship mapping:
{
"patient": ["Sibling", "Parent", "Child", "Uncle"],
"provider": ["Doctor", "Nurse", "Care Taker"]
}
Data in the CSV file to be uploaded must be as per the following required order and names of columns:
- Registration_Number
- Relationship_Type
- Related_To_Registration_Number
- Provider_Name
- Relationship_StartDate
- Relationship_EndDate.
The first four columns are mandatory. The dates should be provided in the following format: yyyy-mm-dd. Here is an example of a relationship CSV file.