Skip to content

bahmni-msf/patient-identifier-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patient Identifier Generator

This repository helps in generating patient identifier dynamically

Currently through openmrs we can set static prefix and suffix. With this module we are allowing the user to have dynamic prefix and suffix

Prefix: To configure dynamic prefix we need a have a global property bahmni.patientidentifier.prefixConceptName set with a personAttribute and answers of that person attribute(i.e Concept) should have abbreviation in concept_reference_map table
Suffix: Suffix would be always gender

If we configure static prefix and also set the global property say nationality the we get nationality+static prefix+number+gender

Sample sql to add abbreviation to concepts

SELECT concept_source_id FROM concept_reference_source WHERE name = "Abbreviation";
SELECT concept_map_type_id INTO @concept_map_type_id FROM concept_map_type WHERE name='SAME-AS';

SELECT uuid() INTO @uuid;
SELECT now() INTO @time_now;
INSERT INTO concept_reference_term (name, code, creator, date_created,concept_source_id, retired, uuid)
                            VALUES ('EG', 'EG', 1, @time_now, @concept_source_id, 0, @uuid);

SELECT concept_reference_term_id INTO @concept_reference_term_id FROM concept_reference_term WHERE name='EG';

SELECT concept_id INTO @concept_id FROM concept_name WHERE name = 'Egyptian' AND concept_name_type = 'FULLY_SPECIFIED';
SELECT uuid() INTO @uuid;
INSERT INTO concept_reference_map (concept_reference_term_id, concept_map_type_id, concept_id, date_created, creator, uuid)
                            VALUES(@concept_reference_term_id , @concept_map_type_id, @concept_id, @time_now,1, @uuid);

About

Helps to generate patient identifier dynamically

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages