Anonymizing Bahmni Database

Hello, I was trying to run the anonymise script for version 0.81 according to the documentation from https://bahmni.atlassian.net/wiki/display/BAH/Anonymizing+Bahmni+Database. It was giving me the following error.

Can anyone look into this please.

Thanks in advance.

@ranju: Its failing because from 0.81 uuid cannot be empty or null. The anonymise script right now has to be changed accordingly.

This clearly shows that uuid is empty while inserting.

This has to be changed to

INSERT INTO 
	patient_identifier
	(patient_id, identifier, identifier_type, location_id, preferred, creator, date_created, voided, uuid)
SELECT
	patient_id,
	concat((Select prefix from idgen_seq_id_gen order by rand() limit 1), patient_id),
	(Select patient_identifier_type_id from patient_identifier_type where name = 'Bahmni Id'),
	1,
	1,
	1,
	'20080101',
	0,
    uuid()
FROM
	patient;

This is my understanding. Some one can verify and reply back if this is invalid.

@sravanthi17: It’s working fine.

I have created a pull request for the script.
https://github.com/Bahmni/bahmni-environment/pull/2 Please review it.