A: After cloning follow the below steps:-
Update /src/main/resources/application-dev.properties
and /bahmni-mart/src/test/resources/application-test.properties
with your corresponding vagrant ip and password(if required)
Connect to the database of your local vagrant with the IDEA you are working in
Run /scripts/dev/testMysql.sql
and sudo mysql -pP@ssw0rd123 -e "GRANT ALL ON test_openmrs.* to'test_user'@'localhost';FLUSH PRIVILEGES;"
in mysql database
Run /scripts/dev/psqlTestSetup.sql
and psql -U test_user test_analytics -c "CREATE SCHEMA bahmni_mart_scdf;“
in postgres database
Run the application to run the bahmni-mart.
A: For now mart can be installed only on the CentOS env.
As mentioned in the above answer, we can configure the bahmni-mart in any IDE and run the application. Please follow the steps mentioned above.
A: To install mart without metabase, we need to remove entries of metabase from bahmni-mart inventory file.The path to the inventory file is /etc/bahmni-mart-playbook/inventories/bahmni-mart
A: For Bahmni version >=0.89 & < 0.92 -> Install PostgreSQL 92
For Bahmni version >= 0.92 -> Install PostgreSQL 96
A: You can place an overridden version of bahmni-mart.json
at `/var/www/bahmni_config/bahmni-mart/
` path of your implementation environment.
A: Bahmni Mart Installation Setup
A: Bahmni-Mart Setup with MySQLWorkbench & DBeaver
A: /var/www/bahmni_config/bahmni-mart/bahmni-mart.json
A: Restart mysql and postgres servers and make sure you are connecting with correct password
A: While creating mart tables if you don’t want some fields from the openmrs table. You can add them to the "columnsToIgnore" field.
A: Bahmni mart reads job data from Bahmni and keeps it in memory until it pushes to analytics database. If the data in Bahmni is very large for that specific job memory overflow issues may occur. As of now bahmni-mart doesn’t have streaming support for all the jobs except orders. Please request for the feature enhancement.
A: Yes, it is safe to delete(or add) any unwanted job configurations from bahmni-mart.json
A: Make sure if you have corresponding configuration in mart. For example if you don't have registration second page configured for your implementation the corresponding view would be failing
A: Only Postgres database is supported by mart.
A: When you think more than one job can use the common sql queries, you can create a separate sql file and mention the type field as customSql and sourceFilePath as sql file path.
Else you can mention customSql in the type field and write the sql to be executed in readerSql field’.
A: Incremental load depends on the atom feed events that are published by openmrs. And we have the option to turn it on or off based on the usage. And we have a scheduler to publish the events from time to time. It can be configured through openmrs admin “Manage scheduler” page. Below is the property for the same
“OpenMRS event publisher task” If incremental load is not working fine, please check the above scheduler is running fine/not.
Q9 : How to view the log files.
A: We can find the log file related to bahmni-mart under /var/log/bahmni-mart
Q10 : How to stop the running mart.
A: Yet to be answered
Q11: What will happen if one of my jobs fails?
A: If one of the mart job fails, the error will be reflected in the bahmni-mart log file but the bahmni-mart will not stop. All the other jobs from the mart will run irrespective of the failed job.
A: Yet to be answered
A: Yet to be answered
A: Both Form 1 and Form 2 tables will have the entries for the observations filled.
But Form 1 tables will have the “id_formName” column which will contain “obs id”(openmrs) of the form concept.
Form 2 tables will have the “form_field_path” column which will contain the form name.
A: These both columns will come into picture when a separate table got created for either add-more/multi-select concepts and sections.
“form_field_path” will contain the form name along with the control id followed by count of the control among all the controls that got added using add more(i.e. Path from section to the obs).
Eg: form-name.{section_id} -{add_more_count_of_section}/{obs_control_id} - {add_more_count_of_obs} |
“reference_form_field_path” will contain the path of section in the form(i.e. path from form name to the section control).
Eg: form-name.{section_id} - {add_more_count_of_section} |
A: The issue could be with columnsToIgnore configuration. Mart internally parses the given SQL query in customSQL jobs using jsqlparser and removes the columns provided in columnsToIgnore. If the select part of the query is too complex(with aggregate functions etc), jsqlparser may not be too intelligent to parse the SQL query. You can solve the problem by avoiding complex select parts in the outermost select clause or update the SQL query to remove unwanted columns so columnsToIgnore configuration can be ignored
java.io.FileNotFoundException: /var/www/bahmni_config/bahmni-mart/bahmni-mart.json |
A: Make sure the bahmni-mart.json file is there in the /var/www/bahmni_config folder. Otherwise run below task to create a symlink from /etc/bahmni-mart/conf path
ln -s /etc/bahmni-mart/conf bahmni-mart.
Usually when we update the config the symlink gets removed.
A: Please check the passwords for both openmrs and analytics databases in /etc/bahmni-mart-playbook/setup.yml file. If it needs a change please update in setup.yml and re-run the mart installation.
A: Yes, and marker table can be updated for using data from a specific date
A: If you maintain your own mart code then you can go to the corresponding grouped job config and make modifications there.All grouped job config jsons will be placed under /src/main/resources/groupedJobs
(or)
If you don't have control over mart code copy the json contents from the corresponding grouped job json to your /var/www/bahmni_config/bahmni-mart/bahmni-mart.json and make the required modifications
A: You can add configuration to create new tables for all “multi-select” and “add more” concepts by enabling AddMoreAndMultiSelect to true
A: You can configure the concept to have separate table created by giving concept in "separateTables": [] in json file.
A: If you make any changes in bahmni-mart.json, run the mart in full load once and proceed.
A: Mart does incremental loading using the events in Bahmni/openmrs by default. If there is any delay in raising the event or if the event skipped due to unknown reasons by mart, you can’t see the data. It is recommended to do a full-load of mart once in a while. You can do full load safely by truncating markers table and deleting all the tables (deleting schema) in the analytics database.
A: If you do any metadata changes(Eg: changing form name) in Bahmni, the mart is not so intelligent to clear the stale tables. It is recommended to do full-load when there is a change in Bahmni metadata or if any configuration is updated in bahmni-mart.json.
Q8. How can I override the default mart configuration for any particular implementation?
A: You can place an overridden version of bahmni-mart.json at
/var/www/bahmni_config/bahmni-mart/path of your implementation environment. |
A: Flattening the data from beginning with every run is called as Full load where as flattening the data from the point where it completed in last run called as Incremental Load.
e.g. Suppose we have 100 records to get flattened. In Full load, in each run it will start flattening the data from 0 to 100.
Where as in Incremental load, if in first run the data flattened till 50 in second run it will start flattening from 51 not from 0.
A: Following cases are possible:
When the form has duplicate concepts, the table creation for the form will be skipped
When the concept is more than 50 characters, postures will skip creating the table
A: Special characters are replaced with underscores (_)
A: In Job level, few jobs have incremental load feature enabled. All jobs doesn’t fall in that category. For more information Incremental Update
User can execute the below steps in analytics database to run the mart in full load
drop schema public CASCADE; CREATE SCHEMA public; create table markers ( job_name text not null constraint markers_pkey primary key, event_record_id integer not null, category text not null, table_name text not null ); alter table markers owner to analytics; \q |
Note: the above step can be used only if mart ran at-least once in the server.
A: You can add the specific concepts to columns to ignore section as mentioned below. Those concepts and the data related to the concepts will not be displayed
"columnsToIgnore": [ ]
A: You can configure password in the playbook before running the mart.
/etc/bahmni-mart-playbook/setup.yml |
A: Yes, the mart performance depends on the size of the query and the number of joins that the query has.
Q2.How long will it take to run mart?
A: It depends majorly on the following 2 factors:
It depends on the number of jobs configured in the bahmni-mart.json file
Data present in the openmrs tables.
A: Running mart on full load or incremental load completely depends on usecase and number of observations.
For the first time, mart runs on full load and the subsequent run will be incremental load.
But if any metadata got changed, then its always better to run mart on full load