# Testing MergePatientData Module

**URL:** https://talk.openmrs.org/t/testing-mergepatientdata-module/19242
**Category:** Development
**Created:** [August 1, 2018, 4:23pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242 "2018-08-01T16:23:50Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 1, 2018, 4:23pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/1 "2018-08-01T16:23:50Z")

</div>

Hi all,

More development has been done on the [mergepatientdata](https://wiki.openmrs.org/display/projects/Merge+Patient+data+from+Multiple+Installations) module. Currently, the module Supports the following resources.

- Patient
- Encounter
  1. Obs

**What we currently don’t support**

- **Visit** -This will be soon added. No worries
- **Order** -This will also be added soon
- **Diagnosis** -Pending…

**Testing the module**

Without testing the module on a serious/real dataset, I can’t be rest assured that the module actually works as expected. Before continuing with adding support for the rest of the Resources, lets first test what we have at hand.

Could someone with more Patient data want to help me out? Or is there a dump file around?

Source code :- [https://github.com/samuelmale/openmrs-module-mergepatientdata](https://github.com/samuelmale/openmrs-module-mergepatientdata)

cc: @ssmusoke, @dkayiwa

---

<div class="post-metadata">

### Author: ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)
#### Post date: [August 2, 2018, 3:47pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/2 "2018-08-02T15:47:15Z")

</div>

Try this data set from UgandaEMR Demo server [https://www.dropbox.com/s/n9czp7p785wigxw/demodata-v4.4.sql?dl=0](https://www.dropbox.com/s/n9czp7p785wigxw/demodata-v4.4.sql?dl=0)

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 3, 2018, 1:09pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/3 "2018-08-03T13:09:03Z")

</div>

Thanks @ssmusoke for this dataset. After executing it, I’m required to login with a User that has 'System Developer ’ role. I tried with the ‘admin’ User but failed on authentication.

> Unable to authenticate as a User with the System Developer role. Invalid username or password

I even went ahead and checked in the new db for the admin user’s Password and tried using it but all in vein.

Am looking at such a page

 ![screencapture-localhost-8080-openmrs-initialsetup-2018-08-03-16_05_51](https://talk.openmrs.org/uploads/default/original/2X/5/553d8e01e81fec0bdea7a6c2c570aad78942ac32.png)

CC: @dkayiwa

---

<div class="post-metadata">

### Author: ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)
#### Post date: [August 3, 2018, 1:15pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/4 "2018-08-03T13:15:31Z")

</div>

use test as the password - sorry forgot to send that over

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 3, 2018, 1:16pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/5 "2018-08-03T13:16:16Z")

</div>

Cool, it worked

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 3, 2018, 1:28pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/6 "2018-08-03T13:28:43Z")

</div>

On going ahead with the setup process, I hit upon this error.

> **[INFO 8/3/18 4:17 PM:liquibase: Reading from \`liquibasechangelog\`INFO 8/3/18...](https://pastebin.com/N5xCJCpd)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

@ssmusoke Am looking at such a page now 😳

 ![screencapture-localhost-8080-openmrs-initialsetup-2018-08-03-16_27_29](https://talk.openmrs.org/uploads/default/original/2X/d/dbc8275143bf2d620457d82c173e9c038877c0df.png)

CC: @dkayiwa

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [August 3, 2018, 2:41pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/7 "2018-08-03T14:41:51Z")

</div>

What is the value for “connection.url” in your runtime properties file?

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 3, 2018, 2:48pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/8 "2018-08-03T14:48:06Z")

</div>

@dkayiwa My ‘connection.url’ :` jdbc:mysql://localhost:3306/server1?autoReconnect=true&sessionVariables=default_storage_engine%3DInnoDB&useUnicode=true&characterEncoding=UTF-8`

Deep investigation in this shows, there is something(I’m not sure what!) thats setting @@sql\_mode to ‘NO\_ZERO\_DATE’. This causes mysql to reject null and ‘000.0.0’ dates. I reset manually to something like ‘ALLOW\_INVALID\_DATES’ but it works when I myself injects liquibase changesets manually.

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [August 3, 2018, 3:03pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/9 "2018-08-03T15:03:13Z")

</div>

Append this to your database connection url and try again (without the quotes) “&zeroDateTimeBehavior=convertToNull”

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 3, 2018, 3:08pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/10 "2018-08-03T15:08:19Z")

</div>

Same issue persists @dkayiwa

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [August 3, 2018, 3:15pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/11 "2018-08-03T15:15:47Z")

</div>

Did you rerun openmrs? What is your current value for “connection.url”?

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 3, 2018, 3:18pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/12 "2018-08-03T15:18:55Z")

</div>

Yaaa, I restarted my server.

connection.url=jdbc:mysql://localhost:3306/server1?autoReconnect=true&sessionVariables=default\_storage\_engine%3DInnoDB&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 5, 2018, 8:30am UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/13 "2018-08-05T08:30:03Z")

</div>

connection.url=`jdbc:mysql://localhost:3306/server1?autoReconnect=true&sessionVariables=default_storage_engine%3DInnoDB&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull`

The issue still persists @dkayiwa

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [August 5, 2018, 10:38am UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/14 "2018-08-05T10:38:27Z")

</div>

Which version of MySQL are you running?

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 5, 2018, 10:43am UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/15 "2018-08-05T10:43:29Z")

</div>

Server version: 5.7.17 MySQL Community Server (GPL)

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [August 5, 2018, 11:32am UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/16 "2018-08-05T11:32:06Z")

</div>

Can you paste the entire log at [pastebin.com](http://pastebin.com)?

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 5, 2018, 11:49am UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/17 "2018-08-05T11:49:10Z")

</div>

@dkayiwa here we go [https://pastebin.com/0i87Z3D3](https://pastebin.com/0i87Z3D3)

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [August 5, 2018, 6:47pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/18 "2018-08-05T18:47:30Z")

</div>

When you look at your person\_address table, what is the default value for date\_created?

---

<div class="post-metadata">

### Author: ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)
#### Post date: [August 5, 2018, 7:12pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/19 "2018-08-05T19:12:19Z")

</div>

Ooops seems this is the culprit. The deafualt value is ‘0000-00-00 00:00:00’ @dkayiwa

---

<div class="post-metadata">

### Author: ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)
#### Post date: [August 5, 2018, 7:23pm UTC](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242/20 "2018-08-05T19:23:57Z")

</div>

Can you remove it and try again?

[Next page](https://talk.openmrs.org/t/testing-mergepatientdata-module/19242.md?page=2)
