diff --git a/= b/=
new file mode 100644
index 0000000..e69de29
diff --git a/src/main/java/com/openmrs/migrator/Migrator.java b/src/main/java/com/openmrs/migrator/Migrator.java
index a83a895..3cfef88 100644
--- a/src/main/java/com/openmrs/migrator/Migrator.java
+++ b/src/main/java/com/openmrs/migrator/Migrator.java
@@ -145,6 +145,17 @@ private void executeSetupCommand() throws IOException, SQLException, SettingsExc
pdiFiles.add(
SettingsService.PDI_RESOURCES_DIR + "/transformations/validate-visit-attribute-types.ktr");
pdiFiles.add(SettingsService.PDI_RESOURCES_DIR + "/transformations/validate-visit-types.ktr");
+ pdiFiles.add(SettingsService.PDI_RESOURCES_DIR + "/transformations/merge-persons.ktr");
+ pdiFiles.add(SettingsService.PDI_RESOURCES_DIR + "/transformations/merge-users.ktr");
+ pdiFiles.add(
+ SettingsService.PDI_RESOURCES_DIR + "/transformations/merge-concept-datatypes.ktr");
+ pdiFiles.add(SettingsService.PDI_RESOURCES_DIR + "/transformations/merge-concept-classes.ktr");
+ pdiFiles.add(SettingsService.PDI_RESOURCES_DIR + "/transformations/merge-concepts.ktr");
+ pdiFiles.add(
+ SettingsService.PDI_RESOURCES_DIR + "/transformations/merge-person-attribute-types.ktr");
+ pdiFiles.add(
+ SettingsService.PDI_RESOURCES_DIR + "/transformations/merge-person-attributes.ktr");
+ pdiFiles.add(SettingsService.PDI_RESOURCES_DIR + "/transformations/merge-privileges.ktr");
pdiFiles.add(SettingsService.SETTINGS_PROPERTIES);
pdiFiles.add(SettingsService.PDI_PLUGINS_DIR + "/pdi-core-plugins-impl-8.2.0.7-719.jar");
diff --git a/src/main/resources/pdiresources/jobs/control-center.kjb b/src/main/resources/pdiresources/jobs/control-center.kjb
index 4cabad1..28f0a60 100644
--- a/src/main/resources/pdiresources/jobs/control-center.kjb
+++ b/src/main/resources/pdiresources/jobs/control-center.kjb
@@ -395,7 +395,7 @@
64
-
+ mergeJOB
@@ -466,7 +466,7 @@
merge00
- Y
+ NYN
diff --git a/src/main/resources/pdiresources/jobs/merge.kjb b/src/main/resources/pdiresources/jobs/merge.kjb
index d68dc51..c910757 100644
--- a/src/main/resources/pdiresources/jobs/merge.kjb
+++ b/src/main/resources/pdiresources/jobs/merge.kjb
@@ -4,12 +4,11 @@
- 0/-2019/08/26 13:13:15.739-
- 2019/08/26 13:13:15.739
+ 2019/08/26 18:05:32.913
@@ -305,8 +304,198 @@
NY0
- 160
- 112
+ 16
+ 16
+
+
+
+ create or replace mappings table
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/create-mappings.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 0
+ 80
+ 32
+
+
+
+ merge persons
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/merge-persons.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 0
+ 352
+ 240
+
+
+
+ person changed by
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-changed-by.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 1
+ 816
+ 64
+
+
+
+ merge users
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/merge-users.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 416
+ 224
+
+
+
+ user creators
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-creators.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 896
+ 160
@@ -316,7 +505,937 @@
filename
- pdiresources/transformations/merge-encounter.ktr
+ ${Internal.Entry.Current.Directory}/../transformations/merge-encounter.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 0
+ 48
+ 384
+
+
+
+ Set person entities update variables
+
+ SET_VARIABLES
+
+ Y
+
+ CURRENT_JOB
+
+
+ ENTITY
+ person
+ JVM
+
+
+ N
+ Y
+ 0
+ 640
+ 0
+
+
+
+ Set users entities update variables
+
+ SET_VARIABLES
+
+ Y
+
+ CURRENT_JOB
+
+
+ ENTITY
+ users
+ JVM
+
+
+ N
+ Y
+ 0
+ 944
+ 304
+
+
+
+ person voided by
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-voided-by.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 752
+ 80
+
+
+
+ person creators
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-creators.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 3
+ 688
+ 64
+
+
+
+ user retired by
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-retired-by.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 816
+ 144
+
+
+
+ user changed by
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-changed-by.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 1
+ 752
+ 160
+
+
+
+ user person id
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-person-id.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 1
+ 672
+ 144
+
+
+
+ merge concepts
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/merge-concepts.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 272
+ 224
+
+
+
+ merge concept datatypes
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/merge-concept-datatypes.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 192
+ 160
+
+
+
+ merge concept classes
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/merge-concept-classes.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 128
+ 96
+
+
+
+ Set concept class entities update variables
+
+ SET_VARIABLES
+
+ Y
+
+ CURRENT_JOB
+
+
+ ENTITY
+ concept_class
+ JVM
+
+
+ N
+ Y
+ 0
+ 240
+ 0
+
+
+
+ concept datatype
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-concept-datatype.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 624
+ 80
+
+
+
+ concept class
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-concept-class.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 1
+ 368
+ 96
+
+
+
+ Set concept datatype entities update variables
+
+ SET_VARIABLES
+
+ Y
+
+ CURRENT_JOB
+
+
+ ENTITY
+ concept_datatype
+ JVM
+
+
+ N
+ Y
+ 0
+ 496
+ 16
+
+
+
+ person cause_of_death
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-cause-of-death.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 1
+ 944
+ 80
+
+
+
+ merge person attribute types
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/merge-person-attribute-types.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 528
+ 128
+
+
+
+ merge person attributes
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/merge-person-attributes.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 384
+ 144
+
+
+
+ Set person attribute types entities update variables
+
+ SET_VARIABLES
+
+ Y
+
+ CURRENT_JOB
+
+
+ ENTITY
+ person_attribute_type
+ JVM
+
+
+ N
+ Y
+ 0
+ 896
+ 352
+
+
+
+ Set person attribute entities update variables
+
+ SET_VARIABLES
+
+ Y
+
+ CURRENT_JOB
+
+
+ ENTITY
+ person_attribute
+ JVM
+
+
+ N
+ Y
+ 0
+ 816
+ 448
+
+
+
+ privileges
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-edit-privileges.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 704
+ 224
+
+
+
+ pa type
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-person-attribute-type.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 416
+ 384
+
+
+
+ merge privilege
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/merge-privileges.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 512
+ 224
+
+
+
+ pat changedBy
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-changed-by.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 768
+ 304
+
+
+
+ pat creator
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-creators.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 688
+ 288
+
+
+
+ pat retired by
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-retired-by.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 672
+ 352
+
+
+
+ pa changedBy
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-changed-by.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 624
+ 432
+
+
+
+ pa creator
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-creators.ktrNN
@@ -342,17 +1461,399 @@
NY
- 0
- 320
- 112
+ 2
+ 688
+ 416
+
+
+
+ pa voided by
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-voided-by.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 528
+ 400
+
+
+
+ pa person
+
+ TRANS
+
+ filename
+
+ ${Internal.Entry.Current.Directory}/../transformations/update-mapped-foreign-person-id.ktr
+
+ N
+ N
+ N
+ N
+ N
+ N
+
+
+ N
+ N
+ Basic
+ N
+
+ N
+ Y
+ N
+ N
+ N
+ Pentaho local
+
+ Y
+
+ N
+ Y
+ 2
+ 304
+ 384Start
- merge encounter
+ create or replace mappings table
+ 0
+ 0
+ Y
+ Y
+ Y
+
+
+ Set users entities update variables
+ user creators
+ 0
+ 2
+ Y
+ Y
+ Y
+
+
+ person voided by
+ person changed by
+ 2
+ 1
+ Y
+ Y
+ Y
+
+
+ person creators
+ person voided by
+ 3
+ 2
+ Y
+ Y
+ Y
+
+
+ user creators
+ user retired by
+ 2
+ 2
+ Y
+ Y
+ N
+
+
+ user retired by
+ user changed by
+ 2
+ 1
+ Y
+ Y
+ N
+
+
+ user changed by
+ user person id
+ 1
+ 1
+ Y
+ Y
+ N
+
+
+ merge concept classes
+ merge concept datatypes
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ merge concept datatypes
+ merge concepts
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ create or replace mappings table
+ merge concept classes
+ 0
+ 2
+ Y
+ Y
+ N
+
+
+ merge concepts
+ merge persons
+ 2
+ 0
+ Y
+ Y
+ Y
+
+
+ merge persons
+ merge users
+ 0
+ 2
+ Y
+ Y
+ Y
+
+
+ Set concept class entities update variables
+ concept class
+ 0
+ 1
+ Y
+ Y
+ Y
+
+
+ concept datatype
+ Set person entities update variables
+ 2
+ 0
+ Y
+ Y
+ Y
+
+
+ concept class
+ Set concept datatype entities update variables
+ 1
+ 0
+ Y
+ Y
+ Y
+
+
+ Set concept datatype entities update variables
+ concept datatype
+ 0
+ 2
+ Y
+ Y
+ Y
+
+
+ Set person entities update variables
+ person creators
+ 0
+ 3
+ Y
+ Y
+ N
+
+
+ person changed by
+ person cause_of_death
+ 1
+ 1
+ Y
+ Y
+ Y
+
+
+ person cause_of_death
+ Set users entities update variables
+ 1
+ 0
+ Y
+ Y
+ Y
+
+
+ merge person attribute types
+ merge person attributes
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ merge person attributes
+ Set concept class entities update variables
+ 2
+ 0
+ Y
+ Y
+ Y
+
+
+ user person id
+ Set person attribute types entities update variables
+ 1
+ 0
+ Y
+ Y
+ N
+
+
+ Set person attribute types entities update variables
+ privileges
+ 0
+ 2
+ Y
+ Y
+ N
+
+
+ merge users
+ merge privilege
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ merge privilege
+ merge person attribute types
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ privileges
+ pat changedBy
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ pat changedBy
+ pat creator
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ pat creator
+ pat retired by
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ pat retired by
+ Set person attribute entities update variables
+ 2
+ 0
+ Y
+ Y
+ Y
+
+
+ pa voided by
+ pa type
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ Set person attribute entities update variables
+ pa creator0
+ 2
+ Y
+ Y
+ Y
+
+
+ pa creator
+ pa changedBy
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ pa changedBy
+ pa voided by
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ pa type
+ pa person
+ 2
+ 2
+ Y
+ Y
+ Y
+
+
+ pa person
+ merge encounter
+ 20YY
diff --git a/src/main/resources/pdiresources/transformations/create-mappings.ktr b/src/main/resources/pdiresources/transformations/create-mappings.ktr
new file mode 100644
index 0000000..e148e7c
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/create-mappings.ktr
@@ -0,0 +1,548 @@
+
+
+
+ create-mappings
+
+
+
+ Normal
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/26 16:16:32.316
+ -
+ 2019/08/26 16:16:32.316
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ destination/merge
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+
+ create or replace mappings table
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ destination/merge
+ N
+ N
+ N
+ N
+ DROP TABLE IF EXISTS migrator_merge_mappings;
+CREATE TABLE migrator_merge_mappings(
+ mapping_id int(11) NOT NULL AUTO_INCREMENT,
+ entity VARCHAR(38) NOT NULL,
+ attribute VARCHAR(38) NOT NULL,
+ answer int(11),
+ text_answer VARCHAR(255),
+ uuid VARCHAR(38),
+ PRIMARY KEY (mapping_id)
+) ENGINE=INNODB;
+ N
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 208
+ 48
+ Y
+
+
+
+
+
+
+ N
+
+
diff --git a/src/main/resources/pdiresources/transformations/merge-concept-classes.ktr b/src/main/resources/pdiresources/transformations/merge-concept-classes.ktr
new file mode 100644
index 0000000..6b17070
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/merge-concept-classes.ktr
@@ -0,0 +1,1183 @@
+
+
+
+ merge-concept-classes
+
+
+
+ Normal
+ 0
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/06 09:23:50.203
+ -
+ 2019/08/06 09:23:50.203
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ OpenMRS destination
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+ OpenMRS source
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_SOURCE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+ Load concept classes from Source
+ Concept classes In Both Source & Destination
+ Y
+
+
+ Concept classes In Both Source & Destination
+ Concept class in Source Not Destination
+ Y
+
+
+ insert merge mapping for concept class
+ Creator Exists on Destination
+ Y
+
+
+ Creator Exists on Destination
+ insert merge mapping for missing creator
+ Y
+
+
+ Daemon user
+ insert merge mapping for concept class
+ Y
+
+
+ insert merge mapping for missing creator
+ Set creator to daemon user
+ Y
+
+
+ Concept class in Source Not Destination
+ Concept class Creator uuid From Destination
+ Y
+
+
+ Concept class Creator uuid From Destination
+ User retired by uuid From Destination
+ Y
+
+
+ User retired by uuid From Destination
+ Daemon user
+ Y
+
+
+ Creator Exists on Destination
+ Retired by Exists on Destination
+ Y
+
+
+ Retired by Exists on Destination
+ Save Missing concept class into Destination
+ Y
+
+
+ Set creator to daemon user
+ Retired by Exists on Destination
+ Y
+
+
+ Retired by Exists on Destination
+ insert merge mapping for missing retired by
+ Y
+
+
+ insert merge mapping for missing retired by
+ Set retired by to daemon user
+ Y
+
+
+ Set retired by to daemon user
+ Save Missing concept class into Destination
+ Y
+
+
+
+ Concept class Creator uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_creator_uuid from users where user_id = ?
+ Y
+ N
+
+
+ creator
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 208
+ 240
+ Y
+
+
+
+ Concept class in Source Not Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ Concept class Creator uuid From Destination
+
+
+
+ N
+ destination_concept_class_id
+ IS NULL
+
+
+
+
+
+
+
+
+
+
+
+ 336
+ 368
+ Y
+
+
+
+ Concept classes In Both Source & Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select concept_class_id as destination_concept_class_id from concept_class where uuid = ?
+ Y
+ N
+
+
+ uuid
+ String
+
+
+
+
+
+
+
+
+
+
+ 144
+ 336
+ Y
+
+
+
+ Creator Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ Retired by Exists on Destination
+ insert merge mapping for missing creator
+
+
+ N
+ destination_creator_uuid
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+ 352
+ 96
+ Y
+
+
+
+ Daemon user
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select user_id as daemon_user_id from users where system_id = 'daemon';
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 256
+ 16
+ Y
+
+
+
+ Load concept classes from Source
+ TableInput
+
+ N
+
+ 1
+
+ none
+
+
+ OpenMRS source
+ SELECT * FROM concept_class;
+ 0
+
+ N
+ N
+ N
+
+
+
+
+
+
+
+
+ 112
+ 32
+ Y
+
+
+
+ Retired by Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ Save Missing concept class into Destination
+ insert merge mapping for missing retired by
+
+
+ N
+ destination_retired_by_uuid
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+ 720
+ 16
+ Y
+
+
+
+ Save Missing concept class into Destination
+ TableOutput
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+
+
concept_class
+ 1000
+ N
+ N
+ Y
+ Y
+ N
+
+ N
+ Y
+ N
+
+ Y
+ N
+
+
+
+ name
+ name
+
+
+ description
+ description
+
+
+ creator
+ creator
+
+
+ date_created
+ date_created
+
+
+ retired
+ retired
+
+
+ retired_by
+ retired_by
+
+
+ date_retired
+ date_retired
+
+
+ retire_reason
+ retire_reason
+
+
+ uuid
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 912
+ 112
+ Y
+
+
+
+ Set creator to daemon user
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ creator
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 608
+ 144
+ Y
+
+
+
+ Set retired by to daemon user
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ retired_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 768
+ 176
+ Y
+
+
+
+ User retired by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_retired_by_uuid from users where user_id = ?
+ Y
+ N
+
+
+ retired_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 224
+ 160
+ Y
+
+
+
+ insert merge mapping for concept class
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept_class', 'concept_class_id', ?, ?);
+ Y
+
+
+
+
+
+
+ concept_class_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 464
+ 16
+ Y
+
+
+
+ insert merge mapping for missing creator
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept_class', 'creator', ?, ?);
+ Y
+
+
+
+
+
+
+ creator
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 416
+ 288
+ Y
+
+
+
+ insert merge mapping for missing retired by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept_class', 'retired_by', ?, ?);
+ Y
+
+
+
+
+
+
+ retired_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 592
+ 240
+ Y
+
+
+
+
+
+
+ N
+
+
diff --git a/src/main/resources/pdiresources/transformations/merge-concept-datatypes.ktr b/src/main/resources/pdiresources/transformations/merge-concept-datatypes.ktr
new file mode 100644
index 0000000..57c853e
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/merge-concept-datatypes.ktr
@@ -0,0 +1,1187 @@
+
+
+
+ merge-concept-datatypes
+
+
+
+ Normal
+ 0
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/06 09:23:50.203
+ -
+ 2019/08/06 09:23:50.203
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ OpenMRS destination
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+ OpenMRS source
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_SOURCE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+ Load concept datatypes from Source
+ Concept datatypes In Both Source & Destination
+ Y
+
+
+ Concept datatypes In Both Source & Destination
+ Concept datatype in Source Not Destination
+ Y
+
+
+ insert merge mapping for concept datatype
+ Creator Exists on Destination
+ Y
+
+
+ Creator Exists on Destination
+ insert merge mapping for missing creator
+ Y
+
+
+ Daemon user
+ insert merge mapping for concept datatype
+ Y
+
+
+ insert merge mapping for missing creator
+ Set creator to daemon user
+ Y
+
+
+ Concept datatype in Source Not Destination
+ Concept datatype Creator uuid From Destination
+ Y
+
+
+ Concept datatype Creator uuid From Destination
+ User retired by uuid From Destination
+ Y
+
+
+ User retired by uuid From Destination
+ Daemon user
+ Y
+
+
+ Creator Exists on Destination
+ Retired by Exists on Destination
+ Y
+
+
+ Retired by Exists on Destination
+ Save Missing concept datatype into Destination
+ Y
+
+
+ Set creator to daemon user
+ Retired by Exists on Destination
+ Y
+
+
+ Retired by Exists on Destination
+ insert merge mapping for missing retired by
+ Y
+
+
+ insert merge mapping for missing retired by
+ Set retired by to daemon user
+ Y
+
+
+ Set retired by to daemon user
+ Save Missing concept datatype into Destination
+ Y
+
+
+
+ Concept datatype Creator uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_creator_uuid from users where user_id = ?
+ Y
+ N
+
+
+ creator
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 208
+ 240
+ Y
+
+
+
+ Concept datatype in Source Not Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ Concept datatype Creator uuid From Destination
+
+
+
+ N
+ destination_concept_datatype_id
+ IS NULL
+
+
+
+
+
+
+
+
+
+
+
+ 336
+ 368
+ Y
+
+
+
+ Concept datatypes In Both Source & Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select concept_datatype_id as destination_concept_datatype_id from concept_datatype where uuid = ?
+ Y
+ N
+
+
+ uuid
+ String
+
+
+
+
+
+
+
+
+
+
+ 144
+ 336
+ Y
+
+
+
+ Creator Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ Retired by Exists on Destination
+ insert merge mapping for missing creator
+
+
+ N
+ destination_creator_uuid
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+ 352
+ 96
+ Y
+
+
+
+ Daemon user
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select user_id as daemon_user_id from users where system_id = 'daemon';
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 256
+ 16
+ Y
+
+
+
+ Load concept datatypes from Source
+ TableInput
+
+ N
+
+ 1
+
+ none
+
+
+ OpenMRS source
+ SELECT * FROM concept_datatype
+ 0
+
+ N
+ N
+ N
+
+
+
+
+
+
+
+
+ 112
+ 32
+ Y
+
+
+
+ Retired by Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ Save Missing concept datatype into Destination
+ insert merge mapping for missing retired by
+
+
+ N
+ destination_retired_by_uuid
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+ 720
+ 16
+ Y
+
+
+
+ Save Missing concept datatype into Destination
+ TableOutput
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+
+
concept_datatype
+ 1000
+ N
+ N
+ Y
+ Y
+ N
+
+ N
+ Y
+ N
+
+ Y
+ N
+
+
+
+ name
+ name
+
+
+ hl7_abbreviation
+ hl7_abbreviation
+
+
+ description
+ description
+
+
+ creator
+ creator
+
+
+ date_created
+ date_created
+
+
+ retired
+ retired
+
+
+ retired_by
+ retired_by
+
+
+ date_retired
+ date_retired
+
+
+ retire_reason
+ retire_reason
+
+
+ uuid
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 944
+ 48
+ Y
+
+
+
+ Set creator to daemon user
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ creator
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 608
+ 144
+ Y
+
+
+
+ Set retired by to daemon user
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ retired_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 809
+ 174
+ Y
+
+
+
+ User retired by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_retired_by_uuid from users where user_id = ?
+ Y
+ N
+
+
+ retired_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 224
+ 160
+ Y
+
+
+
+ insert merge mapping for concept datatype
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept_datatype', 'concept_datatype_id', ?, ?);
+ Y
+
+
+
+
+
+
+ concept_datatype_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 464
+ 16
+ Y
+
+
+
+ insert merge mapping for missing creator
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept_datatype', 'creator', ?, ?);
+ Y
+
+
+
+
+
+
+ creator
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 416
+ 288
+ Y
+
+
+
+ insert merge mapping for missing retired by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept_datatype', 'retired_by', ?, ?);
+ Y
+
+
+
+
+
+
+ retired_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 656
+ 240
+ Y
+
+
+
+
+
+
+ N
+
+
diff --git a/src/main/resources/pdiresources/transformations/merge-concepts.ktr b/src/main/resources/pdiresources/transformations/merge-concepts.ktr
new file mode 100644
index 0000000..0e695c5
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/merge-concepts.ktr
@@ -0,0 +1,1858 @@
+
+
+
+ merge-concepts
+
+
+
+ Normal
+ 0
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/06 09:23:50.203
+ -
+ 2019/08/06 09:23:50.203
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ OpenMRS destination
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+ OpenMRS source
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_SOURCE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+ Creator on Destination
+ insert merge mapping for missing creator
+ Y
+
+
+ Load Concepts from Source
+ Concepts In Both Source & Destination
+ Y
+
+
+ Concepts In Both Source & Destination
+ Concepts in Source Not Destination
+ Y
+
+
+ Concepts in Source Not Destination
+ Concept Creator uuid From Destination
+ Y
+
+
+ insert merge mapping for missing creator
+ Set creator to daemon user
+ Y
+
+
+ insert merge mapping for concept
+ Creator on Destination
+ Y
+
+
+ Concept Changed by uuid From Destination
+ Concept retired by uuid From Destination
+ Y
+
+
+ Changed by on Destination
+ Retired By on Destination
+ Y
+
+
+ Changed by on Destination
+ insert merge mapping for missing changed by
+ Y
+
+
+ insert merge mapping for missing changed by
+ Set changed by to daemon id
+ Y
+
+
+ Set changed by to daemon id
+ Retired By on Destination
+ Y
+
+
+ Retired By on Destination
+ insert merge mapping for missing retired by
+ Y
+
+
+ insert merge mapping for missing retired by
+ Set retired by to daemon id
+ Y
+
+
+ Concept Creator uuid From Destination
+ Concept Changed by uuid From Destination
+ Y
+
+
+ Concept class uuid From Destination
+ Concept datatype uuid From Destination
+ Y
+
+
+ Concept datatype uuid From Destination
+ Daemon user/person
+ Y
+
+
+ Set creator to daemon user
+ Changed by on Destination
+ Y
+
+
+ Creator on Destination
+ Changed by on Destination
+ Y
+
+
+ Set retired by to daemon id
+ Class on Destination
+ Y
+
+
+ Retired By on Destination
+ Class on Destination
+ Y
+
+
+ Daemon user/person
+ Misc Concept class
+ Y
+
+
+ Misc Concept class
+ Misc Concept datatype
+ Y
+
+
+ Misc Concept datatype
+ insert merge mapping for concept
+ Y
+
+
+ Class on Destination
+ insert merge mapping for missing class
+ Y
+
+
+ insert merge mapping for missing class
+ Set class to misc class
+ Y
+
+
+ Set class to misc class
+ Datatype on Destination
+ Y
+
+
+ Class on Destination
+ Datatype on Destination
+ Y
+
+
+ Datatype on Destination
+ insert merge mapping for missing datatype
+ Y
+
+
+ insert merge mapping for missing datatype
+ Set class to na datatype
+ Y
+
+
+ Set class to na datatype
+ Save Missing concept into Destination
+ Y
+
+
+ Datatype on Destination
+ Save Missing concept into Destination
+ Y
+
+
+ Concept retired by uuid From Destination
+ Concept class uuid From Destination
+ Y
+
+
+
+ Changed by on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing changed by
+ Retired By on Destination
+
+
+ N
+
+
+ N
+ destination_changed_by
+ IS NULL
+
+
+
+ N
+ AND
+ changed_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 624
+ 96
+ Y
+
+
+
+ Class on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing class
+ Datatype on Destination
+
+
+ N
+
+
+ N
+ destination_concept_class_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ class_id
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 832
+ 128
+ Y
+
+
+
+ Concept Changed by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT DISTINCT uuid as destination_changed_by from users where user_id = ?
+ Y
+ N
+
+
+ changed_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 240
+ 288
+ Y
+
+
+
+ Concept Creator uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT DISTINCT uuid as destination_creator_uuid from users where user_id = ?
+ Y
+ N
+
+
+ creator
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 240
+ 352
+ Y
+
+
+
+ Concept class uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT DISTINCT uuid as destination_concept_class_uuid from concept_class where concept_class_id = ?
+ Y
+ N
+
+
+ class_id
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 256
+ 160
+ Y
+
+
+
+ Concept datatype uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_datatype_uuid from concept_datatype where concept_datatype_id = ?
+ Y
+ N
+
+
+ datatype_id
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 208
+ 96
+ Y
+
+
+
+ Concept retired by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT DISTINCT uuid as destination_retired_by from users where retired_by = ?
+ Y
+ N
+
+
+ retired_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 320
+ 224
+ Y
+
+
+
+ Concepts In Both Source & Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select concept_id as destination_concept_id from concept where uuid = ?
+ Y
+ N
+
+
+ uuid
+ String
+
+
+
+
+
+
+
+
+
+
+ 128
+ 544
+ Y
+
+
+
+ Concepts in Source Not Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ Concept Creator uuid From Destination
+
+
+
+ N
+ destination_concept_id
+ IS NULL
+
+
+
+
+
+
+
+
+
+
+
+ 208
+ 432
+ Y
+
+
+
+ Creator on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing creator
+ Changed by on Destination
+
+
+ N
+
+
+ N
+ destination_creator_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ creator
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 320
+ 480
+ Y
+
+
+
+ Daemon user/person
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select user_id AS daemon_user_id, person_id AS daemon_person_id from users where system_id = 'daemon';
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 224
+ 32
+ Y
+
+
+
+ Datatype on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing datatype
+ Save Missing concept into Destination
+
+
+ N
+
+
+ N
+ destination_datatype_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ datatype_id
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 816
+ 320
+ Y
+
+
+
+ Load Concepts from Source
+ TableInput
+
+ N
+
+ 1
+
+ none
+
+
+ OpenMRS source
+ SELECT * FROM concept
+ 0
+
+ N
+ N
+ N
+
+
+
+
+
+
+
+
+ 96
+ 16
+ Y
+
+
+
+ Misc Concept class
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select concept_class_id AS misc_concept_class_id from concept_class where `name` = 'Misc';
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 304
+ 0
+ Y
+
+
+
+ Misc Concept datatype
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select concept_datatype_id AS na_concept_datatype_id from concept_datatype where `name` = 'N/A';
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 368
+ 80
+ Y
+
+
+
+ Retired By on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing retired by
+ Class on Destination
+
+
+ N
+
+
+ N
+ destination_retired_by
+ IS NULL
+
+
+
+ N
+ AND
+ retired_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 688
+ 192
+ Y
+
+
+
+ Save Missing concept into Destination
+ TableOutput
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+
+
concept
+ 1000
+ N
+ N
+ Y
+ Y
+ N
+
+ N
+ Y
+ N
+
+ Y
+ N
+
+
+
+ retired
+ retired
+
+
+ short_name
+ short_name
+
+
+ description
+ description
+
+
+ form_text
+ form_text
+
+
+ datatype_id
+ datatype_id
+
+
+ class_id
+ class_id
+
+
+ is_set
+ is_set
+
+
+ creator
+ creator
+
+
+ date_created
+ date_created
+
+
+ version
+ version
+
+
+ changed_by
+ changed_by
+
+
+ date_changed
+ date_changed
+
+
+ retired_by
+ retired_by
+
+
+ date_retired
+ date_retired
+
+
+ retire_reason
+ retire_reason
+
+
+ uuid
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 960
+ 384
+ Y
+
+
+
+ Set changed by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ changed_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 560
+ 208
+ Y
+
+
+
+ Set class to misc class
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ class_id
+ misc_concept_class_id
+
+
+
+
+
+
+
+
+
+
+ 544
+ 384
+ Y
+
+
+
+ Set class to na datatype
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ datatype_id
+ na_concept_datatype_id
+
+
+
+
+
+
+
+
+
+
+ 562
+ 510
+ Y
+
+
+
+ Set creator to daemon user
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ creator
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 624
+ 16
+ Y
+
+
+
+ Set retired by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ retired_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 432
+ 416
+ Y
+
+
+
+ insert merge mapping for concept
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept', 'concept_id', ?, ?);
+ Y
+
+
+
+
+
+
+ concept_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 496
+ 32
+ Y
+
+
+
+ insert merge mapping for missing changed by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('users', 'changed_by', ?, ?);
+ Y
+
+
+
+
+
+
+ changed_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 800
+ 48
+ Y
+
+
+
+ insert merge mapping for missing class
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept', 'class_id', ?, ?);
+ Y
+
+
+
+
+
+
+ class_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 752
+ 256
+ Y
+
+
+
+ insert merge mapping for missing creator
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept', 'creator', ?, ?);
+ Y
+
+
+
+
+
+
+ creator
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 496
+ 128
+ Y
+
+
+
+ insert merge mapping for missing datatype
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('concept', 'datatype_id', ?, ?);
+ Y
+
+
+
+
+
+
+ datatype_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 688
+ 416
+ Y
+
+
+
+ insert merge mapping for missing retired by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('users', 'retired_by', ?, ?);
+ Y
+
+
+
+
+
+
+ retired_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 512
+ 320
+ Y
+
+
+
+
+
+
+ N
+
+
diff --git a/src/main/resources/pdiresources/transformations/merge-person-attribute-types.ktr b/src/main/resources/pdiresources/transformations/merge-person-attribute-types.ktr
new file mode 100644
index 0000000..0c6f75c
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/merge-person-attribute-types.ktr
@@ -0,0 +1,1638 @@
+
+
+
+ merge-person-attribute-types
+
+
+
+ Normal
+ 0
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/06 09:23:50.203
+ -
+ 2019/08/06 09:23:50.203
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ OpenMRS destination
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+ OpenMRS source
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_SOURCE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+ Load Person Attibute Types from Source
+ Person Attibute Types In Both Source & Destination
+ Y
+
+
+ Person Attibute Types In Both Source & Destination
+ Person Attibute Types in Source Not Destination
+ Y
+
+
+ insert merge mapping for person Attibute Types
+ Creator Exists on Destination
+ Y
+
+
+ Creator Exists on Destination
+ insert merge mapping for missing creator
+ Y
+
+
+ insert merge mapping for missing creator
+ Set creator to daemon user
+ Y
+
+
+ Person Attibute Types in Source Not Destination
+ Person Attibute Type Creator uuid From Destination
+ Y
+
+
+ Person Attibute Type Creator uuid From Destination
+ Person Attibute Type retired by uuid From Destination
+ Y
+
+
+ Changed by Exists on Destination
+ Retired By Exists on Destination
+ Y
+
+
+ Changed by Exists on Destination
+ insert merge mapping for missing changed by
+ Y
+
+
+ Retired By Exists on Destination
+ insert merge mapping for missing retired by
+ Y
+
+
+ Set changed by to daemon id
+ Retired By Exists on Destination
+ Y
+
+
+ insert merge mapping for missing changed by
+ Set changed by to daemon id
+ Y
+
+
+ insert merge mapping for missing retired by
+ Set retired by to daemon id
+ Y
+
+
+ Set creator to daemon user
+ Changed by Exists on Destination
+ Y
+
+
+ Creator Exists on Destination
+ Changed by Exists on Destination
+ Y
+
+
+ Person Attibute Type retired by uuid From Destination
+ Person Attibute Type Changed by uuid From Destination
+ Y
+
+
+ Daemon user
+ insert merge mapping for person Attibute Types
+ Y
+
+
+ Person Attibute Type Changed by uuid From Destination
+ Person Attibute Type Privilege uuid From Destination
+ Y
+
+
+ Retired By Exists on Destination
+ Privilege Exists on Destination
+ Y
+
+
+ Set retired by to daemon id
+ Privilege Exists on Destination
+ Y
+
+
+ Privilege Exists on Destination
+ Save Missing person Attibute Types into Destination
+ Y
+
+
+ Privilege Exists on Destination
+ insert merge mapping for missing privilege
+ Y
+
+
+ insert merge mapping for missing privilege
+ Set edit_privilege to daemon privilege
+ Y
+
+
+ Set edit_privilege to daemon privilege
+ Save Missing person Attibute Types into Destination
+ Y
+
+
+ Person Attibute Type Privilege uuid From Destination
+ Daemon privilege
+ Y
+
+
+ Daemon privilege
+ Daemon user
+ Y
+
+
+
+ Changed by Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing changed by
+ Retired By Exists on Destination
+
+
+ N
+
+
+ N
+ destination_changed_by
+ IS NULL
+
+
+
+ N
+ AND
+ changed_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 576
+ 80
+ Y
+
+
+
+ Creator Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing creator
+ Changed by Exists on Destination
+
+
+ N
+
+
+ N
+ destination_creator_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ creator
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 400
+ 96
+ Y
+
+
+
+ Daemon user
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select user_id as daemon_user_id from users where system_id = 'daemon';
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 416
+ 0
+ Y
+
+
+
+ Load Person Attibute Types from Source
+ TableInput
+
+ N
+
+ 1
+
+ none
+
+
+ OpenMRS source
+ SELECT * FROM person_attribute_type
+ 0
+
+ N
+ N
+ N
+
+
+
+
+
+
+
+
+ 0
+ 192
+ Y
+
+
+
+ Person Attibute Type Creator uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_creator_uuid from users where user_id = ?
+ Y
+ N
+
+
+ creator
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 224
+ 176
+ Y
+
+
+
+ Person Attibute Type retired by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_retired_by from users where user_id = ?
+ Y
+ N
+
+
+ retired_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 176
+ 144
+ Y
+
+
+
+ Person Attibute Types In Both Source & Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select person_attribute_type_id as destination_person_attribute_type_id from person_attribute_type where uuid = ?
+ Y
+ N
+
+
+ uuid
+ String
+
+
+
+
+
+
+
+
+
+
+ 112
+ 304
+ Y
+
+
+
+ Person Attibute Types in Source Not Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ Person Attibute Type Creator uuid From Destination
+
+
+
+ N
+ destination_person_attribute_type_id
+ IS NULL
+
+
+
+
+
+
+
+
+
+
+
+ 144
+ 240
+ Y
+
+
+
+ Person Attibute Type Changed by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_changed_by from users where user_id = ?
+ Y
+ N
+
+
+ changed_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 176
+ 80
+ Y
+
+
+
+ Save Missing person Attibute Types into Destination
+ TableOutput
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+
+
person_attribute_type
+ 1000
+ N
+ N
+ Y
+ Y
+ N
+
+ N
+ Y
+ N
+
+ Y
+ N
+
+
+
+ name
+ name
+
+
+ description
+ description
+
+
+ format
+ format
+
+
+ foreign_key
+ foreign_key
+
+
+ searchable
+ searchable
+
+
+ creator
+ creator
+
+
+ date_created
+ date_created
+
+
+ changed_by
+ changed_by
+
+
+ date_changed
+ date_changed
+
+
+ retired
+ retired
+
+
+ retired_by
+ retired_by
+
+
+ date_retired
+ date_retired
+
+
+ retire_reason
+ retire_reason
+
+
+ edit_privilege
+ edit_privilege
+
+
+ uuid
+ uuid
+
+
+ sort_weight
+ sort_weight
+
+
+
+
+
+
+
+
+
+
+ 1008
+ 288
+ Y
+
+
+
+ Set changed by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ changed_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 832
+ 64
+ Y
+
+
+
+ Set creator to daemon user
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ creator
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 528
+ 160
+ Y
+
+
+
+ Set retired by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ retired_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 800
+ 192
+ Y
+
+
+
+ Retired By Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing retired by
+ Privilege Exists on Destination
+
+
+ N
+
+
+ N
+ destination_retired_by
+ IS NULL
+
+
+
+ N
+ AND
+ retired_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 704
+ 112
+ Y
+
+
+
+ insert merge mapping for missing changed by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute_type', 'changed_by', ?, ?);
+ Y
+
+
+
+
+
+
+ changed_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 912
+ 0
+ Y
+
+
+
+ insert merge mapping for missing creator
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute_type', 'creator', ?, ?);
+ Y
+
+
+
+
+
+
+ creator
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 384
+ 224
+ Y
+
+
+
+ insert merge mapping for missing retired by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute_type', 'retired_by', ?, ?);
+ Y
+
+
+
+
+
+
+ retired_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 656
+ 208
+ Y
+
+
+
+ insert merge mapping for person Attibute Types
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute_type', 'person_attribute_type_id', ?, ?);
+ Y
+
+
+
+
+
+
+ person_attribute_type_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 592
+ 16
+ Y
+
+
+
+ Person Attibute Type Privilege uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_privilege from privilege where privilege = ?
+ Y
+ N
+
+
+ edit_privilege
+ String
+
+
+
+
+
+
+
+
+
+
+ 208
+ 16
+ Y
+
+
+
+ Privilege Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing privilege
+ Save Missing person Attibute Types into Destination
+
+
+ N
+
+
+ N
+ destination_privilege
+ IS NULL
+
+
+
+ N
+ AND
+ edit_privilege
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 928
+ 112
+ Y
+
+
+
+ Set edit_privilege to daemon privilege
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ edit_privilege
+ daemon_privilege
+
+
+
+
+
+
+
+
+
+
+ 624
+ 272
+ Y
+
+
+
+ insert merge mapping for missing privilege
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, text_answer, uuid) VALUES('person_attribute_type', 'edit_privilege', ?, ?);
+ Y
+
+
+
+
+
+
+ edit_privilege
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 832
+ 240
+ Y
+
+
+
+ Daemon privilege
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select privilege as daemon_privilege from privilege limit 1;
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 304
+ 0
+ Y
+
+
+
+
+
+
+ N
+
+
diff --git a/src/main/resources/pdiresources/transformations/merge-person-attributes.ktr b/src/main/resources/pdiresources/transformations/merge-person-attributes.ktr
new file mode 100644
index 0000000..c600ac2
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/merge-person-attributes.ktr
@@ -0,0 +1,1805 @@
+
+
+
+ merge-person-attributes
+
+
+
+ Normal
+ 0
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/06 09:23:50.203
+ -
+ 2019/08/06 09:23:50.203
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ OpenMRS destination
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+ OpenMRS source
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_SOURCE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+ Load Person Attibutes from Source
+ Person Attibutes In Both Source & Destination
+ Y
+
+
+ Person Attibutes In Both Source & Destination
+ Person Attibutes in Source Not Destination
+ Y
+
+
+ insert merge mapping for person attribute
+ Creator Exists on Destination
+ Y
+
+
+ Creator Exists on Destination
+ insert merge mapping for missing creator
+ Y
+
+
+ insert merge mapping for missing creator
+ Set creator to daemon user
+ Y
+
+
+ Person Attibutes in Source Not Destination
+ Person Attibute Creator uuid From Destination
+ Y
+
+
+ Person Attibute Creator uuid From Destination
+ Person Attibute voided by uuid From Destination
+ Y
+
+
+ Changed by Exists on Destination
+ Voided By Exists on Destination
+ Y
+
+
+ Changed by Exists on Destination
+ insert merge mapping for missing changed by
+ Y
+
+
+ Voided By Exists on Destination
+ insert merge mapping for missing voided by
+ Y
+
+
+ Set changed by to daemon id
+ Voided By Exists on Destination
+ Y
+
+
+ insert merge mapping for missing changed by
+ Set changed by to daemon id
+ Y
+
+
+ insert merge mapping for missing voided by
+ Set voided by to daemon id
+ Y
+
+
+ Set creator to daemon user
+ Changed by Exists on Destination
+ Y
+
+
+ Creator Exists on Destination
+ Changed by Exists on Destination
+ Y
+
+
+ Person Attibute voided by uuid From Destination
+ Person Attibute Type uuid From Destination
+ Y
+
+
+ Person Attibute Type uuid From Destination
+ Person Changed by uuid From Destination
+ Y
+
+
+ Voided By Exists on Destination
+ Person Attribute Type Exists on Destination
+ Y
+
+
+ Set voided by to daemon id
+ Person Attribute Type Exists on Destination
+ Y
+
+
+ Person Attribute Type Exists on Destination
+ insert merge mapping for missing person attribute type
+ Y
+
+
+ insert merge mapping for missing person attribute type
+ Set cause of death to none concept id
+ Y
+
+
+ Daemon user
+ Daemon person attribute type
+ Y
+
+
+ Daemon person attribute type
+ insert merge mapping for person attribute
+ Y
+
+
+ Person Changed by uuid From Destination
+ Person Person uuid From Destination
+ Y
+
+
+ Person Person uuid From Destination
+ Daemon user
+ Y
+
+
+ Person Attribute Type Exists on Destination
+ Person id on Destination
+ Y
+
+
+ Set cause of death to none concept id
+ Person id on Destination
+ Y
+
+
+ Person id on Destination
+ Save Missing persons into Destination
+ Y
+
+
+ Person id on Destination
+ insert merge mapping for missing person
+ Y
+
+
+ insert merge mapping for missing person
+ Set person id to daemon person
+ Y
+
+
+ Set person id to daemon person
+ Save Missing persons into Destination
+ Y
+
+
+
+ Person Attribute Type Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing person attribute type
+ Person id on Destination
+
+
+ N
+
+
+ N
+ destination_person_attribute_type_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ person_attribute_type_id
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 944
+ 112
+ Y
+
+
+
+ Changed by Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing changed by
+ Voided By Exists on Destination
+
+
+ N
+
+
+ N
+ destination_changed_by
+ IS NULL
+
+
+
+ N
+ AND
+ changed_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 576
+ 80
+ Y
+
+
+
+ Creator Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing creator
+ Changed by Exists on Destination
+
+
+ N
+
+
+ N
+ destination_creator_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ creator
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 400
+ 96
+ Y
+
+
+
+ Daemon person attribute type
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select person_attribute_type_id as daemon_person_attribute_type from person_attribute_type limit 1;
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 432
+ 0
+ Y
+
+
+
+ Daemon user
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select user_id as daemon_user_id, person_id as daemon_person_id from users where system_id = 'daemon';
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 352
+ 16
+ Y
+
+
+
+ Load Person Attibutes from Source
+ TableInput
+
+ N
+
+ 1
+
+ none
+
+
+ OpenMRS source
+ SELECT * FROM person_attribute
+ 0
+
+ N
+ N
+ N
+
+
+
+
+
+
+
+
+ 80
+ 144
+ Y
+
+
+
+ Person Attibute Type uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_person_attribute_type_uuid from person_attribute_type where person_attribute_type_id = ?
+ Y
+ N
+
+
+ person_attribute_type_id
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 208
+ 48
+ Y
+
+
+
+ Person Changed by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_changed_by from users where user_id = ?
+ Y
+ N
+
+
+ changed_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 80
+ 16
+ Y
+
+
+
+ Person Attibute Creator uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_creator_uuid from users where user_id = ?
+ Y
+ N
+
+
+ creator
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 240
+ 176
+ Y
+
+
+
+ Person Attibute voided by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_voided_by from users where user_id = ?
+ Y
+ N
+
+
+ voided_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 240
+ 112
+ Y
+
+
+
+ Person Attibutes In Both Source & Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select person_attribute_id as destination_person_attribute_id from person_attribute where uuid = ?
+ Y
+ N
+
+
+ uuid
+ String
+
+
+
+
+
+
+
+
+
+
+ 112
+ 304
+ Y
+
+
+
+ Person Attibutes in Source Not Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+
+
+ N
+ destination_person_attribute_id
+ IS NULL
+
+
+
+
+
+
+
+
+
+
+
+ 144
+ 224
+ Y
+
+
+
+ Save Missing persons into Destination
+ TableOutput
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+
+
person_attribute
+ 1000
+ N
+ N
+ Y
+ Y
+ N
+
+ N
+ Y
+ N
+
+ Y
+ N
+
+
+
+ person_id
+ person_id
+
+
+ value
+ value
+
+
+ person_attribute_type_id
+ person_attribute_type_id
+
+
+ creator
+ creator
+
+
+ date_created
+ date_created
+
+
+ changed_by
+ changed_by
+
+
+ date_changed
+ date_changed
+
+
+ voided
+ voided
+
+
+ voided_by
+ voided_by
+
+
+ date_voided
+ date_voided
+
+
+ void_reason
+ void_reason
+
+
+ uuid
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 464
+ 336
+ Y
+
+
+
+ Set cause of death to none concept id
+ SetValueField
+
+ N
+
+ 1
+
+ none
+
+
+
+
+ person_attribute_type_id
+ daemon_person_attribute_type
+
+
+
+
+
+
+
+
+
+
+ 935
+ 314
+ Y
+
+
+
+ Set changed by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ changed_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 832
+ 64
+ Y
+
+
+
+ Set creator to daemon user
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ creator
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 528
+ 160
+ Y
+
+
+
+ Set voided by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ voided_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 736
+ 176
+ Y
+
+
+
+ Voided By Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing voided by
+ Person Attribute Type Exists on Destination
+
+
+ N
+
+
+ N
+ destination_voided_by
+ IS NULL
+
+
+
+ N
+ AND
+ voided_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 704
+ 112
+ Y
+
+
+
+ insert merge mapping for missing person attribute type
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute', 'person_attribute_type_id', ?, ?);
+ Y
+
+
+
+
+
+
+ person_attribute_type_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 944
+ 224
+ Y
+
+
+
+ insert merge mapping for missing changed by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute', 'changed_by', ?, ?);
+ Y
+
+
+
+
+
+
+ changed_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 912
+ 0
+ Y
+
+
+
+ insert merge mapping for missing creator
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute', 'creator', ?, ?);
+ Y
+
+
+
+
+
+
+ creator
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 384
+ 256
+ Y
+
+
+
+ insert merge mapping for missing voided by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute', 'voided_by', ?, ?);
+ Y
+
+
+
+
+
+
+ voided_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 640
+ 208
+ Y
+
+
+
+ insert merge mapping for person attribute
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute', 'person_attribute_id', ?, ?);
+ Y
+
+
+
+
+
+
+ person_attribute_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 544
+ 16
+ Y
+
+
+
+ Person id on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing person
+ Save Missing persons into Destination
+
+
+ N
+
+
+ N
+ destination_person_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ person_id
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 688
+ 288
+ Y
+
+
+
+ Person Person uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_person_uuid from person where person_id = ?
+ Y
+ N
+
+
+ person_id
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 176
+ 0
+ Y
+
+
+
+ insert merge mapping for missing person
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person_attribute', 'person_id', ?, ?);
+ Y
+
+
+
+
+
+
+ person_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 864
+ 368
+ Y
+
+
+
+ Set person id to daemon person
+ SetValueField
+
+ N
+
+ 1
+
+ none
+
+
+
+
+ person_id
+ daemon_person_id
+
+
+
+
+
+
+
+
+
+
+ 672
+ 400
+ Y
+
+
+
+
+
+
+ N
+
+
diff --git a/src/main/resources/pdiresources/transformations/merge-persons.ktr b/src/main/resources/pdiresources/transformations/merge-persons.ktr
new file mode 100644
index 0000000..9952967
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/merge-persons.ktr
@@ -0,0 +1,1642 @@
+
+
+
+ merge-persons
+
+
+
+ Normal
+ 0
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/06 09:23:50.203
+ -
+ 2019/08/06 09:23:50.203
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ OpenMRS destination
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+ OpenMRS source
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_SOURCE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+ Load Persons from Source
+ Persons In Both Source & Destination
+ Y
+
+
+ Persons In Both Source & Destination
+ Persons in Source Not Destination
+ Y
+
+
+ insert merge mapping for persons
+ Creator Exists on Destination
+ Y
+
+
+ Creator Exists on Destination
+ insert merge mapping for missing creator
+ Y
+
+
+ insert merge mapping for missing creator
+ Set creator to daemon user
+ Y
+
+
+ Persons in Source Not Destination
+ Person Creator uuid From Destination
+ Y
+
+
+ Person Creator uuid From Destination
+ Person voided by uuid From Destination
+ Y
+
+
+ Person Changed by uuid From Destination
+ Daemon user
+ Y
+
+
+ Changed by Exists on Destination
+ Voided By Exists on Destination
+ Y
+
+
+ Changed by Exists on Destination
+ insert merge mapping for missing changed by
+ Y
+
+
+ Voided By Exists on Destination
+ insert merge mapping for missing voided by
+ Y
+
+
+ Set changed by to daemon id
+ Voided By Exists on Destination
+ Y
+
+
+ insert merge mapping for missing changed by
+ Set changed by to daemon id
+ Y
+
+
+ insert merge mapping for missing voided by
+ Set voided by to daemon id
+ Y
+
+
+ Set creator to daemon user
+ Changed by Exists on Destination
+ Y
+
+
+ Creator Exists on Destination
+ Changed by Exists on Destination
+ Y
+
+
+ Person voided by uuid From Destination
+ Person Cause of death uuid From Destination
+ Y
+
+
+ Person Cause of death uuid From Destination
+ Person Changed by uuid From Destination
+ Y
+
+
+ Voided By Exists on Destination
+ Cause of death Exists on Destination
+ Y
+
+
+ Set voided by to daemon id
+ Cause of death Exists on Destination
+ Y
+
+
+ Cause of death Exists on Destination
+ Save Missing persons into Destination
+ Y
+
+
+ Cause of death Exists on Destination
+ insert merge mapping for missing cause of death
+ Y
+
+
+ insert merge mapping for missing cause of death
+ Set cause of death to none concept id
+ Y
+
+
+ Set cause of death to none concept id
+ Save Missing persons into Destination
+ Y
+
+
+ Daemon user
+ Daemon concept
+ Y
+
+
+ Daemon concept
+ insert merge mapping for persons
+ Y
+
+
+
+ Cause of death Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing cause of death
+ Save Missing persons into Destination
+
+
+ N
+
+
+ N
+ destination_cause_of_death_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ cause_of_death
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 944
+ 128
+ Y
+
+
+
+ Changed by Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing changed by
+ Voided By Exists on Destination
+
+
+ N
+
+
+ N
+ destination_changed_by
+ IS NULL
+
+
+
+ N
+ AND
+ changed_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 576
+ 80
+ Y
+
+
+
+ Creator Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing creator
+ Changed by Exists on Destination
+
+
+ N
+
+
+ N
+ destination_creator_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ creator
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 400
+ 96
+ Y
+
+
+
+ Daemon concept
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select concept_id as daemon_concept_id from concept limit 1;
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 384
+ 0
+ Y
+
+
+
+ Daemon user
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select user_id as daemon_user_id from users where system_id = 'daemon';
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 304
+ 16
+ Y
+
+
+
+ Load Persons from Source
+ TableInput
+
+ N
+
+ 1
+
+ none
+
+
+ OpenMRS source
+ SELECT * FROM person
+ 0
+
+ N
+ N
+ N
+
+
+
+
+
+
+
+
+ 64
+ 16
+ Y
+
+
+
+ Person Cause of death uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_cause_of_death_uuid from concept where concept_id = ?
+ Y
+ N
+
+
+ cause_of_death
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 208
+ 48
+ Y
+
+
+
+ Person Changed by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_changed_by from users where user_id = ?
+ Y
+ N
+
+
+ changed_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 192
+ 0
+ Y
+
+
+
+ Person Creator uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_creator_uuid from users where user_id = ?
+ Y
+ N
+
+
+ creator
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 240
+ 176
+ Y
+
+
+
+ Person voided by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_voided_by from users where user_id = ?
+ Y
+ N
+
+
+ voided_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 240
+ 112
+ Y
+
+
+
+ Persons In Both Source & Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select person_id as destination_person_id from person where uuid = ?
+ Y
+ N
+
+
+ uuid
+ String
+
+
+
+
+
+
+
+
+
+
+ 112
+ 304
+ Y
+
+
+
+ Persons in Source Not Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ Person Creator uuid From Destination
+
+
+
+ N
+ destination_person_id
+ IS NULL
+
+
+
+
+
+
+
+
+
+
+
+ 144
+ 240
+ Y
+
+
+
+ Save Missing persons into Destination
+ TableOutput
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+
+
person
+ 1000
+ N
+ N
+ Y
+ Y
+ N
+
+ N
+ Y
+ N
+
+ Y
+ N
+
+
+
+ uuid
+ uuid
+
+
+ birthdate
+ birthdate
+
+
+ gender
+ gender
+
+
+ birthdate_estimated
+ birthdate_estimated
+
+
+ dead
+ dead
+
+
+ death_date
+ death_date
+
+
+ cause_of_death
+ cause_of_death
+
+
+ creator
+ creator
+
+
+ date_created
+ date_created
+
+
+ changed_by
+ changed_by
+
+
+ date_changed
+ date_changed
+
+
+ voided
+ voided
+
+
+ voided_by
+ voided_by
+
+
+ date_voided
+ date_voided
+
+
+ void_reason
+ void_reason
+
+
+ deathdate_estimated
+ deathdate_estimated
+
+
+ birthtime
+ birthtime
+
+
+
+
+
+
+
+
+
+
+ 720
+ 320
+ Y
+
+
+
+ Set cause of death to none concept id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ cause_of_death
+ daemon_concept_id
+
+
+
+
+
+
+
+
+
+
+ 935
+ 314
+ Y
+
+
+
+ Set changed by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ changed_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 832
+ 64
+ Y
+
+
+
+ Set creator to daemon user
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ creator
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 528
+ 160
+ Y
+
+
+
+ Set voided by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ voided_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 800
+ 192
+ Y
+
+
+
+ Voided By Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing voided by
+ Cause of death Exists on Destination
+
+
+ N
+
+
+ N
+ destination_voided_by
+ IS NULL
+
+
+
+ N
+ AND
+ voided_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 704
+ 112
+ Y
+
+
+
+ insert merge mapping for missing cause of death
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person', 'cause_of_death', ?, ?);
+ Y
+
+
+
+
+
+
+ cause_of_death
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 944
+ 224
+ Y
+
+
+
+ insert merge mapping for missing changed by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person', 'changed_by', ?, ?);
+ Y
+
+
+
+
+
+
+ changed_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 912
+ 0
+ Y
+
+
+
+ insert merge mapping for missing creator
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person', 'creator', ?, ?);
+ Y
+
+
+
+
+
+
+ creator
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 384
+ 224
+ Y
+
+
+
+ insert merge mapping for missing voided by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person', 'voided_by', ?, ?);
+ Y
+
+
+
+
+
+
+ voided_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 656
+ 208
+ Y
+
+
+
+ insert merge mapping for persons
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('person', 'person_id', ?, ?);
+ Y
+
+
+
+
+
+
+ person_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 480
+ 16
+ Y
+
+
+
+
+
+
+ N
+
+
diff --git a/src/main/resources/pdiresources/transformations/merge-privileges.ktr b/src/main/resources/pdiresources/transformations/merge-privileges.ktr
new file mode 100644
index 0000000..290090c
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/merge-privileges.ktr
@@ -0,0 +1,780 @@
+
+
+
+ merge-privileges
+
+
+
+ Normal
+ 0
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/06 09:23:50.203
+ -
+ 2019/08/06 09:23:50.203
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ OpenMRS destination
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+ OpenMRS source
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_SOURCE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+ Load Privileges from Source
+ Privileges In Both Source & Destination
+ Y
+
+
+ insert merge mapping for privileges
+ Save Missing privileges into Destination
+ Y
+
+
+ Privileges In Both Source & Destination
+ Privilege in Source Not Destination
+ Y
+
+
+ Privilege in Source Not Destination
+ insert merge mapping for privileges
+ Y
+
+
+
+ Privileges In Both Source & Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select privilege as destination_privilege from privilege where uuid = ?
+ Y
+ N
+
+
+ uuid
+ String
+
+
+
+
+
+
+
+
+
+
+ 144
+ 336
+ Y
+
+
+
+ Load Privileges from Source
+ TableInput
+
+ N
+
+ 1
+
+ none
+
+
+ OpenMRS source
+ SELECT * FROM privilege;
+ 0
+
+ N
+ N
+ N
+
+
+
+
+
+
+
+
+ 112
+ 32
+ Y
+
+
+
+ Save Missing privileges into Destination
+ TableOutput
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+
+
privilege
+ 1000
+ N
+ N
+ Y
+ Y
+ N
+
+ N
+ Y
+ N
+
+ Y
+ N
+
+
+
+ privilege
+ privilege
+
+
+ description
+ description
+
+
+ uuid
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 816
+ 48
+ Y
+
+
+
+ insert merge mapping for privileges
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, text_answer, uuid) VALUES('privilege', 'privilege', ?, ?);
+ Y
+
+
+
+
+
+
+ privilege
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 448
+ 128
+ Y
+
+
+
+ Privilege in Source Not Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for privileges
+
+
+
+ N
+ destination_privilege
+ IS NULL
+
+
+
+
+
+
+
+
+
+
+
+ 288
+ 208
+ Y
+
+
+
+
+
+
+ N
+
+
diff --git a/src/main/resources/pdiresources/transformations/merge-users.ktr b/src/main/resources/pdiresources/transformations/merge-users.ktr
new file mode 100644
index 0000000..383ef4f
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/merge-users.ktr
@@ -0,0 +1,1601 @@
+
+
+
+ merge-users
+
+
+
+ Normal
+ 0
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/06 09:23:50.203
+ -
+ 2019/08/06 09:23:50.203
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ OpenMRS destination
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+ OpenMRS source
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_SOURCE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+ Creator Exists on Destination
+ insert merge mapping for missing creator
+ Y
+
+
+ Load Users from Source
+ Users In Both Source & Destination
+ Y
+
+
+ Users In Both Source & Destination
+ Users in Source Not Destination
+ Y
+
+
+ Users in Source Not Destination
+ User Creator uuid From Destination
+ Y
+
+
+ insert merge mapping for missing creator
+ Set creator to daemon user
+ Y
+
+
+ insert merge mapping for users
+ Creator Exists on Destination
+ Y
+
+
+ Daemon user/person
+ insert merge mapping for users
+ Y
+
+
+ Set creator to daemon user
+ Person Exists on Destination
+ Y
+
+
+ Creator Exists on Destination
+ Person Exists on Destination
+ Y
+
+
+ User Creator uuid From Destination
+ User Person uuid From Destination
+ Y
+
+
+ Person Exists on Destination
+ insert merge mapping for missing person
+ Y
+
+
+ insert merge mapping for missing person
+ Set person_id to daemon person id
+ Y
+
+
+ User Person uuid From Destination
+ User Changed by uuid From Destination
+ Y
+
+
+ User Changed by uuid From Destination
+ User retired by uuid From Destination
+ Y
+
+
+ User retired by uuid From Destination
+ Daemon user/person
+ Y
+
+
+ Set person_id to daemon person id
+ Changed by Exists on Destination
+ Y
+
+
+ Person Exists on Destination
+ Changed by Exists on Destination
+ Y
+
+
+ Changed by Exists on Destination
+ Retired By Exists on Destination
+ Y
+
+
+ Changed by Exists on Destination
+ insert merge mapping for missing changed by
+ Y
+
+
+ insert merge mapping for missing changed by
+ Set changed by to daemon id
+ Y
+
+
+ Set changed by to daemon id
+ Retired By Exists on Destination
+ Y
+
+
+ Retired By Exists on Destination
+ insert merge mapping for missing retired by
+ Y
+
+
+ Retired By Exists on Destination
+ Save Missing users into Destination
+ Y
+
+
+ insert merge mapping for missing retired by
+ Set retired by to daemon id
+ Y
+
+
+ Set retired by to daemon id
+ Save Missing users into Destination
+ Y
+
+
+
+ Changed by Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing changed by
+ Retired By Exists on Destination
+
+
+ N
+
+
+ N
+ destination_changed_by
+ IS NULL
+
+
+
+ N
+ AND
+ changed_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 960
+ 256
+ Y
+
+
+
+ Creator Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing creator
+ Person Exists on Destination
+
+
+ N
+
+
+ N
+ destination_creator_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ creator
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 320
+ 480
+ Y
+
+
+
+ Daemon user/person
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select user_id AS daemon_user_id, person_id AS daemon_person_id from users where system_id = 'daemon';
+ Y
+ N
+
+
+
+
+
+
+
+
+
+
+ 224
+ 32
+ Y
+
+
+
+ Load Users from Source
+ TableInput
+
+ N
+
+ 1
+
+ none
+
+
+ OpenMRS source
+ SELECT * FROM users
+ 0
+
+ N
+ N
+ N
+
+
+
+
+
+
+
+
+ 96
+ 16
+ Y
+
+
+
+ Person Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing person
+ Changed by Exists on Destination
+
+
+ N
+
+
+ N
+ destination_person_uuid
+ IS NULL
+
+
+
+ N
+ AND
+ person_id
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 880
+ 48
+ Y
+
+
+
+ Retired By Exists on Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ insert merge mapping for missing retired by
+ Save Missing users into Destination
+
+
+ N
+
+
+ N
+ destination_retired_by
+ IS NULL
+
+
+
+ N
+ AND
+ retired_by
+ IS NOT NULL
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 720
+ 384
+ Y
+
+
+
+ Save Missing users into Destination
+ TableOutput
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+
+
users
+ 1000
+ N
+ N
+ Y
+ Y
+ N
+
+ N
+ Y
+ N
+
+ Y
+ N
+
+
+
+ system_id
+ system_id
+
+
+ username
+ username
+
+
+ password
+ password
+
+
+ salt
+ salt
+
+
+ secret_question
+ secret_question
+
+
+ secret_answer
+ secret_answer
+
+
+ creator
+ creator
+
+
+ date_created
+ date_created
+
+
+ changed_by
+ changed_by
+
+
+ date_changed
+ date_changed
+
+
+ person_id
+ person_id
+
+
+ retired
+ retired
+
+
+ retired_by
+ retired_by
+
+
+ date_retired
+ date_retired
+
+
+ retire_reason
+ retire_reason
+
+
+ uuid
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 960
+ 384
+ Y
+
+
+
+ Set changed by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ changed_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 608
+ 336
+ Y
+
+
+
+ Set creator to daemon user
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ creator
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 704
+ 0
+ Y
+
+
+
+ Set person_id to daemon person id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ person_id
+ daemon_person_id
+
+
+
+
+
+
+
+
+
+
+ 816
+ 208
+ Y
+
+
+
+ Set retired by to daemon id
+ SetValueField
+
+ Y
+
+ 1
+
+ none
+
+
+
+
+ retired_by
+ daemon_user_id
+
+
+
+
+
+
+
+
+
+
+ 823
+ 455
+ Y
+
+
+
+ User Changed by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_changed_by from users where user_id = ?
+ Y
+ N
+
+
+ changed_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 240
+ 192
+ Y
+
+
+
+ User Creator uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_creator_uuid from users where user_id = ?
+ Y
+ N
+
+
+ creator
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 240
+ 336
+ Y
+
+
+
+ User Person uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_person_uuid from person where person_id = ?
+ Y
+ N
+
+
+ person_id
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 240
+ 272
+ Y
+
+
+
+ User retired by uuid From Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ SELECT uuid as destination_retired_by from users where user_id = ?
+ Y
+ N
+
+
+ retired_by
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 224
+ 112
+ Y
+
+
+
+ Users In Both Source & Destination
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ 0
+ select user_id as destination_user_id from users where uuid = ?
+ Y
+ N
+
+
+ uuid
+ String
+
+
+
+
+
+
+
+
+
+
+ 128
+ 544
+ Y
+
+
+
+ Users in Source Not Destination
+ FilterRows
+
+ Y
+
+ 1
+
+ none
+
+
+ User Creator uuid From Destination
+
+
+
+ N
+ destination_user_id
+ IS NULL
+
+
+
+
+
+
+
+
+
+
+
+ 208
+ 432
+ Y
+
+
+
+ insert merge mapping for missing changed by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('users', 'changed_by', ?, ?);
+ Y
+
+
+
+
+
+
+ changed_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 784
+ 288
+ Y
+
+
+
+ insert merge mapping for missing creator
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('users', 'creator', ?, ?);
+ Y
+
+
+
+
+
+
+ creator
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 592
+ 128
+ Y
+
+
+
+ insert merge mapping for missing person
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('users', 'person_id', ?, ?);
+ Y
+
+
+
+
+
+
+ person_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 816
+ 144
+ Y
+
+
+
+ insert merge mapping for missing retired by
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('users', 'retired_by', ?, ?);
+ Y
+
+
+
+
+
+
+ retired_by
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 672
+ 485
+ Y
+
+
+
+ insert merge mapping for users
+ ExecSQL
+
+ Y
+
+ 1
+
+ none
+
+
+ OpenMRS destination
+ Y
+ N
+ Y
+ N
+ INSERT INTO migrator_merge_mappings(entity, attribute, answer, uuid) VALUES('users', 'user_id', ?, ?);
+ Y
+
+
+
+
+
+
+ user_id
+
+
+ uuid
+
+
+
+
+
+
+
+
+
+
+ 496
+ 32
+ Y
+
+
+
+
+
+
+ N
+
+
diff --git a/src/main/resources/pdiresources/transformations/update-mapped-foreign-cause-of-death.ktr b/src/main/resources/pdiresources/transformations/update-mapped-foreign-cause-of-death.ktr
new file mode 100644
index 0000000..c20ecbe
--- /dev/null
+++ b/src/main/resources/pdiresources/transformations/update-mapped-foreign-cause-of-death.ktr
@@ -0,0 +1,718 @@
+
+
+
+ update-mapped-foreign-cause-of-death
+
+
+
+ Normal
+ /
+
+
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STATUS
+ Y
+ STATUS
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ STARTDATE
+ Y
+ STARTDATE
+
+
+ ENDDATE
+ Y
+ ENDDATE
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ DEPDATE
+ Y
+ DEPDATE
+
+
+ REPLAYDATE
+ Y
+ REPLAYDATE
+
+
+ LOG_FIELD
+ Y
+ LOG_FIELD
+
+
+ EXECUTING_SERVER
+ N
+ EXECUTING_SERVER
+
+
+ EXECUTING_USER
+ N
+ EXECUTING_USER
+
+
+ CLIENT
+ N
+ CLIENT
+
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ SEQ_NR
+ Y
+ SEQ_NR
+
+
+ LOGDATE
+ Y
+ LOGDATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ INPUT_BUFFER_ROWS
+ Y
+ INPUT_BUFFER_ROWS
+
+
+ OUTPUT_BUFFER_ROWS
+ Y
+ OUTPUT_BUFFER_ROWS
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ LOGGING_OBJECT_TYPE
+ Y
+ LOGGING_OBJECT_TYPE
+
+
+ OBJECT_NAME
+ Y
+ OBJECT_NAME
+
+
+ OBJECT_COPY
+ Y
+ OBJECT_COPY
+
+
+ REPOSITORY_DIRECTORY
+ Y
+ REPOSITORY_DIRECTORY
+
+
+ FILENAME
+ Y
+ FILENAME
+
+
+ OBJECT_ID
+ Y
+ OBJECT_ID
+
+
+ OBJECT_REVISION
+ Y
+ OBJECT_REVISION
+
+
+ PARENT_CHANNEL_ID
+ Y
+ PARENT_CHANNEL_ID
+
+
+ ROOT_CHANNEL_ID
+ Y
+ ROOT_CHANNEL_ID
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ TRANSNAME
+ Y
+ TRANSNAME
+
+
+ STEPNAME
+ Y
+ STEPNAME
+
+
+ STEP_COPY
+ Y
+ STEP_COPY
+
+
+ LINES_READ
+ Y
+ LINES_READ
+
+
+ LINES_WRITTEN
+ Y
+ LINES_WRITTEN
+
+
+ LINES_UPDATED
+ Y
+ LINES_UPDATED
+
+
+ LINES_INPUT
+ Y
+ LINES_INPUT
+
+
+ LINES_OUTPUT
+ Y
+ LINES_OUTPUT
+
+
+ LINES_REJECTED
+ Y
+ LINES_REJECTED
+
+
+ ERRORS
+ Y
+ ERRORS
+
+
+ LOG_FIELD
+ N
+ LOG_FIELD
+
+
+
+
+
+
+
+
+ ID_BATCH
+ Y
+ ID_BATCH
+
+
+ CHANNEL_ID
+ Y
+ CHANNEL_ID
+
+
+ LOG_DATE
+ Y
+ LOG_DATE
+
+
+ METRICS_DATE
+ Y
+ METRICS_DATE
+
+
+ METRICS_CODE
+ Y
+ METRICS_CODE
+
+
+ METRICS_DESCRIPTION
+ Y
+ METRICS_DESCRIPTION
+
+
+ METRICS_SUBJECT
+ Y
+ METRICS_SUBJECT
+
+
+ METRICS_TYPE
+ Y
+ METRICS_TYPE
+
+
+ METRICS_VALUE
+ Y
+ METRICS_VALUE
+
+
+
+
+
+
+
+ 0.0
+ 0.0
+
+ 10000
+ 50
+ 50
+ N
+ Y
+ 50000
+ Y
+
+ N
+ 1000
+ 100
+
+
+
+
+
+
+
+
+ -
+ 2019/08/29 02:16:38.102
+ -
+ 2019/08/29 02:16:38.102
+ H4sIAAAAAAAAAAMAAAAAAAAAAAA=
+ N
+
+
+
+
+ destination/merge
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_MERGE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+ source
+ ${ETL_DATABASE_HOST}
+ MYSQL
+ Native
+ ${ETL_SOURCE_DATABASE}
+ ${ETL_DATABASE_PORT}
+ ${ETL_DATABASE_USER}
+ ${ETL_DATABASE_PASSWORD}
+
+
+
+
+
+ FORCE_IDENTIFIERS_TO_LOWERCASE
+ N
+
+
+ FORCE_IDENTIFIERS_TO_UPPERCASE
+ N
+
+
+ IS_CLUSTERED
+ N
+
+
+ PORT_NUMBER
+ ${ETL_DATABASE_PORT}
+
+
+ PRESERVE_RESERVED_WORD_CASE
+ Y
+
+
+ QUOTE_ALL_FIELDS
+ N
+
+
+ STREAM_RESULTS
+ Y
+
+
+ SUPPORTS_BOOLEAN_DATA_TYPE
+ Y
+
+
+ SUPPORTS_TIMESTAMP_DATA_TYPE
+ Y
+
+
+ USE_POOLING
+ N
+
+
+
+
+
+ Read cause of death from mappings
+ Get entity's cause of death Source uuid
+ Y
+
+
+ Get entity's cause of death Source uuid
+ Get cause of death Destination entity id
+ Y
+
+
+ Get cause of death Destination entity id
+ Update entity's cause of death to mapped in destination
+ Y
+
+
+
+ Get cause of death Destination entity id
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ destination/merge
+ 0
+ SELECT concept_id as mapping_destination_cause_of_death_entity_id from concept where uuid = ?
+ Y
+ Y
+
+
+ source_concept_uuid
+ String
+
+
+
+
+
+
+
+
+
+
+ 784
+ 0
+ Y
+
+
+
+ Get entity's cause of death Source uuid
+ DBJoin
+
+ Y
+
+ 1
+
+ none
+
+
+ source
+ 0
+ SELECT uuid as source_concept_uuid from concept where concept_id = ?
+ Y
+ Y
+
+
+ mapping_source_cause_of_death_entity_id
+ Integer
+
+
+
+
+
+
+
+
+
+
+ 320
+ 16
+ Y
+
+
+
+ Read cause of death from mappings
+ TableInput
+
+ Y
+
+ 1
+
+ none
+
+
+ destination/merge
+ SELECT uuid AS mapping_source_entity_uuid, answer AS mapping_source_cause_of_death_entity_id FROM migrator_merge_mappings WHERE entity = '${ENTITY}' AND attribute = 'cause_of_death';
+ 0
+
+ N
+ Y
+ N
+
+
+
+
+
+
+
+
+ 768
+ 256
+ Y
+
+
+
+ Update entity's cause of death to mapped in destination
+ InsertUpdate
+
+ Y
+
+ 1
+
+ none
+
+
+ destination/merge
+ 100
+ N
+
+
+